Package com.jitcaforwin.extended.impl.internal

Examples of com.jitcaforwin.extended.impl.internal.UserLibraryImpl


   * @throws JitcaException
   *             if an error occurs.
   */
  public JitcaiTunesController(boolean lazy) {
    this.iTunes = new iTunesApp();
    this.library = new UserLibraryImpl(lazy, this.iTunes);
    this.trackController = new TrackControllerImpl(iTunes, this.library, this.library.getTrackFactory());
    this.playlistController = new PlaylistControllerImpl(iTunes, this.library.getPlaylistFactory());
    this.playerController = new PlayerControllerImpl(this.iTunes, this.playlistController, this.trackController);
    this.eventController = new AdvancedEventControllerImpl(this.library, this.iTunes);

View Full Code Here


public class AlbumTest {

  @Test
  public void testCreateAlbum() throws JitcaException {
    UserLibraryImpl libraryMock = EasyMock.createMock(UserLibraryImpl.class);
   
    TrackFactory trackFactoryMock = EasyMock.createMock(TrackFactory.class);
    TrackCollectionImpl trackCollectionMock = EasyMock.createMock(TrackCollectionImpl.class);
   
    EasyMock.expect(libraryMock.isLazy()).andReturn(true).anyTimes();
    EasyMock.expect(libraryMock.getTracksOfArtist("Nelly Furtado")).andReturn(trackCollectionMock);
    EasyMock.expect(trackFactoryMock.getTracksOfArtist("Nelly Furtado")).andReturn(trackCollectionMock);
    EasyMock.expect(libraryMock.getTracksOfComposer("Nelly Furtado")).andReturn(trackCollectionMock);
    EasyMock.expect(trackFactoryMock.getTracksOfComposer("Nelly Furtado")).andReturn(trackCollectionMock)
    EasyMock.expect(libraryMock.getTracksOfAlbum("Loose")).andReturn(trackCollectionMock).anyTimes();
    EasyMock.expect(libraryMock.getTracksOfAlbum("Folklore")).andReturn(trackCollectionMock);
    EasyMock.expect(libraryMock.getTrackFactory()).andReturn(trackFactoryMock).anyTimes();
    EasyMock.expect(trackCollectionMock.iterator()).andReturn(new LinkedList<Track>().iterator()).anyTimes();
   
    EasyMock.replay(libraryMock);
    EasyMock.replay(trackCollectionMock);
    EasyMock.replay(trackFactoryMock);
   
    Artist albumArtist = ArtistImpl.create("Nelly Furtado", libraryMock);
    Album loose = new AlbumImpl("Loose", albumArtist, libraryMock);
    Album folklore = new AlbumImpl("Folklore", albumArtist, libraryMock);
   
    EasyMock.reset(libraryMock);
    EasyMock.expect(libraryMock.getAlbum("Loose", albumArtist)).andReturn(loose);
    EasyMock.expect(libraryMock.getAlbum("Loose", albumArtist)).andReturn(loose);
    EasyMock.expect(libraryMock.getAlbum("Folklore", albumArtist)).andReturn(folklore);
    EasyMock.replay(libraryMock);
   
   
    Album album1 = libraryMock.getAlbum("Loose", albumArtist);
    assertTrue(album1.getName().equals("Loose"));
    assertTrue(album1.getAlbumArtist().getName().equals("Nelly Furtado"));

    Album album2 = libraryMock.getAlbum("Loose", albumArtist);
    assertTrue(album1.equals(album2));
    assertTrue(album1.equals(album1));

    Album album3 = libraryMock.getAlbum("Folklore", albumArtist);
    assertTrue(!album1.equals(album3));
  }
View Full Code Here

    IiTunes iTunesMock = EasyMock.createMock(IiTunes.class);
    EasyMock.expect(iTunesMock.getLibrarySource()).andReturn(null);
    EasyMock.expect(iTunesMock.getLibraryPlaylist()).andReturn(null).anyTimes();
    EasyMock.replay(iTunesMock);
   
    Source source = new UserLibraryImpl(true, iTunesMock);
   
    Artist michaelAndPaul = source.getArtist("Michael Jackson, Paul McCartney");
   
    assertTrue(michaelAndPaul instanceof GroupArtist);
    assertTrue(source.getArtistFactory().getManagedArtists().size() == 3);
  }
View Full Code Here

public class TrackCollectionInitTest {

  @Test
  public void testInitCollectionFromITCollection() throws JitcaException {
    UserLibraryImpl libraryMock = EasyMock.createMock(UserLibraryImpl.class);
    TrackFactory trackFactoryMock = EasyMock.createMock(TrackFactory.class);
    IITTrack itThrillerMock = EasyMock.createMock(IITTrack.class);
    IITTrack itBeatItMock = EasyMock.createMock(IITTrack.class);
    IITTrack itBillyJeanMock = EasyMock.createMock(IITTrack.class);
    IITTrackCollection itTrackCollectionMock = EasyMock.createMock(IITTrackCollection.class);
    TrackImpl thrillerMock = EasyMock.createMock(TrackImpl.class);
    TrackImpl beatItMock = EasyMock.createMock(TrackImpl.class);
    TrackImpl billyJeanMock = EasyMock.createMock(TrackImpl.class);
   
    EasyMock.expect(libraryMock.isLazy()).andReturn(false).anyTimes();
    EasyMock.expect(libraryMock.getTrackFactory()).andReturn(trackFactoryMock);
   
    EasyMock.expect(trackFactoryMock.getTrack(itThrillerMock)).andReturn(thrillerMock);
    EasyMock.expect(trackFactoryMock.getTrack(itBeatItMock)).andReturn(beatItMock);
    EasyMock.expect(trackFactoryMock.getTrack(itBillyJeanMock)).andReturn(billyJeanMock);
   
View Full Code Here

TOP

Related Classes of com.jitcaforwin.extended.impl.internal.UserLibraryImpl

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.