Package com.jitcaforwin.extended.api.collections

Examples of com.jitcaforwin.extended.api.collections.TrackCollection


public class PlaylistUtilitiesTest {

  @Test
  public void testGetAllGenres() {
    Playlist playlistMock = EasyMock.createMock(Playlist.class);
    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.replay(playlistMock, tracksMock, trackMock1, trackMock2, trackMock3, genreMockA, genreMockB);
View Full Code Here


  }

  @Test
  public void testGetNoneId3Genres() {
    Playlist playlistMock = EasyMock.createMock(Playlist.class);
    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();
View Full Code Here

  }
 
  @Test
  public void testGetId3Genres() {
    Playlist playlistMock = EasyMock.createMock(Playlist.class);
    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();
View Full Code Here

  }
 
  @Test
  public void testGetNoneBasicId3Genres() {
    Playlist playlistMock = EasyMock.createMock(Playlist.class);
    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();
View Full Code Here

TOP

Related Classes of com.jitcaforwin.extended.api.collections.TrackCollection

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.