Advertisement
Guest User

Untitled

a guest
May 30th, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. @Test
  2. public void testSomeMethod() {
  3. MAlbum album = new MAlbum();
  4. album.setBand(band);
  5. album.setName("album1");
  6. album.setGenre(MGenre.ROCK);
  7. ari.insert(album);
  8.  
  9. MSong song1 = new MSong();
  10. song1.setName("song1");
  11.  
  12. MSong song2 = new MSong();
  13. song2.setName("song2");
  14.  
  15. List<MSong> songs = new ArrayList<>();
  16. songs.add(song1);
  17. songs.add(song2);
  18.  
  19. for (MSong song : songs) {
  20. if (song != null) {
  21. song.setGenre(MGenre.ROCK);
  22. sri.insert(song);
  23. }
  24. }
  25. for (MSong song : songs) {
  26. if (song != null) {
  27. MAlbumSong mAlbumSong = new MAlbumSong();
  28. mAlbumSong.setAlbum(album);
  29. mAlbumSong.setSong(song);
  30. sut.insert(mAlbumSong);
  31. }
  32. }
  33. assertNotNull(sut.getMAlbumSongWithSomeAlbumNameAndSongName(album, song1));
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement