use of org.codice.imaging.nitf.fluent.impl.NitfParserInputFlowImpl in project alliance by codice.
the class NitfGmtiTransformerTest method testTre.
@Test
public void testTre() throws IOException, CatalogTransformerException, NitfFormatException {
NitfSegmentsFlow nitfSegmentsFlow = new NitfParserInputFlowImpl().inputStream(getInputStream(GMTI_TEST_NITF)).allData();
Metacard metacard = metacardFactory.createMetacard("101");
nitfSegmentsFlow = nitfHeaderTransformer.transform(nitfSegmentsFlow, metacard);
metacard = nitfGmtiTransformer.transform(nitfSegmentsFlow, metacard);
assertNotNull(metacard);
validateDate(metacard.getCreatedDate(), "2016-06-22 23:39:22");
validateDate(metacard.getEffectiveDate(), "2016-06-22 23:39:22");
validateDate(metacard.getModifiedDate(), "2016-06-22 23:39:22");
assertThat(metacard.getMetacardType().getName(), is("isr.gmti"));
Map<NitfAttribute, String> mtirpbAttributesMap = initMtirpbAttributes();
assertMtirpbAttributes(metacard, mtirpbAttributesMap);
}
use of org.codice.imaging.nitf.fluent.impl.NitfParserInputFlowImpl in project alliance by codice.
the class ImageInputTransformerTest method testPiaprd.
@Test
public void testPiaprd() throws IOException, NitfFormatException {
File nitfFile = File.createTempFile("nitf-", ".ntf");
try {
Map<NitfAttribute, NitfValue> treMap = createNitfWithPiaprd(nitfFile);
try (InputStream inputStream = new FileInputStream(nitfFile)) {
Metacard metacard = metacardFactory.createMetacard("piaprdTest");
NitfSegmentsFlow nitfSegmentsFlow = new NitfParserInputFlowImpl().inputStream(inputStream).headerOnly();
headerTransformer.transform(nitfSegmentsFlow, metacard);
transformer.transform(nitfSegmentsFlow, metacard);
assertAttributesMap(metacard, treMap);
}
} finally {
nitfFile.delete();
}
}
use of org.codice.imaging.nitf.fluent.impl.NitfParserInputFlowImpl in project alliance by codice.
the class ImageInputTransformerTest method testCsexra.
private void testCsexra(Consumer<Metacard> consumer) throws IOException, NitfFormatException {
File nitfFile = File.createTempFile("nitf-", ".ntf");
try {
createNitfWithCsexra(nitfFile);
try (InputStream inputStream = new FileInputStream(nitfFile)) {
Metacard metacard = metacardFactory.createMetacard("csexraTest");
NitfSegmentsFlow nitfSegmentsFlow = new NitfParserInputFlowImpl().inputStream(inputStream).headerOnly();
transformer.transform(nitfSegmentsFlow, metacard);
consumer.accept(metacard);
}
} finally {
nitfFile.delete();
}
}
use of org.codice.imaging.nitf.fluent.impl.NitfParserInputFlowImpl in project alliance by codice.
the class ImageInputTransformerTest method testCsdida.
@Test
public void testCsdida() throws IOException, NitfFormatException {
File nitfFile = File.createTempFile("nitf-", ".ntf");
try {
createNitfWithCsdida(nitfFile);
try (InputStream inputStream = new FileInputStream(nitfFile)) {
Metacard metacard = metacardFactory.createMetacard("csexraTest");
NitfSegmentsFlow nitfSegmentsFlow = new NitfParserInputFlowImpl().inputStream(inputStream).headerOnly();
headerTransformer.transform(nitfSegmentsFlow, metacard);
assertThat(metacard.getAttribute(Isr.PLATFORM_ID).getValue(), is("XY01"));
}
} finally {
nitfFile.delete();
}
}
use of org.codice.imaging.nitf.fluent.impl.NitfParserInputFlowImpl in project alliance by codice.
the class ImageInputTransformerTest method testAimidb.
@Test
public void testAimidb() throws IOException, NitfFormatException {
File nitfFile = File.createTempFile("nitf-", ".ntf");
try {
Map<NitfAttribute, NitfValue> treMap = createNitfWithAimidb(nitfFile);
try (InputStream inputStream = new FileInputStream(nitfFile)) {
Metacard metacard = metacardFactory.createMetacard("aimidbTest");
NitfSegmentsFlow nitfSegmentsFlow = new NitfParserInputFlowImpl().inputStream(inputStream).headerOnly();
headerTransformer.transform(nitfSegmentsFlow, metacard);
transformer.transform(nitfSegmentsFlow, metacard);
assertAttributesMap(metacard, treMap);
}
} finally {
nitfFile.delete();
}
}
Aggregations