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

« back to all changes in this revision

Viewing changes to srctest/org/jaudiotagger/issues/Issue315Test.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 can read FlacTag with spec breaking PICTUREBLOCK as first block and then write chnages
 
12
     * to it reordering so that STREAMINFO is the first block
 
13
*/
 
14
public class Issue315Test extends AbstractTestCase
 
15
{
 
16
    /*
 
17
     *
 
18
     * @throws Exception
 
19
     */
 
20
    public void testReadWriteTagWithPictureBlockAtStart() throws Exception
 
21
    {
 
22
        File orig = new File("testdata", "test54.flac");
 
23
        if (!orig.isFile())
 
24
        {
 
25
            System.err.println("Unable to test file - not available");
 
26
            return;
 
27
        }
 
28
 
 
29
        Exception e=null;
 
30
        try
 
31
        {
 
32
            final File testFile = AbstractTestCase.copyAudioToTmp("test54.flac");
 
33
            AudioFile af = AudioFileIO.read(testFile);
 
34
 
 
35
 
 
36
            //Modify File
 
37
            af.getTag().setField(FieldKey.TITLE,"newtitle");
 
38
            af.commit();
 
39
 
 
40
            //Reread File
 
41
            af = AudioFileIO.read(testFile);
 
42
 
 
43
        }
 
44
        catch(Exception ex)
 
45
        {
 
46
            e=ex;
 
47
            ex.printStackTrace();
 
48
        }
 
49
        assertNull(e);
 
50
    }
 
51
}
 
 
b'\\ No newline at end of file'