public void testAllProductTypes_InTheMiddle() throws ProductIOException { final String[] supportetProductTypes = ModisProductDb.getInstance().getSupportetProductTypes(); for (int i = 0; i < supportetProductTypes.length; i++) { final String type = supportetProductTypes[i]; final String toTest = "anyPrefix." + type + ".anySuffix"; assertEquals("Index = " + i, ModisDaacUtils.extractProductType(toTest), type); } }
public void testAllProductTypes_AtStart() throws ProductIOException { final String[] supportetProductTypes = ModisProductDb.getInstance().getSupportetProductTypes(); for (int i = 0; i < supportetProductTypes.length; i++) { final String type = supportetProductTypes[i]; final String toTest = type + ".anySuffix"; assertEquals("Index = " + i, ModisDaacUtils.extractProductType(toTest), type); } }
public void testShittyEsaNotFollowingTheConventionsNameHandling() throws ProductIOException { final String[] supportetProductTypes = ModisProductDb.getInstance().getSupportetProductTypes(); for (int i = 0; i < supportetProductTypes.length; i++) { final String type = supportetProductTypes[i]; final String toTest = type + "_anySuffix"; if (isImapp(toTest)) { // this does not work for IMAPP types - intentionally! tb 2008-06-17 continue; } assertEquals("Index = " + i, ModisDaacUtils.extractProductType(toTest), type); } }
@Test public void testSupportetProductTypes() throws ProductIOException { final String[] expectedProductTypes = new String[]{ "MOD021KM", "MYD021KM", "MOD021KM_IMAPP", "MOD02HKM", "MYD02HKM", "MOD02QKM", "MYD02QKM", "MODOCL2", "MYDOCL2", "MODOCL2A", "MYDOCL2A", "MODOCL2B", "MYDOCL2B", "MOD28L2", "MYD28L2", "MODOCQC", "MYDOCQC", "MOD13A2", "MYD13A2", "MOD15A2", "MYD15A2", "MOD09GA", "MYD09GA" }; final String[] types = ModisProductDb.getInstance().getSupportetProductTypes(); assertNotNull(types); assertEquals(expectedProductTypes.length, types.length); for (final String type : expectedProductTypes) { assertTrue("type <" + type + "> not in the result", StringUtils.contains(types, type)); } } }