Package com.github.hakko.musiccabinet.domain.model.aggr

Examples of com.github.hakko.musiccabinet.domain.model.aggr.UserTopArtists


    userTopArtistsService.setLastFmSettingsService(lastFmSettingsService);
    userTopArtistsService.setUserTopArtistsClient(userTopArtistsClient);
    userTopArtistsService.setUserTopArtistsDao(userTopArtistsDao);

    userTopArtistsDao.createUserTopArtists(asList(
        new UserTopArtists(user1, OVERALL, asList(new Artist("M83"))),
        new UserTopArtists(user2, SIX_MONTHS, asList(new Artist("Zola Jesus")))));
    assertEquals("M83", userTopArtistsService.getUserTopArtists(user1, OVERALL, 0, 10)
        .get(0).getArtistName());
    assertEquals("Zola Jesus", userTopArtistsService.getUserTopArtists(user2, SIX_MONTHS, 0, 10)
        .get(0).getArtistName());
View Full Code Here


  @Before
  public void loadFunctionDependency() throws ApplicationException {
    PostgreSQLUtil.loadFunction(dao, UPDATE_USER_TOP_ARTISTS);

    arnOverall = new UserTopArtists(arn, Period.OVERALL,
        new UserTopArtistsParserImpl(new ResourceUtil(
            ARN_OVERALL_FILE).getInputStream()).getArtists());
    arn6month = new UserTopArtists(arn, Period.SIX_MONTHS,
        new UserTopArtistsParserImpl(new ResourceUtil(
            ARN_6MONTH_FILE).getInputStream()).getArtists());
    sys3month = new UserTopArtists(sys, Period.THREE_MONTHS,
        new UserTopArtistsParserImpl(new ResourceUtil(
            SYS_3MONTH_FILE).getInputStream()).getArtists());

    createArtistMetaData();
  }
View Full Code Here

          WSResponse wsResponse = userTopArtistsClient.getUserTopArtists(user, period);
          if (wsResponse.wasCallAllowed() && wsResponse.wasCallSuccessful()) {
            StringUtil stringUtil = new StringUtil(wsResponse.getResponseBody());
            UserTopArtistsParser parser =
                new UserTopArtistsParserImpl(stringUtil.getInputStream());
            userTopArtists.add(new UserTopArtists(user, period, parser.getArtists()));
          }
        } catch (ApplicationException e) {
          LOG.warn("Fetching top artist for " + user.getLastFmUsername()
              + ", " + period.getDescription() + " failed.", e);
        }
View Full Code Here

TOP

Related Classes of com.github.hakko.musiccabinet.domain.model.aggr.UserTopArtists

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.