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

Examples of com.github.hakko.musiccabinet.domain.model.music.Artist


  }
 
  @Test
  public void importTrackSimilaritiesIsNotPossibleTwice() {
    Calltype SIMILAR = Calltype.TRACK_GET_SIMILAR;
    Artist artist = new Artist("Bill Fay");
    Track track1 = new Track(artist, "Omega");
    Track track2 = new Track(artist, "Don't let my marigolds die");
   
    WebserviceInvocation similarTrack1 = new WebserviceInvocation(SIMILAR, track1);
    WebserviceInvocation similarTrack2 = new WebserviceInvocation(SIMILAR, track2);
View Full Code Here


    Assert.assertNotNull(artistInfo);
    Assert.assertNotNull(artistTopTracks);
    Assert.assertTrue(artistInfo.contains(MADONNA));
    Assert.assertTrue(artistTopTracks.contains(MADONNA));
   
    dao.logWebserviceInvocation(new WebserviceInvocation(INFO, new Artist(MADONNA)));

    artistInfo = dao.getArtistNamesWithNoInvocations(INFO);
    artistTopTracks = dao.getArtistNamesWithNoInvocations(TOP_TRACKS);
    Assert.assertFalse(artistInfo.contains(MADONNA));
    Assert.assertTrue(artistTopTracks.contains(MADONNA));

    dao.logWebserviceInvocation(new WebserviceInvocation(TOP_TRACKS, new Artist(MADONNA)));

    artistInfo = dao.getArtistNamesWithNoInvocations(INFO);
    artistTopTracks = dao.getArtistNamesWithNoInvocations(TOP_TRACKS);
    Assert.assertFalse(artistInfo.contains(MADONNA));
    Assert.assertFalse(artistTopTracks.contains(MADONNA));
View Full Code Here

  }

  @Test
  public void quarantineLogsInvocationTimeInTheFuture() {
    Calltype TOP = Calltype.ARTIST_GET_TOP_TRACKS;
    Artist artist = new Artist("The Notorious B.I.G feat. G. Dep & Missy Elliott");
    WebserviceInvocation wi = new WebserviceInvocation(TOP, artist);
    assertTrue(dao.isWebserviceInvocationAllowed(wi));
    dao.quarantineWebserviceInvocation(wi);
    assertFalse(dao.isWebserviceInvocationAllowed(wi));

    Date date = dao.getJdbcTemplate().queryForObject(
        "select invocation_time from library.webservice_history hist"
        + " inner join music.artist a on hist.artist_id = a.id"
        + " where a.artist_name = upper(?)",
        Date.class, artist.getName());
    Assert.assertTrue(date.after(new Date()));
  }
View Full Code Here

  }

  @Test
  public void blockLogsInvocationTimeInAnInfiniteFuture() {
    Calltype TOP = Calltype.ARTIST_GET_TOP_TRACKS;
    Artist artist = new Artist("Björn Olsson");
    int artistId = musicDao.getArtistId(artist);

    WebserviceInvocation wi = new WebserviceInvocation(TOP, artist);
    assertTrue(dao.isWebserviceInvocationAllowed(wi));
View Full Code Here

        Integer.class, artistId, TOP.getDatabaseId());
  }

  @Test
  public void clearsLanguageSpecificWebserviceInvocations() {
    Artist artist = new Artist("ABBA");
    WebserviceInvocation wiInfo = new WebserviceInvocation(ARTIST_GET_INFO, artist);
    WebserviceInvocation wiSimilar = new WebserviceInvocation(ARTIST_GET_SIMILAR, artist);
    dao.logWebserviceInvocation(wiInfo);
    dao.logWebserviceInvocation(wiSimilar);
View Full Code Here

      @Override
      protected WebserviceHistoryService getHistoryService() {
        return Mockito.mock(WebserviceHistoryService.class);
      }

    }.getTopTracks(new Artist(artistName));
  }
View Full Code Here

 
  @Test
  public void artistRelationUpdateUpdatesAllArtists() throws ApplicationException, IOException {
    clearLibraryAndAddCherTrack();

    WebserviceInvocation wi = new WebserviceInvocation(ARTIST_GET_SIMILAR, new Artist(artistName));
    Assert.assertTrue(webserviceHistoryService.isWebserviceInvocationAllowed(wi));

    Set<String> artistNames = webserviceHistoryService.getArtistNamesScheduledForUpdate(ARTIST_GET_SIMILAR);
    Assert.assertNotNull(artistNames);
    Assert.assertEquals(1, artistNames.size());
View Full Code Here

      @Override
      protected WebserviceHistoryService getHistoryService() {
        return Mockito.mock(WebserviceHistoryService.class);
      }

    }.getTopTags(new Artist(artistName));
  }
View Full Code Here

      @Override
      protected WebserviceHistoryService getHistoryService() {
        return Mockito.mock(WebserviceHistoryService.class);
      }

    }.getArtistSimilarity(new Artist(artistName));
  }
View Full Code Here

    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

TOP

Related Classes of com.github.hakko.musiccabinet.domain.model.music.Artist

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.