diff options
author | Timoney, Dan (dt5972) <dt5972@att.com> | 2018-03-21 19:15:29 -0400 |
---|---|---|
committer | Timoney, Dan (dt5972) <dt5972@att.com> | 2018-03-21 19:15:29 -0400 |
commit | 5e0f12e215d579b2adff145a8527cc6a225d8db9 (patch) | |
tree | ef87133649452caee5c880e2c6b51d84daf85e52 | |
parent | 925b19ce628cf6b252840fd4462208a8ad099f39 (diff) |
Add unit tests for sli/provider
Add additional unit testing for configure node
Change-Id: I867fd1aae54e956bdbe8a2f2fd406b46304b4a91
Issue-ID: CCSDK-213
Signed-off-by: Timoney, Dan (dt5972) <dt5972@att.com>
-rwxr-xr-x | sli/common/pom.xml | 5 | ||||
-rw-r--r-- | sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/DummyAdaptor.java | 12 | ||||
-rw-r--r-- | sli/provider/src/test/resources/l3sdn_logic_v10.xml | 33 |
3 files changed, 50 insertions, 0 deletions
diff --git a/sli/common/pom.xml b/sli/common/pom.xml index 2fb3f8370..1d35dfb1b 100755 --- a/sli/common/pom.xml +++ b/sli/common/pom.xml @@ -98,6 +98,11 @@ <artifactId>sal-binding-api</artifactId> </dependency> + <dependency> + <groupId>com.att.eelf</groupId> + <artifactId>eelf-core</artifactId> + </dependency> + <!-- Testing Dependencies --> <dependency> <groupId>junit</groupId> diff --git a/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/DummyAdaptor.java b/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/DummyAdaptor.java index 877653441..0f3893efb 100644 --- a/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/DummyAdaptor.java +++ b/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/DummyAdaptor.java @@ -20,6 +20,18 @@ public class DummyAdaptor implements SvcLogicAdaptor { @Override public ConfigStatus configure(String key, Map<String, String> parameters, SvcLogicContext ctx) { + if ("ALREADY_ACTIVE".equalsIgnoreCase(key)) { + return ConfigStatus.ALREADY_ACTIVE; + } else if ("NOT_FOUND".equalsIgnoreCase(key)) { + return ConfigStatus.NOT_FOUND; + }else if ("NOT_READY".equalsIgnoreCase(key)) { + return ConfigStatus.NOT_READY; + } else if ("FAILURE".equalsIgnoreCase(key)) { + return ConfigStatus.FAILURE; + } else if ("SUCCESS".equalsIgnoreCase(key)) { + return ConfigStatus.SUCCESS; + } + return ConfigStatus.SUCCESS; } diff --git a/sli/provider/src/test/resources/l3sdn_logic_v10.xml b/sli/provider/src/test/resources/l3sdn_logic_v10.xml index c1123d13d..1386df10d 100644 --- a/sli/provider/src/test/resources/l3sdn_logic_v10.xml +++ b/sli/provider/src/test/resources/l3sdn_logic_v10.xml @@ -97,6 +97,39 @@ <configure adaptor="`$configure-plugin`" key="dummy" activate="true"> <parameter name="field1" value="1"/> </configure> + <configure adaptor="`$configure-plugin`" key="SUCCESS" activate="true"> + <parameter name="field1" value="1"/> + </configure> + <configure adaptor="`$configure-plugin`" key="ALREADY_ACTIVE" activate="true"> + <parameter name="field1" value="1"/> + </configure> + <configure adaptor="`$configure-plugin`" key="NOT_FOUND" activate="true"> + <parameter name="field1" value="1"/> + </configure> + <configure adaptor="`$configure-plugin`" key="NOT_READY" activate="true"> + <parameter name="field1" value="1"/> + </configure> + <configure adaptor="`$configure-plugin`" key="FAILURE" activate="true"> + <parameter name="field1" value="1"/> + </configure> + <configure adaptor="`$configure-plugin`" key="dummy" activate="false"> + <parameter name="field1" value="1"/> + </configure> + <configure adaptor="`$configure-plugin`" key="SUCCESS" activate="false"> + <parameter name="field1" value="1"/> + </configure> + <configure adaptor="`$configure-plugin`" key="ALREADY_ACTIVE" activate="false"> + <parameter name="field1" value="1"/> + </configure> + <configure adaptor="`$configure-plugin`" key="NOT_FOUND" activate="false"> + <parameter name="field1" value="1"/> + </configure> + <configure adaptor="`$configure-plugin`" key="NOT_READY" activate="false"> + <parameter name="field1" value="1"/> + </configure> + <configure adaptor="`$configure-plugin`" key="FAILURE" activate="false"> + <parameter name="field1" value="1"/> + </configure> </block> </method> |