diff --git a/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java b/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java index c8a4035..df09734 100644 --- a/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java +++ b/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java @@ -110,7 +110,7 @@ public class TestRules { boolean matched = matcherReplace.check(serviceClass,serviceName,calledMethod); if(matched) { - //logger.info("{} --> {},{},{}", line, replacer.getServiceClass(), replacer.getServiceName(), replacer.getCalledMethod()); + logger.info("{} --> {},{},{}", line, replacer.getServiceClass(), replacer.getServiceName(), replacer.getCalledMethod()); } else { logger.error("{} does not match {}. This MUST not occur.", line, matcherReplace.getMultiMatcher().toString()); throw new Exception(); @@ -163,7 +163,7 @@ public class TestRules { File[] elaborationFilesNoMatch = rulesDirectory.listFiles(filenameFilter); for(File elaborationFileNoMatch : elaborationFilesNoMatch) { - logger.trace("\n\nComparing examples which must not match from file {}", elaborationFileNoMatch.getAbsolutePath()); + logger.info("Comparing examples which must not match from file {}", elaborationFileNoMatch.getName()); try(BufferedReader br = new BufferedReader(new FileReader(elaborationFileNoMatch))) { for(String line; (line = br.readLine()) != null;) { String[] splittedLine = line.split(","); @@ -175,7 +175,7 @@ public class TestRules { logger.error("{} match {} but it should NOT. This MUST not occur.", line, matcherReplace.getMultiMatcher().toString()); throw new Exception(); } else { - //logger.info("{} does NOT match as requested", line, replacer.getServiceClass(), replacer.getServiceName(), replacer.getCalledMethod()); + logger.trace("{} does NOT match as requested", line, replacer.getServiceClass(), replacer.getServiceName(), replacer.getCalledMethod()); } @@ -205,7 +205,7 @@ public class TestRules { ContextTest.setContextByName(ContextTest.DEFAULT_TEST_SCOPE); initAllRules(); File rulesDirectory = getRulesDirectory(); - File rulesFile = new File(rulesDirectory, "SmartExecutor-UNKNOWN.json"); + File rulesFile = new File(rulesDirectory, "DataMiner-getCapabilities.json"); testRule(rulesFile); } diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index ed99be9..0703b78 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -2,18 +2,21 @@ - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0}: %msg%n - - - - - - + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0}: %msg%n + + + + + + + + + + + + - - - - \ No newline at end of file diff --git a/src/test/resources/rules/DataMiner-UNKNOWN.csv b/src/test/resources/rules/DataMiner-UNKNOWN.csv new file mode 100644 index 0000000..d56fc86 --- /dev/null +++ b/src/test/resources/rules/DataMiner-UNKNOWN.csv @@ -0,0 +1,4 @@ +WPS,DataMiner,/WebProcessingService +WPS,DataMiner,WebProcessingService +WPS,DataMiner,UNKNOWN +WPS,DataMiner,gcube/resource/scopes \ No newline at end of file diff --git a/src/test/resources/rules/DataMiner-UNKNOWN.json b/src/test/resources/rules/DataMiner-UNKNOWN.json new file mode 100644 index 0000000..3b81c46 --- /dev/null +++ b/src/test/resources/rules/DataMiner-UNKNOWN.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "WPS", + "serviceNameRegex": "DataMiner", + "calledMethodRegex": "^/{0,1}(WebProcessingService|UNKNOWN|gcube\/resource\/scopes).*" + }, + "replace": { + "serviceClass": "WPS", + "serviceName": "DataMiner", + "calledMethod": "UNKNOWN" + } +} \ No newline at end of file diff --git a/src/test/resources/rules/DataMiner-describeProcess.csv b/src/test/resources/rules/DataMiner-describeProcess.csv new file mode 100644 index 0000000..6e4dc54 --- /dev/null +++ b/src/test/resources/rules/DataMiner-describeProcess.csv @@ -0,0 +1 @@ +WPS,DataMiner,DescribeProcess \ No newline at end of file diff --git a/src/test/resources/rules/DataMiner-describeProcess.json b/src/test/resources/rules/DataMiner-describeProcess.json new file mode 100644 index 0000000..b49981f --- /dev/null +++ b/src/test/resources/rules/DataMiner-describeProcess.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "WPS", + "serviceNameRegex": "DataMiner", + "calledMethodRegex": "^/{0,1}DescribeProcess.*" + }, + "replace": { + "serviceClass": "WPS", + "serviceName": "DataMiner", + "calledMethod": "describeProcess" + } +} \ No newline at end of file diff --git a/src/test/resources/rules/DataMiner-execute.csv b/src/test/resources/rules/DataMiner-execute.csv new file mode 100644 index 0000000..fd4ca19 --- /dev/null +++ b/src/test/resources/rules/DataMiner-execute.csv @@ -0,0 +1,71 @@ +WPS,DataMiner,Execute +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.clusterers.DBSCAN +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.clusterers.KMEANS +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.clusterers.LOF +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.clusterers.XMEANS +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.evaluators.DISCREPANCY_ANALYSIS +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.evaluators.HRS +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.evaluators.MAPS_COMPARISON +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.evaluators.QUALITY_ANALYSIS +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.generators.AQUAMAPS_SUITABLE +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.generators.BIONYM +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.generators.FEED_FORWARD_A_N_N_DISTRIBUTION +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.generators.OCCURRENCES_MERGER +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.modellers.FEED_FORWARD_ANN +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.AAPS_PUBLIC_PUBLISHER +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ABSENCE_CELLS_FROM_AQUAMAPS +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ABSENCE_GENERATION_FROM_OBIS +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.BIOCLIMATE_HCAF +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.BIOCLIMATE_HSPEN +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.BIONYM_LOCAL +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.CMSY_2 +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.CSQUARES_TO_COORDINATES +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.CSQUARE_COLUMN_CREATOR +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.CSV_TO_NETCDF_CONVERTER_XY +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ECOPATH_WITH_ECOSIM +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ESRI_GRID_EXTRACTION +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ESTIMATE_FISHING_ACTIVITY +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ESTIMATE_MONTHLY_FISHING_EFFORT +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.FAO_OCEAN_AREA_COLUMN_CREATOR +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.FAO_OCEAN_AREA_COLUMN_CREATOR_FROM_QUADRANT +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.GENERIC_CHARTS +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.GEO_CHART +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.GERMAN_NAMED_ENTITY_RECOGNIZER +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.GRID_CWP_TO_COORDINATES +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.HCAF_FILTER +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ITALIAN_NER +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.LISTDBINFO +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.LISTDBNAMES +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.LISTDBSCHEMA +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.LISTTABLES +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.MAX_ENT_NICHE_MODELLING +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.MOST_OBSERVED_SPECIES +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.MOST_OBSERVED_TAXA +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.MPA_INTERSECT_V3 +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.MPA_INTERSECT_V3_2 +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.OCCURRENCES_DUPLICATES_DELETER +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.POINTS_TO_MAP +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.PRESENCE_CELLS_GENERATION +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.RASTER_DATA_PUBLISHER +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.SAMPLEONTABLE +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.SEADATANET_INTERPOLATOR +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.SGVM_INTERPOLATION +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.SHAPEFILE_PUBLISHER +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.SIMULFISHKPIS +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.SMARTSAMPLEONTABLE +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.SPECIES_OBSERVATIONS_PER_AREA +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.SPECIES_OBSERVATIONS_TREND_PER_YEAR +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.SPECIES_OBSERVATION_LME_AREA_PER_YEAR +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.SPECIES_OBSERVATION_MEOW_AREA_PER_YEAR +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.SUBMITQUERY +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.TAXONOMY_OBSERVATIONS_TREND_PER_YEAR +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.TIMEEXTRACTION +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.TIMEEXTRACTION_TABLE +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.TIME_GEO_CHART +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.TIME_SERIES_ANALYSIS +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.TIME_SERIES_CHARTS +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.WEB_APP_PUBLISHER +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.XYEXTRACTOR +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.XYEXTRACTOR_TABLE +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ZEXTRACTION +WPS,DataMiner,Execute - org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mappedclasses.transducerers.ZEXTRACTION_TABLE \ No newline at end of file diff --git a/src/test/resources/rules/DataMiner-getCapabilities.csv b/src/test/resources/rules/DataMiner-getCapabilities.csv new file mode 100644 index 0000000..59e964d --- /dev/null +++ b/src/test/resources/rules/DataMiner-getCapabilities.csv @@ -0,0 +1 @@ +WPS,DataMiner,GetCapabilities \ No newline at end of file diff --git a/src/test/resources/rules/DataMiner-getCapabilities.json b/src/test/resources/rules/DataMiner-getCapabilities.json new file mode 100644 index 0000000..67bd127 --- /dev/null +++ b/src/test/resources/rules/DataMiner-getCapabilities.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "WPS", + "serviceNameRegex": "DataMiner", + "calledMethodRegex": "^/{0,1}GetCapabilities.*" + }, + "replace": { + "serviceClass": "WPS", + "serviceName": "DataMiner", + "calledMethod": "getCapabilities" + } +} \ No newline at end of file diff --git a/src/test/resources/rules/DataMiner-getResult.csv b/src/test/resources/rules/DataMiner-getResult.csv new file mode 100644 index 0000000..04ea22d --- /dev/null +++ b/src/test/resources/rules/DataMiner-getResult.csv @@ -0,0 +1,2 @@ +WPS,DataMiner,/RetrieveResultServlet +WPS,DataMiner,RetrieveResultServlet \ No newline at end of file diff --git a/src/test/resources/rules/DataMiner-getResult.json b/src/test/resources/rules/DataMiner-getResult.json new file mode 100644 index 0000000..0578cc8 --- /dev/null +++ b/src/test/resources/rules/DataMiner-getResult.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "WPS", + "serviceNameRegex": "DataMiner", + "calledMethodRegex": "^/{0,1}RetrieveResult.*" + }, + "replace": { + "serviceClass": "WPS", + "serviceName": "DataMiner", + "calledMethod": "getResult" + } +} \ No newline at end of file diff --git a/src/test/resources/rules/DataMiner-stop.csv b/src/test/resources/rules/DataMiner-stop.csv new file mode 100644 index 0000000..c8e6152 --- /dev/null +++ b/src/test/resources/rules/DataMiner-stop.csv @@ -0,0 +1,2 @@ +WPS,DataMiner,/CancelComputationServlet +WPS,DataMiner,CancelComputationServlet \ No newline at end of file diff --git a/src/test/resources/rules/DataMiner-stop.json b/src/test/resources/rules/DataMiner-stop.json new file mode 100644 index 0000000..4717501 --- /dev/null +++ b/src/test/resources/rules/DataMiner-stop.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "WPS", + "serviceNameRegex": "DataMiner", + "calledMethodRegex": "^/{0,1}CancelComputation.*" + }, + "replace": { + "serviceClass": "WPS", + "serviceName": "DataMiner", + "calledMethod": "stop" + } +} \ No newline at end of file