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

Examples of com.github.hakko.musiccabinet.domain.model.library.WebserviceInvocation


  }

  @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);

    Assert.assertFalse(dao.isWebserviceInvocationAllowed(wiInfo));
    Assert.assertFalse(dao.isWebserviceInvocationAllowed(wiSimilar));
View Full Code Here


  }

  @Test (expected = IllegalArgumentException.class)
  public void artistNullThrowsException() {
    Calltype SIMILAR = Calltype.TRACK_GET_SIMILAR;
    new WebserviceInvocation(SIMILAR, (Artist) null);
  }
View Full Code Here

  }

  @Test (expected = IllegalArgumentException.class)
  public void trackNullThrowsException() {
    Calltype SIMILAR = Calltype.TRACK_GET_SIMILAR;
    new WebserviceInvocation(SIMILAR, (Track) null);
  }
View Full Code Here

 
  @Test
  public void artistTopTagsUpdateUpdatesAllArtists() throws ApplicationException, IOException {
    clearLibraryAndAddCherTrack();
   
    WebserviceInvocation wi = new WebserviceInvocation(ARTIST_GET_TOP_TAGS, new Artist(artistName));
    Assert.assertTrue(webserviceHistoryService.isWebserviceInvocationAllowed(wi));
   
    Set<String> artistNames = webserviceHistoryService.getArtistNamesScheduledForUpdate(ARTIST_GET_TOP_TAGS);
    Assert.assertNotNull(artistNames);
    Assert.assertEquals(1, artistNames.size());
View Full Code Here

   
    WebserviceHistoryService historyService = mock(WebserviceHistoryService.class);
    when(historyService.isWebserviceInvocationAllowed(
        Mockito.any(WebserviceInvocation.class))).thenReturn(allowCalls);
   
    WebserviceInvocation invocation = mock(WebserviceInvocation.class);
   
    List<NameValuePair> params = new ArrayList<>();
   
    TestWSGetClient testClient = new TestWSGetClient(invocation, params);
    testClient.setWebserviceHistoryService(historyService);
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

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

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

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

public class ArtistTopTagsClient extends AbstractWSGetClient {

  public static final String METHOD = "artist.gettoptags";
 
  public WSResponse getTopTags(Artist artist) throws ApplicationException {
    WebserviceInvocation webserviceInvocation =
      new WebserviceInvocation(ARTIST_GET_TOP_TAGS, artist);

    List<NameValuePair> params = getDefaultParameterList();
    params.add(new BasicNameValuePair(PARAM_METHOD, METHOD));
    params.add(new BasicNameValuePair(PARAM_ARTIST, artist.getName()));
   
View Full Code Here

public class ArtistTopTracksClient extends AbstractWSGetClient {

  public static final String METHOD = "artist.gettoptracks";
 
  public WSResponse getTopTracks(Artist artist) throws ApplicationException {
    WebserviceInvocation webserviceInvocation =
      new WebserviceInvocation(ARTIST_GET_TOP_TRACKS, artist);

    List<NameValuePair> params = getDefaultParameterList();
    params.add(new BasicNameValuePair(PARAM_METHOD, METHOD));
    params.add(new BasicNameValuePair(PARAM_ARTIST, artist.getName()));
    // tried adding autocorrect=1, but even simple misspellings didn't get corrected
View Full Code Here

public class UserTopArtistsClient extends AbstractWSGetClient {

  public static final String METHOD = "user.gettopartists";
 
  public WSResponse getUserTopArtists(LastFmUser user, Period period) throws ApplicationException {
    WebserviceInvocation webserviceInvocation =
      new WebserviceInvocation(USER_GET_TOP_ARTISTS, user, period.getDays());

    List<NameValuePair> params = getDefaultParameterList();
    params.add(new BasicNameValuePair(PARAM_METHOD, METHOD));
    params.add(new BasicNameValuePair(PARAM_USER, user.getLastFmUsername()));
    params.add(new BasicNameValuePair(PARAM_PERIOD, period.getDescription()));
View Full Code Here

TOP

Related Classes of com.github.hakko.musiccabinet.domain.model.library.WebserviceInvocation

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.