From 550d0d986713f4da7b37b8f2b16264884c05b9ab Mon Sep 17 00:00:00 2001 From: ramverma Date: Wed, 8 Aug 2018 23:17:37 +0100 Subject: 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 --- .../parameters/DistributionConfigParameters.json | 23 ++++++++++++++++ ...ibutionConfigParameters_EmptyPolicyDecoder.json | 19 +++++++++++++ ...utionConfigParameters_EmptyPolicyForwarder.json | 19 +++++++++++++ ...tionConfigParameters_EmptyReceptionHandler.json | 5 ++++ .../DistributionConfigParameters_InvalidName.json | 23 ++++++++++++++++ ...ConfigParameters_InvalidPolicyDecoderClass.json | 31 ++++++++++++++++++++++ ...nConfigParameters_InvalidPolicyDecoderType.json | 23 ++++++++++++++++ ...nfigParameters_InvalidPolicyForwarderClass.json | 27 +++++++++++++++++++ ...onfigParameters_InvalidPolicyForwarderType.json | 23 ++++++++++++++++ ...figParameters_InvalidReceptionHandlerClass.json | 23 ++++++++++++++++ ...nfigParameters_InvalidReceptionHandlerType.json | 23 ++++++++++++++++ ...stributionConfigParameters_NoPolicyDecoder.json | 17 ++++++++++++ ...ributionConfigParameters_NoPolicyForwarder.json | 17 ++++++++++++ ...ibutionConfigParameters_NoReceptionHandler.json | 3 +++ .../resources/parameters/MinimumParameters.json | 24 +++++++++++++++-- 15 files changed, 298 insertions(+), 2 deletions(-) create mode 100644 main/src/test/resources/parameters/DistributionConfigParameters.json create mode 100644 main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json create mode 100644 main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json create mode 100644 main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json create mode 100644 main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json create mode 100644 main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderClass.json create mode 100644 main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyDecoderType.json create mode 100644 main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderClass.json create mode 100644 main/src/test/resources/parameters/DistributionConfigParameters_InvalidPolicyForwarderType.json create mode 100644 main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerClass.json create mode 100644 main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerType.json create mode 100644 main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json create mode 100644 main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json create mode 100644 main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json (limited to 'main/src/test/resources') 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 -- cgit 1.2.3-korg