@Test public void testProductFileFilter() { final SnapFileFilter snapFileFilter = plugIn.getProductFileFilter(); assertNotNull(snapFileFilter); assertArrayEquals(plugIn.getDefaultFileExtensions(), snapFileFilter.getExtensions()); assertEquals(plugIn.getFormatNames()[0], snapFileFilter.getFormatName()); assertEquals( true, snapFileFilter.getDescription().contains(plugIn.getDescription(Locale.getDefault()))); }
@Test public void testFormatNames() { final String[] formatNames = plugIn.getFormatNames(); assertNotNull(formatNames); assertEquals(1, formatNames.length); assertEquals("SPOT4Take5", formatNames[0]); }
@Test public void testInputTypes() { final Class[] classes = plugIn.getInputTypes(); assertNotNull(classes); assertEquals(2, classes.length); final List<Class> list = Arrays.asList(classes); assertEquals(true, list.contains(File.class)); assertEquals(true, list.contains(String.class)); }
@Test public void testDecodeQualificationForXML() throws IOException { assumeTrue(TestUtil.testdataAvailable()); Date startDate = Calendar.getInstance().getTime(); DecodeQualification decodeQualification = plugIn.getDecodeQualification( TestUtil.getTestFile(productsFolder + "dimap/test_ST4_MT.xml")); assertEquals(DecodeQualification.UNABLE, decodeQualification); decodeQualification = plugIn.getDecodeQualification( TestUtil.getTestFile(productsFolder + "SPOT4_HRVIR1_XS_88888888_N1A.tgz")); assertEquals(DecodeQualification.INTENDED, decodeQualification); Date endDate = Calendar.getInstance().getTime(); assertTrue( "The decoding time for the file is too big!", (endDate.getTime() - startDate.getTime()) / 1000 < 30); // 30 sec }
@Test public void testFileExtensions() { final String[] fileExtensions = plugIn.getDefaultFileExtensions(); assertNotNull(fileExtensions); final List<String> extensionList = Arrays.asList(fileExtensions); assertEquals(4, extensionList.size()); assertEquals(".xml", extensionList.get(0)); assertEquals(".XML", extensionList.get(1)); assertEquals(".tgz", extensionList.get(2)); assertEquals(".TGZ", extensionList.get(3)); }