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

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


   
    List<Tag> tags = dao.getTags();
    Assert.assertNotNull(tags);
    Assert.assertEquals(3, tags.size());
    for (String tagName : Arrays.asList("disco", "sludge", "drone")) {
      Assert.assertTrue(tags.contains(new Tag(tagName, (short) 0)));
    }
  }
View Full Code Here


  public void retrievesCorrectedAvailableTags() {
    deleteTags();

    for (int i = 0; i < 5; i++) {
      artistTopTagsDao.createTopTags(new Artist("artist" + i), Arrays.asList(
          new Tag("sludge", (short) 100),
          new Tag("drone", (short) 90),
          new Tag("e-l-e-c-t-r-o", (short) 50),
          new Tag("disco", (short) 10)));
    }

    Map<String, String> tagCorrections = new HashMap<>();
    tagCorrections.put("e-l-e-c-t-r-o", "electro");
    dao.createTagCorrections(tagCorrections);
View Full Code Here

  @Test
  public void validateParameters() throws ApplicationException {

    final String method = TagTopArtistsClient.METHOD;
    final Tag tag = new Tag(0, "sludge");
   
    new TagTopArtistsClient() {
      @Override
      protected WSResponse executeWSRequest(WebserviceInvocation wi,
          List<NameValuePair> params) throws ApplicationException {
       
        Assert.assertEquals(Calltype.TAG_GET_TOP_ARTISTS, wi.getCallType());
        Assert.assertEquals(tag, wi.getTag());
       
        assertHasParameter(params, PARAM_METHOD, method);
        assertHasParameter(params, PARAM_TAG, tag.getName());
       
        return null;
      }
     
      @Override
View Full Code Here

  @Test
  public void tagsWithLowTagCountGetStripped() {
    final String folk = "folk", psychedelic = "psychedelic", disco = "disco";
   
    List<Tag> tags = new ArrayList<>();
    tags.add(new Tag(folk, (short) 99));
    tags.add(new Tag(psychedelic, (short) 84));
    tags.add(new Tag(disco, (short) 0));
   
    Assert.assertEquals(3, tags.size());

    artistTopTagsService.removeTagsWithLowTagCount(tags);
View Full Code Here

  @Test
  public void importTagRelatedDataNotPossibleTwice() {
   
    tagDao.createTags(Arrays.asList("disco"));
    Tag tag = tagDao.getTags().get(0);
   
    Calltype TOP_ARTISTS = Calltype.TAG_GET_TOP_ARTISTS;
    WebserviceInvocation topArtists = new WebserviceInvocation(TOP_ARTISTS, tag);
   
    deleteWebserviceInvocations();
View Full Code Here

  @Test
  public void tagHistoryAllowanceIsBasedOnId() {
   
    tagDao.createTags(Arrays.asList("disco", "sludge"));
    Tag tag1 = tagDao.getTags().get(0);
    Tag tag2 = tagDao.getTags().get(1);
    Calltype TOP_ARTISTS = Calltype.TAG_GET_TOP_ARTISTS;

    WebserviceInvocation topArtists1 = new WebserviceInvocation(TOP_ARTISTS, tag1);
    WebserviceInvocation topArtists2 = new WebserviceInvocation(TOP_ARTISTS, tag2);
   
View Full Code Here

   
    dao.createTopTags(cherArtist, cherTopTags);
    dao.createTopTags(rihannaArtist, rihannaTopTags);
   
    rihannaTopTags = new ArrayList<>();
    rihannaTopTags.add(new Tag("dance", (short) 22));
    rihannaTopTags.add(new Tag("r&b", (short) 8));
    dao.createTopTags(rihannaArtist, rihannaTopTags);
   
    List<Tag> cherStoredTopTags = dao.getTopTags(cherArtist.getId());
    List<Tag> rihannaStoredTopTags = dao.getTopTags(rihannaArtist.getId());
   
View Full Code Here

    deleteArtistTopTags();
   
    dao.createTopTags(cherArtist, cherTopTags);
    int cherId = musicDao.getArtistId(cherArtist);

    Tag tagPop = new Tag("pop", (short) 100), tag80s = new Tag("80s", (short) 52);
    tagDao.setTopTags(Arrays.asList(tagPop.getName(), tag80s.getName()));
   
    assertEquals(asList(tagPop), dao.getTopTags(cherId, 1));
    assertEquals(asList(tagPop, tag80s), dao.getTopTags(cherId, 3));
  }
View Full Code Here

    submitFile(additionDao, UnittestLibraryUtil.getFile(artist, "Album", "Title"));
    submitFile(additionDao, UnittestLibraryUtil.getFile(indieArtist, "Album", "Title"));
    submitFile(additionDao, UnittestLibraryUtil.getFile(jazzArtist, "Album", "Title"));

    topTagsDao.createTopTags(new Artist(indieArtist),
        Arrays.asList(new Tag("indie", (short) 100)));
    topTagsDao.createTopTags(new Artist(jazzArtist),
        Arrays.asList(new Tag("jazz", (short) 60)));

    List<Artist> allArtists = browserDao.getArtists();
    Assert.assertEquals(3, allArtists.size());

    List<Artist> indieArtists = browserDao.getArtists(indie, 90);
View Full Code Here

  public void findsTopTagsForLocalGenres() throws Exception {
    List<Tag> topTags = topTagsDao.getTopTags(musicDao.getArtistId(ARTIST));

    Assert.assertNotNull(topTags);
    Assert.assertEquals(2, topTags.size());
    Assert.assertEquals(new Tag(POP, (short) 66), topTags.get(0));
    Assert.assertEquals(new Tag(ROCK, (short) 33), topTags.get(1));
  }
View Full Code Here

TOP

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

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.