~ubuntu-branches/ubuntu/utopic/libjaudiotagger-java/utopic

« back to all changes in this revision

Viewing changes to srctest/org/jaudiotagger/issues/Issue285Test.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2011-04-28 23:52:43 UTC
  • mfrom: (3.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110428235243-pzalvw6lncis3ukf
Tags: 2.0.3-1
* d/control: Drop Depends on default-jre per Debian Java Policy as its
  a library package.
* d/watch: Fix to directly monitor SVN tags.
* Switch to 3.0 (quilt) format.
* Bump Standards-Version to 3.9.2 (no changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package org.jaudiotagger.issues;
2
 
 
3
 
import org.jaudiotagger.AbstractTestCase;
4
 
import org.jaudiotagger.audio.AudioFile;
5
 
import org.jaudiotagger.audio.AudioFileIO;
6
 
import org.jaudiotagger.tag.FieldKey;
7
 
 
8
 
import java.io.File;
9
 
 
10
 
/**
11
 
 * Converting FrameBodyUnsupported with known identifier to FrameBodyIPLS (v23) causing NoSuchMethodException.
12
 
 * Not really sure why this is happening but we should check and take action instead of failing as we currently do
13
 
 */
14
 
public class Issue285Test extends AbstractTestCase
15
 
{
16
 
    public void testSavingOggFile()
17
 
    {
18
 
        File orig = new File("testdata", "test57.ogg");
19
 
        if (!orig.isFile())
20
 
        {
21
 
            System.err.println("Unable to test file - not available");
22
 
            return;
23
 
        }
24
 
 
25
 
 
26
 
 
27
 
        File testFile = null;
28
 
        Exception exceptionCaught = null;
29
 
        try
30
 
        {
31
 
            testFile = AbstractTestCase.copyAudioToTmp("test57.ogg");
32
 
 
33
 
            //OggFileReader ofr = new OggFileReader();
34
 
            //ofr.summarizeOggPageHeaders(testFile);
35
 
 
36
 
            AudioFile af = AudioFileIO.read(testFile);
37
 
            af.getTag().setField(FieldKey.COMMENT,"TEST");
38
 
            af.commit();
39
 
 
40
 
        }
41
 
        catch (Exception e)
42
 
        {
43
 
            e.printStackTrace();
44
 
            exceptionCaught = e;
45
 
        }
46
 
 
47
 
        assertNull(exceptionCaught);
48
 
    }
49
 
 
50
 
    
51
 
}
 
1
package org.jaudiotagger.issues;
 
2
 
 
3
import org.jaudiotagger.AbstractTestCase;
 
4
import org.jaudiotagger.audio.AudioFile;
 
5
import org.jaudiotagger.audio.AudioFileIO;
 
6
import org.jaudiotagger.tag.FieldKey;
 
7
 
 
8
import java.io.File;
 
9
 
 
10
/**
 
11
 * Converting FrameBodyUnsupported with known identifier to FrameBodyIPLS (v23) causing NoSuchMethodException.
 
12
 * Not really sure why this is happening but we should check and take action instead of failing as we currently do
 
13
 */
 
14
public class Issue285Test extends AbstractTestCase
 
15
{
 
16
    public void testSavingOggFile()
 
17
    {
 
18
        File orig = new File("testdata", "test57.ogg");
 
19
        if (!orig.isFile())
 
20
        {
 
21
            System.err.println("Unable to test file - not available");
 
22
            return;
 
23
        }
 
24
 
 
25
 
 
26
 
 
27
        File testFile = null;
 
28
        Exception exceptionCaught = null;
 
29
        try
 
30
        {
 
31
            testFile = AbstractTestCase.copyAudioToTmp("test57.ogg");
 
32
 
 
33
            //OggFileReader ofr = new OggFileReader();
 
34
            //ofr.summarizeOggPageHeaders(testFile);
 
35
 
 
36
            AudioFile af = AudioFileIO.read(testFile);
 
37
            af.getTag().setField(FieldKey.COMMENT,"TEST");
 
38
            af.commit();
 
39
 
 
40
        }
 
41
        catch (Exception e)
 
42
        {
 
43
            e.printStackTrace();
 
44
            exceptionCaught = e;
 
45
        }
 
46
 
 
47
        assertNull(exceptionCaught);
 
48
    }
 
49
 
 
50
    
 
51
}