Package com.jitcaforwin.extended.api.track

Examples of com.jitcaforwin.extended.api.track.Genre


    TrackCollection tracksMock = EasyMock.createMock(TrackCollection.class);
    Set<Track> tracks = new HashSet<Track>();
    Track trackMock1 = EasyMock.createMock(Track.class);
    Track trackMock2 = EasyMock.createMock(Track.class);
    Track trackMock3 = EasyMock.createMock(Track.class);
    Genre genreMockA = EasyMock.createMock(Genre.class);
    Genre genreMockB = EasyMock.createMock(Genre.class);

    tracks.add(trackMock1);
    tracks.add(trackMock2);
    tracks.add(trackMock3);
    EasyMock.expect(playlistMock.getTracks()).andReturn(tracksMock);
View Full Code Here


    TrackCollection tracksMock = EasyMock.createMock(TrackCollection.class);
    Set<Track> tracks = new HashSet<Track>();
    Track trackMock1 = EasyMock.createMock(Track.class);
    Track trackMock2 = EasyMock.createMock(Track.class);
    Track trackMock3 = EasyMock.createMock(Track.class);
    Genre genreMockA = EasyMock.createMock(Genre.class);
    Genre genreMockB = EasyMock.createMock(Genre.class);

    tracks.add(trackMock1);
    tracks.add(trackMock2);
    tracks.add(trackMock3);
    EasyMock.expect(playlistMock.getTracks()).andReturn(tracksMock);
    EasyMock.expect(tracksMock.iterator()).andReturn(tracks.iterator());
    EasyMock.expect(trackMock1.getGenre()).andReturn(genreMockA).anyTimes();
    EasyMock.expect(trackMock2.getGenre()).andReturn(genreMockA).anyTimes();
    EasyMock.expect(trackMock3.getGenre()).andReturn(genreMockB).anyTimes();
    EasyMock.expect(genreMockA.isId3TagGenre()).andReturn(true).anyTimes();
    EasyMock.expect(genreMockB.isId3TagGenre()).andReturn(false).anyTimes();
   
    EasyMock.replay(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);
   
    GenreCollection actualGenres = PlaylistUtilities.getNonId3Genres(playlistMock);
   
View Full Code Here

    TrackCollection tracksMock = EasyMock.createMock(TrackCollection.class);
    Set<Track> tracks = new HashSet<Track>();
    Track trackMock1 = EasyMock.createMock(Track.class);
    Track trackMock2 = EasyMock.createMock(Track.class);
    Track trackMock3 = EasyMock.createMock(Track.class);
    Genre genreMockA = EasyMock.createMock(Genre.class);
    Genre genreMockB = EasyMock.createMock(Genre.class);

    tracks.add(trackMock1);
    tracks.add(trackMock2);
    tracks.add(trackMock3);
    EasyMock.expect(playlistMock.getTracks()).andReturn(tracksMock);
    EasyMock.expect(tracksMock.iterator()).andReturn(tracks.iterator());
    EasyMock.expect(trackMock1.getGenre()).andReturn(genreMockA).anyTimes();
    EasyMock.expect(trackMock2.getGenre()).andReturn(genreMockA).anyTimes();
    EasyMock.expect(trackMock3.getGenre()).andReturn(genreMockB).anyTimes();
    EasyMock.expect(genreMockA.isId3TagGenre()).andReturn(true).anyTimes();
    EasyMock.expect(genreMockB.isId3TagGenre()).andReturn(false).anyTimes();
   
    EasyMock.replay(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);
   
    GenreCollection actualGenres = PlaylistUtilities.getId3Genres(playlistMock);
   
