use of com.github.hakko.musiccabinet.util.UnittestLibraryUtil.getFile in project musiccabinet by hakko.
the class JdbcPlaylistGeneratorDaoTest method prepareTestdataForArtist.
private int prepareTestdataForArtist() throws ApplicationException {
ArtistSimilarityParser asParser = new ArtistSimilarityParserImpl(new ResourceUtil(CHER_SIMILAR_ARTISTS).getInputStream());
artistRelationDao.createArtistRelations(asParser.getArtist(), asParser.getArtistRelations());
ArtistTopTracksParser attParser = new ArtistTopTracksParserImpl(new ResourceUtil(CHER_TOP_TRACKS).getInputStream());
artistTopTracksDao.createTopTracks(attParser.getArtist(), attParser.getTopTracks());
List<File> files = new ArrayList<>();
for (Track topTrack : attParser.getTopTracks()) {
files.add(UnittestLibraryUtil.getFile(topTrack));
}
UnittestLibraryUtil.submitFile(additionDao, files);
int artistId = musicDao.getArtistId(asParser.getArtist());
playlistGeneratorDao.updateSearchIndex();
return artistId;
}
Aggregations