Examples of ResourceUtil


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

    "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

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

  private static final String BIO_CONTENT = "<strong>ABBA</strong> was a <a href=\"http://www.last.fm/tag/pop\" class=\"bbcode_tag\" rel=\"tag\">pop</a> music group formed in Stockholm, Sweden in November 1970. The band consisted of <a href=\"http://www.last.fm/music/Anni-Frid+Lyngstad\" class=\"bbcode_artist\">Anni-Frid Lyngstad</a> (<a href=\"http://www.last.fm/music/Frida\" class=\"bbcode_artist\">Frida</a>), <a href=\"http://www.last.fm/music/Bj%C3%B6rn+Ulvaeus\" class=\"bbcode_artist\">Bj&ouml;rn Ulvaeus</a>, <a href=\"http://www.last.fm/music/Benny+Andersson\" class=\"bbcode_artist\">Benny Andersson</a>, and <a href=\"http://www.last.fm/music/Agnetha+F%C3%A4ltskog\" class=\"bbcode_artist\">Agnetha F&auml;ltskog</a>. (See also <a href=\"http://www.last.fm/music/Bj%25C3%25B6rn%2BUlvaeus%2B%2526%2BBenny%2BAndersson\" class=\"bbcode_artist\">Bj&ouml;rn Ulvaeus &amp; Benny Andersson</a>, as well as Benny's previous band <a href=\"http://www.last.fm/music/Hep+Stars\" class=\"bbcode_artist\">Hep Stars</a>.)\n \n They topped the charts worldwide from 1972 to 1982 with eight studio albums, achieving twenty-six #1 singles and numerous awards. They also won the 1974 Eurovision Song Contest with <a title=\"ABBA &ndash; Waterloo\" href=\"http://www.last.fm/music/ABBA/_/Waterloo\" class=\"bbcode_track\">Waterloo</a>.\n \n A <a href=\"http://www.last.fm/tag/jukebox%20musical\" class=\"bbcode_tag\" rel=\"tag\">jukebox musical</a> based on the music of ABBA titled <em><a href=\"http://en.wikipedia.org/wiki/Mamma_Mia!\" rel=\"nofollow\">Mamma Mia!</a></em> opened in London's West End in 1999 and has since become one of the most popular musicals in the world. In 2008, a movie version was made with <a href=\"http://www.last.fm/music/Meryl+Streep\" class=\"bbcode_artist\">Meryl Streep</a> among the cast.\n \n The recent <a href=\"http://rockhall.com/inductees/abba/\" rel=\"nofollow\">Rock and Roll Hall of Fame 2010 Induction Ceremony</a>, held on March 15 in New York, recognized the huge contribution of ABBA. Represented by Anni-Frid Lyngstad &quot;Frida&quot; and former husband/band member Benny Andersson, it was perhaps the crowning acknowledgment of the phenomenal success of Sweden's most famous four.";
 
  @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());
   
View Full Code Here

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

  }

  @Test
  public void emptyFileReturnsEmptyInfo() throws ApplicationException {
    ArtistInfoParser parser = new ArtistInfoParserImpl(
        new ResourceUtil(EMPTY_ARTIST_INFO_FILE).getInputStream());
   
    ArtistInfo artistInfo = parser.getArtistInfo();
   
    Assert.assertNull(artistInfo);
  }
View Full Code Here

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

    "last.fm/xml/toptracks.cher.xml";
 
  @Test
  public void resourceFileCorrectlyParsed() throws ApplicationException {
    ArtistTopTracksParser parser = new ArtistTopTracksParserImpl(
        new ResourceUtil(TOP_TRACK_FILE).getInputStream());
 
    assertNotNull(parser.getArtist());
    assertNotNull(parser.getTopTracks());

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

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

    "last.fm/xml/tracks.ftparea.xml";
 
  @Test
  public void resourceFileCorrectlyParsed() throws ApplicationException {
    ScrobbledTracksParser parser = new ScrobbledTracksParserImpl(
        new ResourceUtil(LIBRARY_TRACKS_FILE).getInputStream());
 
    assertNotNull(parser.getTrackPlayCounts());

    assertEquals(parser.getPage(), (short) 1);
    assertEquals(parser.getTotalPages(), (short) 151);
View Full Code Here

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

  private static final String KEY = "d580d57f32848f5dcf574d1ce18d78b2";
 
  @Test
  public void resourceFileCorrectlyParsed() throws ApplicationException {
    AuthSessionParser parser = new AuthSessionParserImpl(
        new ResourceUtil(AUTH_SESSION_FILE).getInputStream());

    LastFmUser lastFmUser = parser.getLastFmUser();

    assertNotNull(lastFmUser);
    assertEquals(NAME, lastFmUser.getLastFmUsername());
View Full Code Here

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

      );

  @Test
  public void resourceFileCorrectlyParsed() throws ApplicationException {
    UserRecommendedArtistsParser parser = new UserRecommendedArtistsParserImpl(
        new ResourceUtil(USER_RECOMMENDED_ARTISTS_FILE).getInputStream());
    List<RecommendedArtist> artists = parser.getArtists();
   
    for (int i = 0; i < EXPECTED_ARTISTS1.size(); i++) {
      assertEquals(EXPECTED_ARTISTS1.get(i), artists.get(i).getArtist().getName());
    }
View Full Code Here

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

    }
  }

  @Test
  public void resourceFile2CorrectlyParsed() throws ApplicationException {
    WSResponse wsResponse = new WSResponse(new ResourceUtil(
        USER_RECOMMENDED_ARTISTS_FILE2).getContent());
   
    UserRecommendedArtistsParser parser = new UserRecommendedArtistsParserImpl(
        new StringUtil(wsResponse.getResponseBody()).getInputStream());
    List<RecommendedArtist> artists = parser.getArtists();
View Full Code Here

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

    "last.fm/xml/userlovedtracks.rj.xml";
 
  @Test
  public void resourceFileCorrectlyParsed() throws ApplicationException {
    UserLovedTracksParser parser = new UserLovedTracksParserImpl(
        new ResourceUtil(LOVED_TRACKS_FILE).getInputStream());

    assertNotNull(parser.getLovedTracks());

    assertEquals(parser.getPage(), (short) 1);
    assertEquals(parser.getTotalPages(), (short) 13);
View Full Code Here

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

    "last.fm/xml/toptags.cher.xml";
 
  @Test
  public void resourceFileCorrectlyParsed() throws ApplicationException {
    ArtistTopTagsParser parser = new ArtistTopTagsParserImpl(
        new ResourceUtil(TOP_TAGS_FILE).getInputStream());
 
    assertNotNull(parser.getArtist());
    assertNotNull(parser.getTopTags());

    assertTrue(parser.getArtist().getName().equals("Cher"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.