View Full Code Here

    TrackCollection tracksMock = EasyMock.createMock(TrackCollection.class);
    Set<Track> tracks = new HashSet<Track>();
    Track trackMock1 = EasyMock.createMock(Track.class);
    Track trackMock2 = EasyMock.createMock(Track.class);
    Track trackMock3 = EasyMock.createMock(Track.class);
    Genre genreMockA = EasyMock.createMock(Genre.class);
    Genre genreMockB = EasyMock.createMock(Genre.class);

    tracks.add(trackMock1);
    tracks.add(trackMock2);
    tracks.add(trackMock3);
    EasyMock.expect(playlistMock.getTracks()).andReturn(tracksMock);
    EasyMock.expect(tracksMock.iterator()).andReturn(tracks.iterator());
    EasyMock.expect(trackMock1.getGenre()).andReturn(genreMockA).anyTimes();
    EasyMock.expect(trackMock2.getGenre()).andReturn(genreMockA).anyTimes();
    EasyMock.expect(trackMock3.getGenre()).andReturn(genreMockB).anyTimes();
    EasyMock.expect(genreMockA.isBasicId3TagGenre()).andReturn(true).anyTimes();
    EasyMock.expect(genreMockB.isBasicId3TagGenre()).andReturn(false).anyTimes();
   
    EasyMock.replay(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);
   
    GenreCollection actualGenres = PlaylistUtilities.getNonId3BasicGenres(playlistMock);
   
View Full Code Here

   * @param name
   *            Name of the genre.
   * @return The (created) genre.
   */
  public Genre getGenre(String name) {
    Genre genre = searchForGenre(name);
    if (genre == null) {
      genre = addGenre(name);
    }
    return genre;
  }
View Full Code Here

   * @param name
   *            Name of the genre.
   * @return The genre.
   */
  private Genre addGenre(String name) {
    Genre newGenre = new GenreImpl(name, this.source);
    this.genres.put(name, newGenre);
    return newGenre;
  }
View Full Code Here

    EasyMock.expect(sourceMock.isLazy()).andReturn(true).anyTimes();
    EasyMock.expect(sourceMock.getTrackFactory()).andReturn(null).anyTimes();
    EasyMock.replay(sourceMock);

    Genre id3TagGenre = new GenreImpl("Pop", sourceMock);
    Genre nonId3TagGenre = new GenreImpl("Non-ID3-Genre-Pop", sourceMock);

    assertTrue(id3TagGenre.isId3TagGenre());
    assertFalse(nonId3TagGenre.isId3TagGenre());
  }
View Full Code Here

    EasyMock.expect(sourceMock.isLazy()).andReturn(true).anyTimes();
    EasyMock.expect(sourceMock.getTrackFactory()).andReturn(null).anyTimes();
    EasyMock.replay(sourceMock);

    Genre basicId3TagGenre = new GenreImpl("Pop", sourceMock);
    Genre nonBasicId3TagGenre = new GenreImpl("Celtic", sourceMock);

    assertTrue(basicId3TagGenre.isId3TagGenre());
    assertTrue(nonBasicId3TagGenre.isId3TagGenre());
    assertTrue(basicId3TagGenre.isBasicId3TagGenre());
    assertFalse(nonBasicId3TagGenre.isBasicId3TagGenre());
  }
View Full Code Here

    EasyMock.expect(sourceMock.isLazy()).andReturn(true).anyTimes();
    EasyMock.expect(sourceMock.getTrackFactory()).andReturn(null).anyTimes();
    EasyMock.replay(sourceMock);

    Genre winampGenre = new GenreImpl("Celtic", sourceMock);
    Genre nonWinampGenre = new GenreImpl("Pop", sourceMock);

    assertTrue(winampGenre.isId3TagGenre());
    assertTrue(nonWinampGenre.isId3TagGenre());
    assertTrue(winampGenre.isWinampExtensionId3TagGenre());
    assertFalse(nonWinampGenre.isWinampExtensionId3TagGenre());
  }
View Full Code Here

   * @param name
   *            Name of the genre.
   * @return The (created) genre.
   */
  public Genre getGenre(String name) {
    Genre genre = searchForGenre(name);
    if (genre == null) {
      genre = addGenre(name);
    }
    return genre;
  }
View Full Code Here

TOP

Related Classes of com.jitcaforwin.extended.api.track.Genre

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.