summaryrefslogtreecommitdiffstats
path: root/plugins/plugins-context/context-distribution/context-distribution-hazelcast
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/plugins-context/context-distribution/context-distribution-hazelcast')
-rw-r--r--plugins/plugins-context/context-distribution/context-distribution-hazelcast/pom.xml6
-rw-r--r--plugins/plugins-context/context-distribution/context-distribution-hazelcast/src/test/java/org/onap/policy/apex/plugins/context/distribution/hazelcast/HazelcastContextDistributorTest.java74
2 files changed, 80 insertions, 0 deletions
diff --git a/plugins/plugins-context/context-distribution/context-distribution-hazelcast/pom.xml b/plugins/plugins-context/context-distribution/context-distribution-hazelcast/pom.xml
index ce80a7a89..71806c54f 100644
--- a/plugins/plugins-context/context-distribution/context-distribution-hazelcast/pom.xml
+++ b/plugins/plugins-context/context-distribution/context-distribution-hazelcast/pom.xml
@@ -36,5 +36,11 @@
<artifactId>hazelcast</artifactId>
<version>${version.hazelcast}</version>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.apex-pdp.context</groupId>
+ <artifactId>context-test-utils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project> \ No newline at end of file
diff --git a/plugins/plugins-context/context-distribution/context-distribution-hazelcast/src/test/java/org/onap/policy/apex/plugins/context/distribution/hazelcast/HazelcastContextDistributorTest.java b/plugins/plugins-context/context-distribution/context-distribution-hazelcast/src/test/java/org/onap/policy/apex/plugins/context/distribution/hazelcast/HazelcastContextDistributorTest.java
new file mode 100644
index 000000000..c999c95f0
--- /dev/null
+++ b/plugins/plugins-context/context-distribution/context-distribution-hazelcast/src/test/java/org/onap/policy/apex/plugins/context/distribution/hazelcast/HazelcastContextDistributorTest.java
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.apex.plugins.context.distribution.hazelcast;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.onap.policy.apex.context.parameters.ContextParameters;
+import org.onap.policy.apex.context.test.distribution.ContextAlbumUpdate;
+import org.onap.policy.apex.context.test.distribution.ContextInstantiation;
+import org.onap.policy.apex.context.test.distribution.ContextUpdate;
+import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
+import org.onap.policy.apex.model.basicmodel.handling.ApexModelException;
+import org.slf4j.ext.XLogger;
+import org.slf4j.ext.XLoggerFactory;
+
+public class HazelcastContextDistributorTest {
+ private static final String HAZEL_CAST_PLUGIN_CLASS = HazelcastContextDistributor.class.getCanonicalName();
+ // Logger for this class
+ private static final XLogger logger = XLoggerFactory.getXLogger(HazelcastContextDistributorTest.class);
+
+
+ @Test
+ public void testContextAlbumUpdateHazelcast() throws ApexModelException, IOException, ApexException {
+ logger.debug("Running testContextAlbumUpdateHazelcast test . . .");
+
+ final ContextParameters contextParameters = new ContextParameters();
+ contextParameters.getDistributorParameters().setPluginClass(HAZEL_CAST_PLUGIN_CLASS);
+ new ContextAlbumUpdate().testContextAlbumUpdate();
+
+ logger.debug("Ran testContextAlbumUpdateHazelcast test");
+ }
+
+ @Test
+ public void testContextInstantiationHazelcast() throws ApexModelException, IOException, ApexException {
+ logger.debug("Running testContextInstantiationHazelcast test . . .");
+
+ final ContextParameters contextParameters = new ContextParameters();
+ contextParameters.getDistributorParameters().setPluginClass(HAZEL_CAST_PLUGIN_CLASS);
+ new ContextInstantiation().testContextInstantiation();
+
+ logger.debug("Ran testContextInstantiationHazelcast test");
+ }
+
+ @Test
+ public void testContextUpdateHazelcast() throws ApexModelException, IOException, ApexException {
+ logger.debug("Running testContextUpdateHazelcast test . . .");
+
+ final ContextParameters contextParameters = new ContextParameters();
+ contextParameters.getDistributorParameters().setPluginClass(HAZEL_CAST_PLUGIN_CLASS);
+ new ContextUpdate().testContextUpdate();
+
+ logger.debug("Ran testContextUpdateHazelcast test");
+ }
+
+}