summaryrefslogtreecommitdiffstats
path: root/main/src/test/resources
diff options
context:
space:
mode:
authorramverma <ram.krishna.verma@ericsson.com>2018-08-08 23:17:37 +0100
committerramverma <ram.krishna.verma@ericsson.com>2018-08-09 21:51:51 +0100
commit550d0d986713f4da7b37b8f2b16264884c05b9ab (patch)
tree20efa2af8b1d11f13fca43fdd6d67834b4a03816 /main/src/test/resources
parentf85f63f52d38ca962fc0e68eae184dd7018dc47b (diff)
Adding configuration parameters for distribution
* Adding main configuration parameters to distribution component. The intention is to define a top level parameter group that should be capable of handling all the parameters needed for the framework. * Added validation to check the actuall class by loading it from classpath. * Added Test Cases for configuration parameter. The coverage of the package is 95.3 %. Change-Id: I87c4c34d9df2c9b5a0ab75bef2bbe0d25e38747b Issue-ID: POLICY-1035 Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
Diffstat (limited to 'main/src/test/resources')
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters.json23
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json19
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json19
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json5
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json23
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderClass.json31
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderType.json23
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderClass.json27
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderType.json23
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerClass.json23
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerType.json23
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json17
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json17
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json3
-rw-r--r--main/src/test/resources/parameters/MinimumParameters.json24
15 files changed, 298 insertions, 2 deletions
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters.json b/main/src/test/resources/parameters/DistributionConfigParameters.json
new file mode 100644
index 00000000..546e5231
--- /dev/null
+++ b/main/src/test/resources/parameters/DistributionConfigParameters.json
@@ -0,0 +1,23 @@
+{
+ "name":"SDCDistributionGroup",
+ "receptionHandlerParameters":{
+ "SDCReceptionHandler":{
+ "receptionHandlerType":"SDC",
+ "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler",
+ "pluginHandlerParameters":{
+ "policyDecoders":{
+ "TOSCADecoder":{
+ "decoderType":"TOSCA",
+ "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderToscaPdpx"
+ }
+ },
+ "policyForwarders":{
+ "PAPEngineForwarder":{
+ "forwarderType":"PAPEngine",
+ "forwarderClassName":"org.onap.policy.distribution.forwarding.pap.engine.XacmlPapServletPolicyForwarder"
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json
new file mode 100644
index 00000000..7a0d14a7
--- /dev/null
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json
@@ -0,0 +1,19 @@
+{
+ "name":"SDCDistributionGroup",
+ "receptionHandlerParameters":{
+ "SDCReceptionHandler":{
+ "receptionHandlerType":"SDC",
+ "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler",
+ "pluginHandlerParameters":{
+ "policyDecoders":{
+ },
+ "policyForwarders":{
+ "PAPEngineForwarder":{
+ "forwarderType":"PAPEngine",
+ "forwarderClassName":"org.onap.policy.distribution.forwarding.pap.engine.XacmlPapServletPolicyForwarder"
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json
new file mode 100644
index 00000000..b328df3d
--- /dev/null
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json
@@ -0,0 +1,19 @@
+{
+ "name":"SDCDistributionGroup",
+ "receptionHandlerParameters":{
+ "SDCReceptionHandler":{
+ "receptionHandlerType":"SDC",
+ "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler",
+ "pluginHandlerParameters":{
+ "policyDecoders":{
+ "TOSCADecoder":{
+ "decoderType":"TOSCA",
+ "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderToscaPdpx"
+ }
+ },
+ "policyForwarders":{
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json
new file mode 100644
index 00000000..45368be1
--- /dev/null
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json
@@ -0,0 +1,5 @@
+{
+ "name":"SDCDistributionGroup",
+ "receptionHandlerParameters":{
+ }
+} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json
new file mode 100644
index 00000000..c84a6784
--- /dev/null
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json
@@ -0,0 +1,23 @@
+{
+ "name":" ",
+ "receptionHandlerParameters":{
+ "SDCReceptionHandler":{
+ "receptionHandlerType":"SDC",
+ "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler",
+ "pluginHandlerParameters":{
+ "policyDecoders":{
+ "TOSCADecoder":{
+ "decoderType":"TOSCA",
+ "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderToscaPdpx"
+ }
+ },
+ "policyForwarders":{
+ "PAPEngineForwarder":{
+ "forwarderType":"PAPEngine",
+ "forwarderClassName":"org.onap.policy.distribution.forwarding.pap.engine.XacmlPapServletPolicyForwarder"
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderClass.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderClass.json
new file mode 100644
index 00000000..eeafc25a
--- /dev/null
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderClass.json
@@ -0,0 +1,31 @@
+{
+ "name":"SDCDistributionGroup",
+ "receptionHandlerParameters":{
+ "SDCReceptionHandler":{
+ "receptionHandlerType":"SDC",
+ "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler",
+ "pluginHandlerParameters":{
+ "policyDecoders":{
+ "TOSCADecoder":{
+ "decoderType":"TOSCA",
+ "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderToscaPdpx"
+ },
+ "APEXDecoder":{
+ "decoderType":"APEX",
+ "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderApexPdpa"
+ },
+ "DROOLSDecoder":{
+ "decoderType":"DROOLS",
+ "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderDroolsPdpd"
+ }
+ },
+ "policyForwarders":{
+ "PAPEngineForwarder":{
+ "forwarderType":"PAPEngine",
+ "forwarderClassName":"org.onap.policy.distribution.forwarding.pap.engine.XacmlPapServletPolicyForwarder"
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderType.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderType.json
new file mode 100644
index 00000000..21ff4ad6
--- /dev/null
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderType.json
@@ -0,0 +1,23 @@
+{
+ "name":"SDCDistributionGroup",
+ "receptionHandlerParameters":{
+ "SDCReceptionHandler":{
+ "receptionHandlerType":"SDC",
+ "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler",
+ "pluginHandlerParameters":{
+ "policyDecoders":{
+ "TOSCADecoder":{
+ "decoderType":" ",
+ "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderToscaPdpx"
+ }
+ },
+ "policyForwarders":{
+ "PAPEngineForwarder":{
+ "forwarderType":"PAPEngine",
+ "forwarderClassName":"org.onap.policy.distribution.forwarding.pap.engine.XacmlPapServletPolicyForwarder"
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderClass.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderClass.json
new file mode 100644
index 00000000..6cf54d80
--- /dev/null
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderClass.json
@@ -0,0 +1,27 @@
+{
+ "name":"SDCDistributionGroup",
+ "receptionHandlerParameters":{
+ "SDCReceptionHandler":{
+ "receptionHandlerType":"SDC",
+ "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler",
+ "pluginHandlerParameters":{
+ "policyDecoders":{
+ "TOSCADecoder":{
+ "decoderType":"TOSCA",
+ "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderToscaPdpx"
+ }
+ },
+ "policyForwarders":{
+ "PAPEngineForwarder":{
+ "forwarderType":"PAPEngine",
+ "forwarderClassName":"org.onap.policy.distribution.forwarding.pap.engine.XacmlPapServletPolicyForwarder"
+ },
+ "PAPStandaloneForwarder":{
+ "forwarderType":"PAPStandalone",
+ "forwarderClassName":"org.onap.policy.distribution.forwarding.pap.engine.PapStandalonePolicyForwarder"
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderType.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderType.json
new file mode 100644
index 00000000..ea44b8aa
--- /dev/null
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderType.json
@@ -0,0 +1,23 @@
+{
+ "name":"SDCDistributionGroup",
+ "receptionHandlerParameters":{
+ "SDCReceptionHandler":{
+ "receptionHandlerType":"SDC",
+ "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler",
+ "pluginHandlerParameters":{
+ "policyDecoders":{
+ "TOSCADecoder":{
+ "decoderType":"TOSCA",
+ "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderToscaPdpx"
+ }
+ },
+ "policyForwarders":{
+ "PAPEngineForwarder":{
+ "forwarderType":" ",
+ "forwarderClassName":"org.onap.policy.distribution.forwarding.pap.engine.XacmlPapServletPolicyForwarder"
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerClass.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerClass.json
new file mode 100644
index 00000000..7be2a1a6
--- /dev/null
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerClass.json
@@ -0,0 +1,23 @@
+{
+ "name":"SDCDistributionGroup",
+ "receptionHandlerParameters":{
+ "SDCReceptionHandler":{
+ "receptionHandlerType":"SDC",
+ "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.InvalidSdcReceptionHandler",
+ "pluginHandlerParameters":{
+ "policyDecoders":{
+ "TOSCADecoder":{
+ "decoderType":"TOSCA",
+ "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderToscaPdpx"
+ }
+ },
+ "policyForwarders":{
+ "PAPEngineForwarder":{
+ "forwarderType":"PAPEngine",
+ "forwarderClassName":"org.onap.policy.distribution.forwarding.pap.engine.XacmlPapServletPolicyForwarder"
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerType.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerType.json
new file mode 100644
index 00000000..791236cb
--- /dev/null
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerType.json
@@ -0,0 +1,23 @@
+{
+ "name":"SDCDistributionGroup",
+ "receptionHandlerParameters":{
+ "SDCReceptionHandler":{
+ "receptionHandlerType":" ",
+ "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler",
+ "pluginHandlerParameters":{
+ "policyDecoders":{
+ "TOSCADecoder":{
+ "decoderType":"TOSCA",
+ "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderToscaPdpx"
+ }
+ },
+ "policyForwarders":{
+ "PAPEngineForwarder":{
+ "forwarderType":"PAPEngine",
+ "forwarderClassName":"org.onap.policy.distribution.forwarding.pap.engine.XacmlPapServletPolicyForwarder"
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json b/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json
new file mode 100644
index 00000000..3ba35753
--- /dev/null
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json
@@ -0,0 +1,17 @@
+{
+ "name":"SDCDistributionGroup",
+ "receptionHandlerParameters":{
+ "SDCReceptionHandler":{
+ "receptionHandlerType":"SDC",
+ "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler",
+ "pluginHandlerParameters":{
+ "policyForwarders":{
+ "PAPEngineForwarder":{
+ "forwarderType":"PAPEngine",
+ "forwarderClassName":"org.onap.policy.distribution.forwarding.pap.engine.XacmlPapServletPolicyForwarder"
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json b/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json
new file mode 100644
index 00000000..660cac92
--- /dev/null
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json
@@ -0,0 +1,17 @@
+{
+ "name":"SDCDistributionGroup",
+ "receptionHandlerParameters":{
+ "SDCReceptionHandler":{
+ "receptionHandlerType":"SDC",
+ "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler",
+ "pluginHandlerParameters":{
+ "policyDecoders":{
+ "TOSCADecoder":{
+ "decoderType":"TOSCA",
+ "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderToscaPdpx"
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json b/main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json
new file mode 100644
index 00000000..8b0997ca
--- /dev/null
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json
@@ -0,0 +1,3 @@
+{
+ "name":"SDCDistributionGroup"
+} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/MinimumParameters.json b/main/src/test/resources/parameters/MinimumParameters.json
index 02b2afad..1b42cc4d 100644
--- a/main/src/test/resources/parameters/MinimumParameters.json
+++ b/main/src/test/resources/parameters/MinimumParameters.json
@@ -1,3 +1,23 @@
-{
- "name": "nameFromFile"
+{
+ "name":"SDCDistributionGroup",
+ "receptionHandlerParameters":{
+ "SDCReceptionHandler":{
+ "receptionHandlerType":"SDC",
+ "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.sdc.SdcReceptionHandler",
+ "pluginHandlerParameters":{
+ "policyDecoders":{
+ "TOSCADecoder":{
+ "decoderType":"TOSCA",
+ "decoderClassName":"org.onap.policy.distribution.reception.decoding.pdpx.PolicyDecoderToscaPdpx"
+ }
+ },
+ "policyForwarders":{
+ "PAPEngineForwarder":{
+ "forwarderType":"PAPEngine",
+ "forwarderClassName":"org.onap.policy.distribution.forwarding.pap.engine.XacmlPapServletPolicyForwarder"
+ }
+ }
+ }
+ }
+ }
} \ No newline at end of file