Package com.jitcaforwin.id3.jid3lib

Examples of com.jitcaforwin.id3.jid3lib.TagFactoryTest


      System.out.println("Currently no track played!");
    } else {
      if (track.isFileOrCDTrack()) {
        System.out.println("Content of the ID3Tags for the currently placyed track:");
        try {
          ID3Tag id3 = ((FileOrCDTrack) track).getID3Tag();
          System.out.println("Song Title: " + id3.getSongTitle());
          System.out.println("Artist Name: " + id3.getArtistName());
          System.out.println("Album Name: " + id3.getAlbumTitle());
          System.out.println("Genre: " + id3.getGenreAsString());
        } catch (ID3TagException e) {
          e.printStackTrace();
        }

      } else {
View Full Code Here


public class TagTrackNumberTest {

  @Test
  public void testTrackNumber(){
    AbstractID3 tagMock = EasyMock.createMock(AbstractID3.class);
    ID3Tag id3Tag = new TagImplMock(tagMock);
    EasyMock.expect(tagMock.getTrackNumberOnAlbum()).andReturn("2/15");
    EasyMock.replay(tagMock);
   
    assertEquals(2, id3Tag.getTrackNumber());
   
    EasyMock.verify(tagMock);
  }
View Full Code Here

  }
 
  @Test
  public void testTrackCount(){
    AbstractID3 tagMock = EasyMock.createMock(AbstractID3.class);
    ID3Tag id3Tag = new TagImplMock(tagMock);
    EasyMock.expect(tagMock.getTrackNumberOnAlbum()).andReturn("2/15");
    EasyMock.replay(tagMock);
   
    assertEquals(15, id3Tag.getTrackCount());
   
    EasyMock.verify(tagMock);
  }
View Full Code Here

    MP3File mp3FileMock = TagTestHelpLibrary.createMP3FileMockForID3v1(id3Mock);

    EasyMock.expect(id3Mock.getSongGenre()).andReturn(input);
    EasyMock.replay(id3Mock, mp3FileMock);

    ID3Tag tag = jidID3TagFactory.getID3Tag(mp3FileMock);
    assertEquals(expectedOutput, tag.getGenreAsString());

    EasyMock.verify(id3Mock, mp3FileMock);
  }
View Full Code Here

    MP3File mp3FileMock = TagTestHelpLibrary.createMP3FileMockForID3v2(id3Mock);

    EasyMock.expect(id3Mock.getSongGenre()).andReturn(input);
    EasyMock.replay(id3Mock, mp3FileMock);

    ID3Tag tag = jidID3TagFactory.getID3Tag(mp3FileMock);
    assertEquals(expectedOutput, tag.getGenreAsString());

    EasyMock.verify(id3Mock, mp3FileMock);
  }
View Full Code Here

    this.testYearFormatting(null, 0);
  }
 
  private void testYearFormatting(String yearInput, int yearOutput){
    AbstractID3 tagMock = EasyMock.createMock(AbstractID3.class);
    ID3Tag id3Tag = new TagImplMock(tagMock);
   
    EasyMock.expect(tagMock.getYearReleased()).andReturn(yearInput);
    EasyMock.replay(tagMock);
   
    assertEquals(yearOutput, id3Tag.getYear());
    EasyMock.verify(tagMock);
  }
View Full Code Here

  @Test
  public void ID3v1Test() throws ID3TagFileException{
    MP3File mp3FileMock = TagTestHelpLibrary.createMP3FileMockForID3v1(null);
    EasyMock.replay(mp3FileMock);
   
    ID3Tag id3Tag = jidID3TagFactory.getID3Tag(mp3FileMock);
 
    assertTrue(id3Tag.getClass().equals(ID3v1TagImpl.class));
    EasyMock.verify(mp3FileMock);
  }
View Full Code Here

  @Test
  public void ID3v2Test() throws ID3TagFileException{
    MP3File mp3FileMock = TagTestHelpLibrary.createMP3FileMockForID3v2(null);
    EasyMock.replay(mp3FileMock);
   
    ID3Tag id3Tag = jidID3TagFactory.getID3Tag(mp3FileMock);
 
    assertTrue(id3Tag.getClass().equals(ID3v2TagImpl.class));
    EasyMock.verify(mp3FileMock);
  }
View Full Code Here

 
  private int getGenreID(String genreString) throws ID3GenreNotFoundException {
    try {
      return this.toInt(genreString);
    } catch (NumberFormatException e) {
      throw new ID3GenreNotFoundException(genreString);
    }
  }
View Full Code Here

 
  private int getGenreID(String genreString) throws ID3GenreNotFoundException {
    try {
      return this.toInt(genreString);
    } catch (NumberFormatException e) {
      throw new ID3GenreNotFoundException(genreString);
    }
  }
View Full Code Here

TOP

Related Classes of com.jitcaforwin.id3.jid3lib.TagFactoryTest

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.