@Test(dataProvider = "testIFDParser") public void testGetIFDCount(IFDParser ifdParser) throws IOException, JXRException { int expectedIFDCount = 1; ifdParser.parse(); int actualIFDCount = ifdParser.getIFDCount(); ifdParser.close(); assertEquals(expectedIFDCount, actualIFDCount); }
@DataProvider(name = "testDatastreamParser") public static Object[][] testDatastreamParserProvider() throws IOException, JXRException { RandomAccessInputStream stream = streamFromFilename(TEST_FILE); FileParser fileParser = new FileParser(stream); fileParser.parse(); IFDParser ifdParser = new IFDParser(fileParser, stream); ifdParser.parse(); return new Object[][] {{new DatastreamParser(ifdParser, stream)}}; }
@Test(dataProvider = "testIFDParser") public void testClose(IFDParser ifdParser) throws IOException, JXRException { ifdParser.parse(); ifdParser.close(); assertNull(ifdParser.getIFDMetadata()); }