File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
xmpbox/src/test/java/org/apache/xmpbox Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change 2121
2222package org .apache .xmpbox ;
2323
24- import static org .junit .jupiter .api .Assertions .assertFalse ;
25-
24+ import java .io .IOException ;
2625import java .io .InputStream ;
2726import java .util .stream .Stream ;
2827
28+ import static org .junit .jupiter .api .Assertions .assertFalse ;
29+
2930import org .apache .xmpbox .xml .DomXmpParser ;
3031import org .apache .xmpbox .xml .XmpParsingException ;
3132import org .junit .jupiter .params .ParameterizedTest ;
@@ -46,13 +47,14 @@ static Stream<String> initializeParameters()
4647
4748 @ ParameterizedTest
4849 @ MethodSource ("initializeParameters" )
49- void main (String path ) throws XmpParsingException
50+ void main (String path ) throws XmpParsingException , IOException
5051 {
51- InputStream is = this .getClass ().getResourceAsStream (path );
52-
53- DomXmpParser builder = new DomXmpParser ();
54- XMPMetadata rxmp = builder .parse (is );
55- // ensure basic parsing was OK
56- assertFalse (rxmp .getAllSchemas ().isEmpty ());
52+ try (InputStream is = this .getClass ().getResourceAsStream (path ))
53+ {
54+ DomXmpParser builder = new DomXmpParser ();
55+ XMPMetadata rxmp = builder .parse (is );
56+ // ensure basic parsing was OK
57+ assertFalse (rxmp .getAllSchemas ().isEmpty ());
58+ }
5759 }
5860}
You can’t perform that action at this time.
0 commit comments