Merge pull request #1387 from randomnicode/fixtestqueries

Fix test queries for limits
master
François-Xavier Thomas 5 years ago committed by GitHub
commit 821d8d6b8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      airsonic-main/src/test/java/org/airsonic/player/service/MediaScannerServiceTestCase.java
  2. 2
      airsonic-main/src/test/java/org/airsonic/player/service/search/SearchServiceTestCase.java

@ -135,13 +135,13 @@ public class MediaScannerServiceTestCase {
System.out.println("--- List of all artists ---"); System.out.println("--- List of all artists ---");
System.out.println("artistName#albumCount"); System.out.println("artistName#albumCount");
List<Artist> allArtists = artistDao.getAlphabetialArtists(0, 0, musicFolderDao.getAllMusicFolders()); List<Artist> allArtists = artistDao.getAlphabetialArtists(0, Integer.MAX_VALUE, musicFolderDao.getAllMusicFolders());
allArtists.forEach(artist -> System.out.println(artist.getName() + "#" + artist.getAlbumCount())); allArtists.forEach(artist -> System.out.println(artist.getName() + "#" + artist.getAlbumCount()));
System.out.println("--- *********************** ---"); System.out.println("--- *********************** ---");
System.out.println("--- List of all albums ---"); System.out.println("--- List of all albums ---");
System.out.println("name#artist"); System.out.println("name#artist");
List<Album> allAlbums = albumDao.getAlphabeticalAlbums(0, 0, true, true, musicFolderDao.getAllMusicFolders()); List<Album> allAlbums = albumDao.getAlphabeticalAlbums(0, Integer.MAX_VALUE, true, true, musicFolderDao.getAllMusicFolders());
allAlbums.forEach(album -> System.out.println(album.getName() + "#" + album.getArtist())); allAlbums.forEach(album -> System.out.println(album.getName() + "#" + album.getArtist()));
Assert.assertEquals(5, allAlbums.size()); Assert.assertEquals(5, allAlbums.size());
System.out.println("--- *********************** ---"); System.out.println("--- *********************** ---");
@ -196,14 +196,14 @@ public class MediaScannerServiceTestCase {
folders.add(musicFolder); folders.add(musicFolder);
// Test that the artist is correctly imported // Test that the artist is correctly imported
List<Artist> allArtists = artistDao.getAlphabetialArtists(0, 0, folders); List<Artist> allArtists = artistDao.getAlphabetialArtists(0, Integer.MAX_VALUE, folders);
Assert.assertEquals(1, allArtists.size()); Assert.assertEquals(1, allArtists.size());
Artist artist = allArtists.get(0); Artist artist = allArtists.get(0);
Assert.assertEquals("TestArtist", artist.getName()); Assert.assertEquals("TestArtist", artist.getName());
Assert.assertEquals(1, artist.getAlbumCount()); Assert.assertEquals(1, artist.getAlbumCount());
// Test that the album is correctly imported, along with its MusicBrainz release ID // Test that the album is correctly imported, along with its MusicBrainz release ID
List<Album> allAlbums = albumDao.getAlphabeticalAlbums(0, 0, true, true, folders); List<Album> allAlbums = albumDao.getAlphabeticalAlbums(0, Integer.MAX_VALUE, true, true, folders);
Assert.assertEquals(1, allAlbums.size()); Assert.assertEquals(1, allAlbums.size());
Album album = allAlbums.get(0); Album album = allAlbums.get(0);
Assert.assertEquals("TestAlbum", album.getName()); Assert.assertEquals("TestAlbum", album.getName());

@ -235,7 +235,7 @@ public class SearchServiceTestCase extends AbstractAirsonicHomeTest {
/* /*
* Acquisition of maximum number(5). * Acquisition of maximum number(5).
*/ */
List<Album> allAlbums = albumDao.getAlphabeticalAlbums(0, 0, true, true, allMusicFolders); List<Album> allAlbums = albumDao.getAlphabeticalAlbums(0, Integer.MAX_VALUE, true, true, allMusicFolders);
Assert.assertEquals("(26) Get all albums with Dao.", 5, allAlbums.size()); Assert.assertEquals("(26) Get all albums with Dao.", 5, allAlbums.size());
List<MediaFile> allRandomAlbums = searchService.getRandomAlbums(Integer.MAX_VALUE, List<MediaFile> allRandomAlbums = searchService.getRandomAlbums(Integer.MAX_VALUE,
allMusicFolders); allMusicFolders);

Loading…
Cancel
Save