Package com.github.hakko.musiccabinet.parser.lastfm

Examples of com.github.hakko.musiccabinet.parser.lastfm.ArtistInfoParserImpl


  public void illegalControlCharactersAreChomped1() throws ApplicationException {
    String ctrlCharResponse = new ResourceUtil(CTRL_CHAR_RESPONSE_1).getContent();
    WSResponse response = new WSResponse(ctrlCharResponse);

    // supposed to work, as WSResponse chomps illegal control characters
    new ArtistInfoParserImpl(new StringUtil(response.getResponseBody()).getInputStream());
   
    try {
      // supposed to fail, as it hasn't passed WSResponse
      new ArtistInfoParserImpl(new ResourceUtil(CTRL_CHAR_RESPONSE_1).getInputStream());
      Assert.fail();
    } catch (ApplicationException e) {
     
    }
  }
View Full Code Here


  @Before
  public void loadFunctionDependency() throws ApplicationException {
    PostgreSQLUtil.loadFunction(dao, UPDATE_ARTISTINFO);
   
    aiAbba = new ArtistInfoParserImpl(new ResourceUtil(
        AI_ABBA_FILE).getInputStream()).getArtistInfo();
    aiCher = new ArtistInfoParserImpl(new ResourceUtil(
        AI_CHER_FILE).getInputStream()).getArtistInfo();
    aiTina = new ArtistInfoParserImpl(new ResourceUtil(
        AI_TINA_FILE).getInputStream()).getArtistInfo();
   
    deleteArtists();

    // re-create artists
View Full Code Here

        WSResponse wsResponse = artistInfoClient.getArtistInfo(
            new Artist(artistName), lastFmSettingsService.getLang());
        if (wsResponse.wasCallAllowed() && wsResponse.wasCallSuccessful()) {
          StringUtil stringUtil = new StringUtil(wsResponse.getResponseBody());
          ArtistInfoParser aiParser =
            new ArtistInfoParserImpl(stringUtil.getInputStream());
          if (aiParser.getArtistInfo() != null) {
            artistInfos.add(aiParser.getArtistInfo());
          } else {
            LOG.warn("Artist info response for " + artistName
                + " not parsed correctly. Response was "
                + wsResponse.getResponseBody());
          }
View Full Code Here

TOP

Related Classes of com.github.hakko.musiccabinet.parser.lastfm.ArtistInfoParserImpl

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.