Package com.jitcaforwin.extended.impl.internal.sources

Examples of com.jitcaforwin.extended.impl.internal.sources.Source


    }
    return successfull;
  }
 
  private Source createSourceMock(){
    Source sourceMock = EasyMock.createMock(Source.class);
    EasyMock.expect(sourceMock.isLazy()).andReturn(true).anyTimes();
    EasyMock.expect(sourceMock.getTrackFactory()).andReturn(null).anyTimes();
   
    Artist michael = EasyMock.createMock(Artist.class);
    Artist paul = EasyMock.createMock(Artist.class);
   
    Artist memberA = EasyMock.createMock(Artist.class);
    Artist memberB = EasyMock.createMock(Artist.class);
    Artist memberC = EasyMock.createMock(Artist.class);
    Artist memberD = EasyMock.createMock(Artist.class);
   
    EasyMock.expect(michael.getName()).andReturn("Michael Jackson").anyTimes();
    EasyMock.expect(paul.getName()).andReturn("Paul McCartney").anyTimes();
    EasyMock.expect(sourceMock.getArtist("Michael Jackson")).andReturn(michael).anyTimes();
    EasyMock.expect(sourceMock.getArtist("Paul McCartney")).andReturn(paul).anyTimes();
   
    EasyMock.expect(memberA.getName()).andReturn("MemberA").anyTimes();
    EasyMock.expect(sourceMock.getArtist("MemberA")).andReturn(memberA).anyTimes();
   
    EasyMock.expect(memberB.getName()).andReturn("MemberB").anyTimes();
    EasyMock.expect(sourceMock.getArtist("MemberB")).andReturn(memberB).anyTimes();
   
    EasyMock.expect(memberC.getName()).andReturn("MemberC").anyTimes();
    EasyMock.expect(sourceMock.getArtist("MemberC")).andReturn(memberC).anyTimes();
   
    EasyMock.expect(memberD.getName()).andReturn("MemberD").anyTimes();
    EasyMock.expect(sourceMock.getArtist("MemberD")).andReturn(memberD).anyTimes();
   
    EasyMock.replay(michael);
    EasyMock.replay(paul);
    EasyMock.replay(memberA);
    EasyMock.replay(memberB);
View Full Code Here


public class GenreTest {

  @Test
  public void testIsId3TagGenre() {
    Source sourceMock = EasyMock.createMock(Source.class);

    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);
View Full Code Here

    assertFalse(nonId3TagGenre.isId3TagGenre());
  }

  @Test
  public void testIsBasicId3TagGenre() {
    Source sourceMock = EasyMock.createMock(Source.class);

    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);
View Full Code Here

    assertFalse(nonBasicId3TagGenre.isBasicId3TagGenre());
  }

  @Test
  public void testIsWinampExtensionId3TagGenre() {
    Source sourceMock = EasyMock.createMock(Source.class);

    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);
View Full Code Here

    assertFalse(nonWinampGenre.isWinampExtensionId3TagGenre());
  }

  @Test
  public void testGetId() {
    Source sourceMock = EasyMock.createMock(Source.class);

    EasyMock.expect(sourceMock.isLazy()).andReturn(true).anyTimes();
    EasyMock.expect(sourceMock.getTrackFactory()).andReturn(null).anyTimes();
    EasyMock.replay(sourceMock);
   
    assertEquals(0, new GenreImpl("Blues", sourceMock).getId());
    assertEquals(13, new GenreImpl("Pop", sourceMock).getId());
    assertEquals(Genre.UNKOWN_GENRE, new GenreImpl("Unkown Genre", sourceMock).getId());
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

    assertTrue(source.getArtistFactory().getManagedArtists().size() == 3);
  }
 
  @Test
  public void ConstructorTest(){
    Source sourceMock = this.createSourceMock();
   
    Artist singleArtist = ArtistImpl.create("SingleArtist", sourceMock);
    Artist group = new GroupArtistImpl("Group", sourceMock);
   
    assertFalse(singleArtist.isGroup());
View Full Code Here

    assertTrue(group.isGroup());
  }
 
  @Test
  public void MemberTest(){
    Source sourceMock = this.createSourceMock();
   
    Artist memberOne = ArtistImpl.create("MemberOne", sourceMock);
    Artist memberTwo = ArtistImpl.create("MemberTwo", sourceMock);
   
    GroupArtist group = new GroupArtistImpl("Group", sourceMock);
View Full Code Here

    assertFalse(group.getMembers().contains(memberOne));
  }
 
  @Test
  public void trackTest(){
    Source sourceMock = this.createSourceMock();
    Artist group = new GroupArtistImpl("Group", sourceMock);
    Artist memberA = ArtistImpl.create("MemberA", sourceMock);
    Artist memberB = ArtistImpl.create("MemberB", sourceMock);
   
    ((GroupArtist) group).addArtist(memberA);
View Full Code Here

   
  }
 
 
  private Source createSourceMock(){
    Source sourceMock = EasyMock.createMock(Source.class);
    EasyMock.expect(sourceMock.isLazy()).andReturn(true).anyTimes();
    EasyMock.expect(sourceMock.getTrackFactory()).andReturn(null).anyTimes();
    EasyMock.replay(sourceMock);
    return sourceMock;
  }
View Full Code Here

TOP

Related Classes of com.jitcaforwin.extended.impl.internal.sources.Source

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.