Examples of Artist


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

 
  @Test
  public void importArtistSimilaritiesAndTopTracksWorkIndependently() {
    Calltype TOP = Calltype.ARTIST_GET_TOP_TRACKS;
    Calltype SIMILAR = Calltype.ARTIST_GET_SIMILAR;
    Artist artist1 = new Artist("Björk");
    Artist artist2 = new Artist("Björn Olsson");

    WebserviceInvocation topArtist1 = new WebserviceInvocation(TOP, artist1);
    WebserviceInvocation topArtist2 = new WebserviceInvocation(TOP, artist2);
    WebserviceInvocation similarArtist1 = new WebserviceInvocation(SIMILAR, artist1);
    WebserviceInvocation similarArtist2 = new WebserviceInvocation(SIMILAR, artist2);
View Full Code Here

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

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

    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

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

  }

  @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

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

  }

  @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

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

        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

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

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

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

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

 
  @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

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

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

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

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

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

    }.getArtistSimilarity(new Artist(artistName));
  }
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.