MphChlBasisOp extends PixelOperator { @Override protected void configureTargetSamples(TargetSampleConfigurer sampleConfigurer) throws OperatorException { sampleConfigurer.defineSample(0, "chl"); sampleConfigurer.defineSample(1, "mph_chl_flags"); sampleConfigurer.defineSample(2, "immersed_cyanobacteria"); sampleConfigurer.defineSample(3, "floating_cyanobacteria"); sampleConfigurer.defineSample(4, "floating_vegetation"); if (exportMph) { sampleConfigurer.defineSample(5, "mph"); } }    }
@Test public void testConfigureTargetSample() { final TestTargetSampleConfigurer sampleConfigurer = new TestTargetSampleConfigurer(); mphChlOp.configureTargetSamples(sampleConfigurer); final HashMap<Integer, String> sampleMap = sampleConfigurer.getSampleMap(); assertEquals(5, sampleMap.size()); assertEquals("chl", sampleMap.get(0)); assertEquals("mph_chl_flags", sampleMap.get(1)); assertEquals("immersed_cyanobacteria", sampleMap.get(2)); assertEquals("floating_cyanobacteria", sampleMap.get(3)); assertEquals("floating_vegetation", sampleMap.get(4)); }
@Test public void testConfigureTargetSample_withMph() { final TestTargetSampleConfigurer sampleConfigurer = new TestTargetSampleConfigurer(); mphChlOp.exportMph = true; mphChlOp.configureTargetSamples(sampleConfigurer); final HashMap<Integer, String> sampleMap = sampleConfigurer.getSampleMap(); assertEquals(6, sampleMap.size()); assertEquals("chl", sampleMap.get(0)); assertEquals("mph_chl_flags", sampleMap.get(1)); assertEquals("immersed_cyanobacteria", sampleMap.get(2)); assertEquals("floating_cyanobacteria", sampleMap.get(3)); assertEquals("floating_vegetation", sampleMap.get(4)); assertEquals("mph", sampleMap.get(5)); }