CalvalusDataInputs { @Override public String toString() { StringBuilder stringBuilder = new StringBuilder(); for (String key : inputMapFormatted.keySet()) { stringBuilder.append(key); stringBuilder.append(" : "); stringBuilder.append(inputMapFormatted.get(key)); stringBuilder.append("\n"); } return stringBuilder.toString(); } CalvalusDataInputs(ExecuteRequestExtractor executeRequestExtractor,
                       WpsProcess calvalusProcessor,
                       ProductSet[] productSets,
                       CalvalusFacade calvalusFacade); String getValue(String parameterName); @Override String toString(); static final long MIN_DATE; static final long MAX_DATE; static SimpleDateFormat ISO_DATE_FORMAT; }
@Test public void canListAllParameters() throws Exception { Map<String, String> mockInputMapRaw = getProductionParametersRawMap(); when(mockExecuteRequestExtractor.getInputParametersMapRaw()).thenReturn(mockInputMapRaw); when(mockCalvalusProcessor.getDefaultSnapBundle()).thenReturn("snap-3.0.0"); when(mockCalvalusProcessor.getDefaultCalvalusBundle()).thenReturn("calvalus-2.0b411"); when(mockCalvalusProcessor.getBundleLocation()).thenReturn("hdfs: CalvalusFacade mockCalvalusFacade = getMockCalvalusFacade(); calvalusDataInputs = new CalvalusDataInputs(mockExecuteRequestExtractor, mockCalvalusProcessor, productSets, mockCalvalusFacade); assertThat(calvalusDataInputs.toString(), equalTo("calvalus.wps.remote.ref : 1738ad7b-534e-4aca-9861-b26fb9c0f983\n" + "minDate : 2016-01-01T01:00:00+01:00\n" + "calvalus.output.compression : none\n" + "processorBundleLocation : hdfs: "calvalus.wps.remote.user : dummyRemoteUser\n" + "productionType : L2Plus\n" + "inputDataSetName : MERIS RR r03 L1b 2002-2012\n" + "processorBundleVersion : null\n" + "calvalus.calvalus.bundle : calvalus-2.0b411\n" + "inputPath : /calvalus/eodata/MER_RR__1P/r03/${yyyy}/${MM}/${dd}/.*.N1\n" + "minDateSource : 2016-01-01T01:00:00+01:00\n" + "quicklooks : true\n" + "autoStaging : true\n" + "calvalus.snap.bundle : snap-3.0.0\n" + "processorName : null\n" + "maxDate : 2017-01-01T01:00:00+01:00\n" + "processorBundleName : null\n" + "processorParameters : null\n" + "productionName : dummyProductionName\n" + "maxDateSource : 2017-01-01T01:00:00+01:00\n" + "calvalus.system.snap.dataio.bigtiff.support.pushprocessing : false\n")); }
@Test public void canIgnoreDefaultBeamAndCalvalusBundleVersionWhenNotProvided() throws Exception { Map<String, String> mockInputMapRaw = getMinimalRawMap(); when(mockExecuteRequestExtractor.getInputParametersMapRaw()).thenReturn(mockInputMapRaw); when(mockCalvalusProcessor.getDefaultCalvalusBundle()).thenReturn(null); when(mockCalvalusProcessor.getDefaultSnapBundle()).thenReturn(null); CalvalusFacade mockCalvalusFacade = getMockCalvalusFacade(); calvalusDataInputs = new CalvalusDataInputs(mockExecuteRequestExtractor, mockCalvalusProcessor, productSets, mockCalvalusFacade); assertThat(calvalusDataInputs.toString(), equalTo("calvalus.wps.remote.ref : 1738ad7b-534e-4aca-9861-b26fb9c0f983\n" + "minDate : 2016-01-01T01:00:00+01:00\n" + "calvalus.output.compression : none\n" + "processorBundleLocation : null\n" + "calvalus.wps.remote.user : dummyRemoteUser\n" + "productionType : L2Plus\n" + "inputDataSetName : MERIS RR r03 L1b 2002-2012\n" + "processorBundleVersion : null\n" + "inputPath : /calvalus/eodata/MER_RR__1P/r03/${yyyy}/${MM}/${dd}/.*.N1\n" + "minDateSource : 2016-01-01T01:00:00+01:00\n" + "quicklooks : true\n" + "autoStaging : true\n" + "processorName : null\n" + "maxDate : 2017-01-01T01:00:00+01:00\n" + "processorBundleName : null\n" + "processorParameters : null\n" + "maxDateSource : 2017-01-01T01:00:00+01:00\n" + "calvalus.system.snap.dataio.bigtiff.support.pushprocessing : false\n")); }