Package com.github.hakko.musiccabinet.util

Examples of com.github.hakko.musiccabinet.util.ResourceUtil


      public void addTrack(ItunesTrack track) {
        counter.incrementAndGet();
      }
    };
    new ItunesMusicLibraryParserImpl(
        new ResourceUtil(ITUNES_INDEX_FILE).getInputStream(), callback);
 
    Assert.assertEquals(10, counter.intValue());
  }
View Full Code Here


  private static final short YEAR_PART = 1966;
 
  @Test
  public void emptyResourceFileCorrectlyParsed() throws ApplicationException {
    ArtistQueryParser parser = new ArtistQueryParserImpl(
        new ResourceUtil(ARTIST_QUERY_EMPTY_FILE).getInputStream());
   
    MBArtist artist = parser.getArtist();
   
    assertNull(artist);
  }
View Full Code Here

  }

  @Test
  public void resourceFileCorrectlyParsed() throws ApplicationException {
    ArtistQueryParser parser = new ArtistQueryParserImpl(
        new ResourceUtil(ARTIST_QUERY_FILE).getInputStream());
   
    MBArtist artist = parser.getArtist();
   
    assertEquals(MBID, artist.getMbid());
    assertEquals(NAME, artist.getName());
View Full Code Here

  }

  @Test
  public void dateGetsStoredAsYearOnly() throws ApplicationException {
    ArtistQueryParser parser = new ArtistQueryParserImpl(
        new ResourceUtil(ARTIST_QUERY_DATE_FILE).getInputStream());
   
    MBArtist artist = parser.getArtist();
   
    assertEquals(YEAR_PART, artist.getStartYear());
  }
View Full Code Here

      "e8bfa13e-a5ab-3c50-8eb6-4b4b1f838679", "45d3cbc9-e0e3-40ab-b97e-e0d4e3ecd93d",
      "Plunk Records", "Under Feet Like Ours", "Album", 1999, "CD");

  @Test
  public void resourceFileCorrectlyParsed() throws ApplicationException {
    ReleaseParser parser = new ReleaseParserImpl(new ResourceUtil(
        RELEASE_FILE).getInputStream());
    List<MBRelease> releases = parser.getReleases();

    assertEquals(RELEASE_0, releases.get(0));
    assertEquals(RELEASE_1, releases.get(1));
View Full Code Here

    assertEquals(34, parser.getTotalReleases());
  }

  @Test
  public void emptyResponseIsReturnedAsNoReleases() throws ApplicationException {
    ReleaseParser parser = new ReleaseParserImpl(new ResourceUtil(
        RELEASE_EMPTY_FILE).getInputStream());
    List<MBRelease> releases = parser.getReleases();

    assertEquals(0, releases.size());
  }
View Full Code Here

  private static final int PLAY_COUNT = 29066127;
 
  @Test
  public void resourceFileCorrectlyParsed() throws ApplicationException {
    AlbumInfoParser parser = new AlbumInfoParserImpl(
        new ResourceUtil(ALBUM_INFO_FILE).getInputStream());
   
    AlbumInfo albumInfo = parser.getAlbumInfo();
   
    assertEquals(new Artist("Nirvana"), albumInfo.getAlbum().getArtist());
   
View Full Code Here

      );
 
  @Test
  public void resourceFileCorrectlyParsed() throws ApplicationException {
    GroupWeeklyArtistChartParser parser = new GroupWeeklyArtistChartParserImpl(
        new ResourceUtil(ARTIST_CHART_FILE).getInputStream());
    List<ArtistPlayCount> playCounts = parser.getArtistPlayCount();
   
    for (int i = 0; i < EXPECTED_PLAY_COUNTS.size(); i++) {
      assertEquals(EXPECTED_PLAY_COUNTS.get(i), playCounts.get(i));
    }
View Full Code Here

      );
 
  @Test
  public void resourceFileCorrectlyParsed() throws ApplicationException {
    UserTopArtistsParser parser = new UserTopArtistsParserImpl(
        new ResourceUtil(USER_TOP_ARTISTS_FILE).getInputStream());
    List<Artist> artists = parser.getArtists();
   
    for (int i = 0; i < EXPECTED_ARTISTS.size(); i++) {
      assertEquals(EXPECTED_ARTISTS.get(i), artists.get(i).getName());
    }
View Full Code Here

    "last.fm/xml/similartracks.cher.believe.xml";
 
  @Test
  public void resourceFileCorrectlyParsed() throws ApplicationException {
    TrackSimilarityParser parser = new TrackSimilarityParserImpl(
        new ResourceUtil(TRACK_SIMILARITY_FILE).getInputStream());
 
    assertNotNull(parser.getTrack());
    assertNotNull(parser.getTrackRelations());

    assertTrue(parser.getTrack().getArtist().getName().equals("Cher"));
View Full Code Here

TOP

Related Classes of com.github.hakko.musiccabinet.util.ResourceUtil

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.