File tree Expand file tree Collapse file tree
xmpbox/src/test/java/org/apache/xmpbox/schema Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525import static org .junit .jupiter .api .Assertions .assertNotNull ;
2626
2727import java .io .ByteArrayOutputStream ;
28+ import java .io .IOException ;
2829import org .apache .xmpbox .XMPMetadata ;
2930import org .apache .xmpbox .type .OECFType ;
3031import org .apache .xmpbox .type .TextType ;
4041class TestExifXmp
4142{
4243 @ Test
43- void testNonStrict () throws XmpParsingException
44+ void testNonStrict () throws XmpParsingException , IOException
4445 {
45- InputStream is = this .getClass ().getResourceAsStream ("/validxmp/exif.xmp" );
46-
47- DomXmpParser builder = new DomXmpParser ();
48- builder .setStrictParsing (false );
49- XMPMetadata rxmp = builder .parse (is );
50- ExifSchema schema = (ExifSchema )rxmp .getSchema (ExifSchema .class );
51- TextType ss = (TextType )schema .getProperty (ExifSchema .SPECTRAL_SENSITIVITY );
52- assertNotNull (ss );
53- assertEquals ("spectral sens value" ,ss .getValue ());
46+ try (InputStream is = this .getClass ().getResourceAsStream ("/validxmp/exif.xmp" ))
47+ {
48+ DomXmpParser builder = new DomXmpParser ();
49+ builder .setStrictParsing (false );
50+ XMPMetadata rxmp = builder .parse (is );
51+ ExifSchema schema = (ExifSchema )rxmp .getSchema (ExifSchema .class );
52+ TextType ss = (TextType )schema .getProperty (ExifSchema .SPECTRAL_SENSITIVITY );
53+ assertNotNull (ss );
54+ assertEquals ("spectral sens value" ,ss .getValue ());
55+ }
5456 }
5557
5658 @ Test
You can’t perform that action at this time.
0 commit comments