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

« back to all changes in this revision

Viewing changes to srctest/org/jaudiotagger/issues/Issue268Test.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
 
 * Test read m4a without udta/meta atom
12
 
 */
13
 
public class Issue268Test extends AbstractTestCase
14
 
{
15
 
 
16
 
    /**
17
 
     * Test read wma with NonArtwork Binary Data
18
 
     */
19
 
    public void testReadWma()
20
 
    {
21
 
        File orig = new File("testdata", "test8.wma");
22
 
        if (!orig.isFile())
23
 
        {
24
 
            System.err.println("Unable to test file - not available");
25
 
            return;
26
 
        }
27
 
 
28
 
        File testFile = null;
29
 
        Exception exceptionCaught = null;
30
 
        try
31
 
        {
32
 
            testFile = AbstractTestCase.copyAudioToTmp("test8.wma");
33
 
 
34
 
            //Read File okay
35
 
            AudioFile af = AudioFileIO.read(testFile);
36
 
            System.out.println(af.getTag().toString());
37
 
 
38
 
            af.getTag().setField(FieldKey.ALBUM,"FRED");
39
 
            af.commit();
40
 
            af = AudioFileIO.read(testFile);
41
 
            System.out.println(af.getTag().toString());
42
 
            assertEquals("FRED",af.getTag().getFirst(FieldKey.ALBUM));
43
 
 
44
 
 
45
 
        }
46
 
        catch(Exception e)
47
 
        {
48
 
            e.printStackTrace();
49
 
            exceptionCaught=e;
50
 
        }
51
 
 
52
 
        assertNull(exceptionCaught);
53
 
    }
54
 
 
55
 
}
 
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
 * Test read m4a without udta/meta atom
 
12
 */
 
13
public class Issue268Test extends AbstractTestCase
 
14
{
 
15
 
 
16
    /**
 
17
     * Test read wma with NonArtwork Binary Data
 
18
     */
 
19
    public void testReadWma()
 
20
    {
 
21
        File orig = new File("testdata", "test8.wma");
 
22
        if (!orig.isFile())
 
23
        {
 
24
            System.err.println("Unable to test file - not available");
 
25
            return;
 
26
        }
 
27
 
 
28
        File testFile = null;
 
29
        Exception exceptionCaught = null;
 
30
        try
 
31
        {
 
32
            testFile = AbstractTestCase.copyAudioToTmp("test8.wma");
 
33
 
 
34
            //Read File okay
 
35
            AudioFile af = AudioFileIO.read(testFile);
 
36
            System.out.println(af.getTag().toString());
 
37
 
 
38
            af.getTag().setField(FieldKey.ALBUM,"FRED");
 
39
            af.commit();
 
40
            af = AudioFileIO.read(testFile);
 
41
            System.out.println(af.getTag().toString());
 
42
            assertEquals("FRED",af.getTag().getFirst(FieldKey.ALBUM));
 
43
 
 
44
 
 
45
        }
 
46
        catch(Exception e)
 
47
        {
 
48
            e.printStackTrace();
 
49
            exceptionCaught=e;
 
50
        }
 
51
 
 
52
        assertNull(exceptionCaught);
 
53
    }
 
54
 
 
55
}