1
package org.jaudiotagger.issues;
3
import org.jaudiotagger.AbstractTestCase;
4
import org.jaudiotagger.audio.mp3.MP3File;
5
import org.jaudiotagger.tag.id3.ID3v23Frame;
6
import org.jaudiotagger.tag.id3.ID3v23Tag;
7
import org.jaudiotagger.tag.id3.framebody.FrameBodyIPLS;
12
* Test Reading dodgy IPLS frame shouldnt cause file not to be loaded
14
public class Issue307Test extends AbstractTestCase
16
public static int countExceptions =0;
18
public void testMultiThreadedMP3HeaderAccess() throws Exception
20
File orig = new File("testdata", "test71.mp3");
23
System.err.println("Unable to test file - not available");
28
MP3File mp3File = null;
31
final File testFile = AbstractTestCase.copyAudioToTmp("test71.mp3");
32
if (!testFile.isFile())
34
System.err.println("Unable to test file - not available");
37
mp3File = new MP3File(testFile);
45
FrameBodyIPLS frameBody = (FrameBodyIPLS)(((ID3v23Frame)((ID3v23Tag)mp3File.getTag()).getFirstField("IPLS")).getBody());
46
assertEquals(3,frameBody.getNumberOfPairs());
47
assertEquals(7,frameBody.getNumberOfValues());
48
assertEquals("producer",frameBody.getValueAtIndex(0));
49
assertEquals("Tom Wilson",frameBody.getValueAtIndex(1));
50
assertEquals("producer",frameBody.getValueAtIndex(2));
51
assertEquals("John H. Hammond",frameBody.getValueAtIndex(3));
52
assertEquals("lead vocal",frameBody.getValueAtIndex(4));
53
//assertEquals("l",frameBody.getValueAtIndex(5));
54
//assertEquals("",frameBody.getValueAtIndex(6));
1
package org.jaudiotagger.issues;
3
import org.jaudiotagger.AbstractTestCase;
4
import org.jaudiotagger.audio.mp3.MP3File;
5
import org.jaudiotagger.tag.id3.ID3v23Frame;
6
import org.jaudiotagger.tag.id3.ID3v23Tag;
7
import org.jaudiotagger.tag.id3.framebody.FrameBodyIPLS;
12
* Test Reading dodgy IPLS frame shouldnt cause file not to be loaded
14
public class Issue307Test extends AbstractTestCase
16
public static int countExceptions =0;
18
public void testMultiThreadedMP3HeaderAccess() throws Exception
20
File orig = new File("testdata", "test71.mp3");
23
System.err.println("Unable to test file - not available");
28
MP3File mp3File = null;
31
final File testFile = AbstractTestCase.copyAudioToTmp("test71.mp3");
32
if (!testFile.isFile())
34
System.err.println("Unable to test file - not available");
37
mp3File = new MP3File(testFile);
45
FrameBodyIPLS frameBody = (FrameBodyIPLS)(((ID3v23Frame)((ID3v23Tag)mp3File.getTag()).getFirstField("IPLS")).getBody());
46
assertEquals(3,frameBody.getNumberOfPairs());
47
assertEquals("producer",frameBody.getKeyAtIndex(0));
48
assertEquals("Tom Wilson",frameBody.getValueAtIndex(0));
49
assertEquals("producer",frameBody.getKeyAtIndex(1));
50
assertEquals("John H. Hammond",frameBody.getValueAtIndex(1));
b'\\ No newline at end of file'