use of com.github.hakko.musiccabinet.util.ResourceUtil in project musiccabinet by hakko.
the class MusicBrainzServiceTest method getReleaseClient.
private ReleaseClient getReleaseClient() throws ApplicationException {
ReleaseClient client = Mockito.mock(ReleaseClient.class);
Mockito.when(client.get(artistName, mbid, 0)).thenReturn(new ResourceUtil("musicbrainz/xml/release-col.xml").getContent());
return client;
}
use of com.github.hakko.musiccabinet.util.ResourceUtil in project musiccabinet by hakko.
the class MusicBrainzServiceTest method getArtistQueryClient.
private ArtistQueryClient getArtistQueryClient() throws ApplicationException {
ArtistQueryClient client = Mockito.mock(ArtistQueryClient.class);
Mockito.when(client.get(artistName)).thenReturn(new ResourceUtil("musicbrainz/xml/artistQuery.xml").getContent());
return client;
}
use of com.github.hakko.musiccabinet.util.ResourceUtil in project musiccabinet by hakko.
the class JdbcArtistTopTagsDaoTest method loadFunctionDependencyAndTestdata.
@Before
public void loadFunctionDependencyAndTestdata() throws ApplicationException {
PostgreSQLUtil.loadFunction(dao, UPDATE_ARTISTTOPTAG);
ArtistTopTagsParser cherParser = new ArtistTopTagsParserImpl(new ResourceUtil(CHER_TOP_TAGS).getInputStream());
ArtistTopTagsParser rihannaParser = new ArtistTopTagsParserImpl(new ResourceUtil(RIHANNA_TOP_TAGS).getInputStream());
cherArtist = cherParser.getArtist();
cherTopTags = cherParser.getTopTags();
rihannaArtist = rihannaParser.getArtist();
rihannaTopTags = rihannaParser.getTopTags();
PostgreSQLUtil.truncateTables(dao);
musicDao.setArtistId(cherArtist);
musicDao.setArtistId(rihannaArtist);
}
use of com.github.hakko.musiccabinet.util.ResourceUtil in project musiccabinet by hakko.
the class JdbcGroupWeeklyArtistChartDaoTest method loadFunctionDependency.
@Before
public void loadFunctionDependency() throws ApplicationException {
PostgreSQLUtil.loadFunction(dao, UPDATE_GROUP_WEEKLY_ARTIST_CHART);
PostgreSQLUtil.loadFunction(dao, UPDATE_LASTFMGROUP);
artistChart = new GroupWeeklyArtistChart(brainwashed.getName(), new GroupWeeklyArtistChartParserImpl(new ResourceUtil(BRAINWASHED_FILE).getInputStream()).getArtistPlayCount());
Collections.sort(artistChart.getArtistPlayCounts());
createArtistMetaData();
}
use of com.github.hakko.musiccabinet.util.ResourceUtil in project musiccabinet by hakko.
the class ArtistInfoParserTest method resourceFileCorrectlyParsed.
@Test
public void resourceFileCorrectlyParsed() throws ApplicationException {
ArtistInfoParser parser = new ArtistInfoParserImpl(new ResourceUtil(ARTIST_INFO_FILE).getInputStream());
ArtistInfo artistInfo = parser.getArtistInfo();
assertEquals(new Artist("ABBA"), artistInfo.getArtist());
assertEquals(SMALL_IMAGE_URL, artistInfo.getSmallImageUrl());
assertEquals(MEDIUM_IMAGE_URL, artistInfo.getMediumImageUrl());
assertEquals(LARGE_IMAGE_URL, artistInfo.getLargeImageUrl());
assertEquals(EXTRA_LARGE_IMAGE_URL, artistInfo.getExtraLargeImageUrl());
assertEquals(LISTENERS, artistInfo.getListeners());
assertEquals(PLAY_COUNT, artistInfo.getPlayCount());
assertEquals(BIO_SUMMARY, artistInfo.getBioSummary());
assertEquals(BIO_CONTENT, artistInfo.getBioContent());
}
Aggregations