From 3cb682fa71a1749fb99a47d7c8ede2b8984e2c07 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 16 Apr 2019 11:20:08 +0000 Subject: Fix Security and Unit Test DB issues This review removes more links to the Zookeeper version 3.5.4-beta with Zookeeper version 3.4.14. It also replaces the Derby in-memory database with the H2 in memory database for unit tests. Issue-ID: POLICY-1540 Change-Id: Ic44f2e866644114b7c0cf66aac7e528017b8206b Signed-off-by: liamfallon --- examples/examples-aadm/pom.xml | 6 - .../policy/apex/examples/aadm/AadmDbWriteTest.java | 15 - .../policy/apex/examples/aadm/AadmModelTest.java | 15 - .../src/test/resources/META-INF/persistence.xml | 6 +- examples/examples-adaptive/pom.xml | 6 - .../adaptive/AnomalyDetectionDbWriteTest.java | 15 - .../adaptive/AnomalyDetectionModelTest.java | 15 - .../examples/adaptive/AutoLearnDbWriteTest.java | 15 - .../apex/examples/adaptive/AutoLearnModelTest.java | 15 - .../src/test/resources/META-INF/persistence.xml | 6 +- examples/examples-myfirstpolicy/pom.xml | 6 - .../apex/examples/myfirstpolicy/MfpModelTest.java | 20 - .../src/test/resources/META-INF/persistence.xml | 6 +- examples/examples-pcvs/pom.xml | 6 - examples/examples-servlet/pom.xml | 5 - examples/pom.xml | 9 +- .../apex/model/basicmodel/dao/EntityTest.java | 18 - .../handling/SupportApexBasicModelTester.java | 17 +- .../src/test/resources/META-INF/persistence.xml | 6 +- .../handling/ApexContextModelTest.java | 19 +- .../src/test/resources/META-INF/persistence.xml | 6 +- .../enginemodel/handling/ApexEngineModelTest.java | 23 +- .../src/test/resources/META-INF/persistence.xml | 6 +- .../eventmodel/handling/ApexEventModelTest.java | 17 +- .../src/test/resources/META-INF/persistence.xml | 6 +- .../apex/model/modelapi/ApexModelApiTest.java | 12 +- .../src/test/resources/META-INF/persistence.xml | 8 +- .../policymodel/handling/ApexPolicyModelTest.java | 23 +- .../src/test/resources/META-INF/persistence.xml | 6 +- model/pom.xml | 17 +- packages/apex-pdp-package-full/pom.xml | 10 - .../plugins-context-distribution-hazelcast/pom.xml | 6 - .../hazelcast/HazelcastContextDistributorTest.java | 138 ------- .../pom.xml | 6 - .../InfinispanContextDistributorTest.java | 156 -------- .../plugins-event-carrier-restrequestor/pom.xml | 6 - .../jpa/eclipselink/EclipselinkApexDaoTest.java | 16 +- .../entities/ArtifactKeyTestEntity.java | 257 ++++++++++++ .../entities/ReferenceKeyTestEntity.java | 260 ++++++++++++ .../jpa/eclipselink/entities/package-info.java | 24 ++ .../src/test/resources/META-INF/persistence.xml | 4 +- .../plugins-persistence-jpa/pom.xml | 5 - pom.xml | 1 - services/services-engine/pom.xml | 6 - .../test/concepts/TestContextBooleanItem.java | 112 ++++++ .../context/test/concepts/TestContextByteItem.java | 110 ++++++ .../context/test/concepts/TestContextDateItem.java | 242 ++++++++++++ .../test/concepts/TestContextDateLocaleItem.java | 254 ++++++++++++ .../test/concepts/TestContextDateTzItem.java | 193 +++++++++ .../test/concepts/TestContextDoubleItem.java | 113 ++++++ .../test/concepts/TestContextFloatItem.java | 110 ++++++ .../context/test/concepts/TestContextIntItem.java | 119 ++++++ .../context/test/concepts/TestContextLongItem.java | 111 ++++++ .../test/concepts/TestContextLongObjectItem.java | 117 ++++++ .../test/concepts/TestContextStringItem.java | 117 ++++++ .../test/concepts/TestContextTreeMapItem.java | 123 ++++++ .../test/concepts/TestContextTreeSetItem.java | 133 +++++++ .../test/concepts/TestExternalContextItem.java | 435 +++++++++++++++++++++ .../test/concepts/TestGlobalContextItem.java | 435 +++++++++++++++++++++ .../test/concepts/TestPolicyContextItem.java | 242 ++++++++++++ .../apex/context/test/concepts/package-info.java | 28 ++ .../integration/integration-context-test/pom.xml | 6 + .../integration/context/TestConcurrentContext.java | 2 +- .../context/concepts/TestContextBooleanItem.java | 112 ------ .../context/concepts/TestContextByteItem.java | 110 ------ .../context/concepts/TestContextDateItem.java | 242 ------------ .../concepts/TestContextDateLocaleItem.java | 254 ------------ .../context/concepts/TestContextDateTzItem.java | 193 --------- .../context/concepts/TestContextDoubleItem.java | 113 ------ .../context/concepts/TestContextFloatItem.java | 110 ------ .../context/concepts/TestContextIntItem.java | 119 ------ .../context/concepts/TestContextLongItem.java | 111 ------ .../concepts/TestContextLongObjectItem.java | 117 ------ .../context/concepts/TestContextStringItem.java | 117 ------ .../context/concepts/TestContextTreeMapItem.java | 123 ------ .../context/concepts/TestContextTreeSetItem.java | 133 ------- .../context/concepts/TestExternalContextItem.java | 435 --------------------- .../context/concepts/TestGlobalContextItem.java | 435 --------------------- .../context/concepts/TestPolicyContextItem.java | 242 ------------ .../integration/context/concepts/package-info.java | 28 -- .../context/distribution/ContextInstantiation.java | 32 +- .../context/distribution/ContextUpdate.java | 6 +- .../HazelcastContextDistributorTest.java | 136 +++++++ .../InfinispanContextDistributorTest.java | 154 ++++++++ .../SequentialContextInstantiation.java | 22 +- .../context/factory/TestContextAlbumFactory.java | 12 +- .../context/lock/modifier/NoLockAlbumModifier.java | 2 +- .../lock/modifier/ReadLockAlbumModifier.java | 2 +- .../SingleValueWriteLockAlbumModifier.java | 2 +- .../lock/modifier/WriteLockAlbumModifier.java | 2 +- .../context/locking/ConcurrentContext.java | 2 +- .../context/utils/ConfigrationProviderImpl.java | 2 +- .../integration/context/utils/Constants.java | 2 +- .../integration/integration-executor-test/pom.xml | 12 - .../handling/TestApexSamplePolicyDbWrite.java | 22 +- .../handling/TestApexSamplePolicyModel.java | 24 +- .../src/test/resources/META-INF/persistence.xml | 6 +- .../integration/integration-uservice-test/pom.xml | 6 - testsuites/integration/pom.xml | 8 + .../performance/performance-benchmark-test/pom.xml | 6 - 100 files changed, 3959 insertions(+), 3742 deletions(-) delete mode 100644 plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-hazelcast/src/test/java/org/onap/policy/apex/plugins/context/distribution/hazelcast/HazelcastContextDistributorTest.java delete mode 100644 plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-infinispan/src/test/java/org/onap/policy/apex/plugins/context/distribution/infinispan/InfinispanContextDistributorTest.java create mode 100644 plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/ArtifactKeyTestEntity.java create mode 100644 plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/ReferenceKeyTestEntity.java create mode 100644 plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/package-info.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextBooleanItem.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextByteItem.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateItem.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateLocaleItem.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateTzItem.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDoubleItem.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextFloatItem.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextIntItem.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextLongItem.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextLongObjectItem.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextStringItem.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextTreeMapItem.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextTreeSetItem.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestExternalContextItem.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestGlobalContextItem.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestPolicyContextItem.java create mode 100644 testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/package-info.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextBooleanItem.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextByteItem.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDateItem.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDateLocaleItem.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDateTzItem.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDoubleItem.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextFloatItem.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextIntItem.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextLongItem.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextLongObjectItem.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextStringItem.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextTreeMapItem.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextTreeSetItem.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestExternalContextItem.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestGlobalContextItem.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestPolicyContextItem.java delete mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/package-info.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/HazelcastContextDistributorTest.java create mode 100644 testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/InfinispanContextDistributorTest.java diff --git a/examples/examples-aadm/pom.xml b/examples/examples-aadm/pom.xml index d1a8223b5..f478119f8 100644 --- a/examples/examples-aadm/pom.xml +++ b/examples/examples-aadm/pom.xml @@ -53,12 +53,6 @@ ${project.version} test - - org.apache.derby - derby - ${version.derby} - test - diff --git a/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/AadmDbWriteTest.java b/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/AadmDbWriteTest.java index 1cc379938..58987533a 100644 --- a/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/AadmDbWriteTest.java +++ b/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/AadmDbWriteTest.java @@ -20,11 +20,6 @@ package org.onap.policy.apex.examples.aadm; -import java.io.File; -import java.sql.Connection; -import java.sql.DriverManager; - -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.dao.DaoParameters; @@ -32,7 +27,6 @@ import org.onap.policy.apex.model.basicmodel.test.TestApexModel; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; public class AadmDbWriteTest { - private Connection connection; TestApexModel testApexModel; /** @@ -41,18 +35,9 @@ public class AadmDbWriteTest { */ @Before public void setup() throws Exception { - Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); - connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); - testApexModel = new TestApexModel(AxPolicyModel.class, new TestAadmModelCreator()); } - @After - public void teardown() throws Exception { - connection.close(); - new File("derby.log").delete(); - } - @Test public void testModelWriteReadJpa() throws Exception { final DaoParameters DaoParameters = new DaoParameters(); diff --git a/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/AadmModelTest.java b/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/AadmModelTest.java index b0aa23949..a44a4cc1a 100644 --- a/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/AadmModelTest.java +++ b/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/AadmModelTest.java @@ -22,11 +22,6 @@ package org.onap.policy.apex.examples.aadm; import static org.junit.Assert.assertTrue; -import java.io.File; -import java.sql.Connection; -import java.sql.DriverManager; - -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; @@ -35,7 +30,6 @@ import org.onap.policy.apex.model.basicmodel.test.TestApexModel; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; public class AadmModelTest { - private Connection connection; TestApexModel testApexModel; /** @@ -44,18 +38,9 @@ public class AadmModelTest { */ @Before public void setup() throws Exception { - Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); - connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); - testApexModel = new TestApexModel(AxPolicyModel.class, new TestAadmModelCreator()); } - @After - public void teardown() throws Exception { - connection.close(); - new File("derby.log").delete(); - } - @Test public void testModelValid() throws Exception { final AxValidationResult result = testApexModel.testApexModelValid(); diff --git a/examples/examples-aadm/src/test/resources/META-INF/persistence.xml b/examples/examples-aadm/src/test/resources/META-INF/persistence.xml index eb28ad809..10a720dd7 100644 --- a/examples/examples-aadm/src/test/resources/META-INF/persistence.xml +++ b/examples/examples-aadm/src/test/resources/META-INF/persistence.xml @@ -57,10 +57,8 @@ org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel - - - - + + diff --git a/examples/examples-adaptive/pom.xml b/examples/examples-adaptive/pom.xml index 1104ca932..cff709239 100644 --- a/examples/examples-adaptive/pom.xml +++ b/examples/examples-adaptive/pom.xml @@ -63,12 +63,6 @@ commons-math3 3.2 - - org.apache.derby - derby - ${version.derby} - test - diff --git a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionDbWriteTest.java b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionDbWriteTest.java index 885704497..3004bccb3 100644 --- a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionDbWriteTest.java +++ b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionDbWriteTest.java @@ -20,11 +20,6 @@ package org.onap.policy.apex.examples.adaptive; -import java.io.File; -import java.sql.Connection; -import java.sql.DriverManager; - -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.dao.DaoParameters; @@ -32,7 +27,6 @@ import org.onap.policy.apex.model.basicmodel.test.TestApexModel; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; public class AnomalyDetectionDbWriteTest { - private Connection connection; TestApexModel testApexModel; /** @@ -41,18 +35,9 @@ public class AnomalyDetectionDbWriteTest { */ @Before public void setup() throws Exception { - Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); - connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); - testApexModel = new TestApexModel<>(AxPolicyModel.class, new TestAnomalyDetectionModelCreator()); } - @After - public void teardown() throws Exception { - connection.close(); - new File("derby.log").delete(); - } - @Test public void testModelWriteReadJpa() throws Exception { final DaoParameters DaoParameters = new DaoParameters(); diff --git a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionModelTest.java b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionModelTest.java index 552ca2f37..5a36d4070 100644 --- a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionModelTest.java +++ b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AnomalyDetectionModelTest.java @@ -22,11 +22,6 @@ package org.onap.policy.apex.examples.adaptive; import static org.junit.Assert.assertTrue; -import java.io.File; -import java.sql.Connection; -import java.sql.DriverManager; - -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; @@ -35,7 +30,6 @@ import org.onap.policy.apex.model.basicmodel.test.TestApexModel; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; public class AnomalyDetectionModelTest { - private Connection connection; TestApexModel testApexModel; /** @@ -44,18 +38,9 @@ public class AnomalyDetectionModelTest { */ @Before public void setup() throws Exception { - Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); - connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); - testApexModel = new TestApexModel<>(AxPolicyModel.class, new TestAnomalyDetectionModelCreator()); } - @After - public void teardown() throws Exception { - connection.close(); - new File("derby.log").delete(); - } - @Test public void testModelValid() throws Exception { final AxValidationResult result = testApexModel.testApexModelValid(); diff --git a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AutoLearnDbWriteTest.java b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AutoLearnDbWriteTest.java index 828a56133..b72514f49 100644 --- a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AutoLearnDbWriteTest.java +++ b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AutoLearnDbWriteTest.java @@ -20,11 +20,6 @@ package org.onap.policy.apex.examples.adaptive; -import java.io.File; -import java.sql.Connection; -import java.sql.DriverManager; - -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.dao.DaoParameters; @@ -32,7 +27,6 @@ import org.onap.policy.apex.model.basicmodel.test.TestApexModel; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; public class AutoLearnDbWriteTest { - private Connection connection; TestApexModel testApexModel; /** @@ -41,18 +35,9 @@ public class AutoLearnDbWriteTest { */ @Before public void setup() throws Exception { - Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); - connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); - testApexModel = new TestApexModel<>(AxPolicyModel.class, new TestAutoLearnModelCreator()); } - @After - public void teardown() throws Exception { - connection.close(); - new File("derby.log").delete(); - } - @Test public void testModelWriteReadJpa() throws Exception { final DaoParameters DaoParameters = new DaoParameters(); diff --git a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AutoLearnModelTest.java b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AutoLearnModelTest.java index f4cddc580..1823f9871 100644 --- a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AutoLearnModelTest.java +++ b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/AutoLearnModelTest.java @@ -22,11 +22,6 @@ package org.onap.policy.apex.examples.adaptive; import static org.junit.Assert.assertTrue; -import java.io.File; -import java.sql.Connection; -import java.sql.DriverManager; - -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; @@ -35,7 +30,6 @@ import org.onap.policy.apex.model.basicmodel.test.TestApexModel; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; public class AutoLearnModelTest { - private Connection connection; TestApexModel testApexModel; /** @@ -44,18 +38,9 @@ public class AutoLearnModelTest { */ @Before public void setup() throws Exception { - Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); - connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); - testApexModel = new TestApexModel<>(AxPolicyModel.class, new TestAutoLearnModelCreator()); } - @After - public void teardown() throws Exception { - connection.close(); - new File("derby.log").delete(); - } - @Test public void testModelValid() throws Exception { final AxValidationResult result = testApexModel.testApexModelValid(); diff --git a/examples/examples-adaptive/src/test/resources/META-INF/persistence.xml b/examples/examples-adaptive/src/test/resources/META-INF/persistence.xml index 4dcd879b6..1e70abc6d 100644 --- a/examples/examples-adaptive/src/test/resources/META-INF/persistence.xml +++ b/examples/examples-adaptive/src/test/resources/META-INF/persistence.xml @@ -57,10 +57,8 @@ org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel - - - - + + diff --git a/examples/examples-myfirstpolicy/pom.xml b/examples/examples-myfirstpolicy/pom.xml index 8ce34c027..e56a5b12b 100644 --- a/examples/examples-myfirstpolicy/pom.xml +++ b/examples/examples-myfirstpolicy/pom.xml @@ -69,12 +69,6 @@ ${project.version} test - - org.apache.derby - derby - ${version.derby} - test - diff --git a/examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/MfpModelTest.java b/examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/MfpModelTest.java index d6ec2bb8d..1bd67f961 100644 --- a/examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/MfpModelTest.java +++ b/examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/MfpModelTest.java @@ -22,11 +22,6 @@ package org.onap.policy.apex.examples.myfirstpolicy; import static org.junit.Assert.assertTrue; -import java.io.File; -import java.sql.Connection; -import java.sql.DriverManager; - -import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; @@ -39,8 +34,6 @@ import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; * @author John Keeney (john.keeney@ericsson.com) */ public class MfpModelTest { - - private static Connection connection; private static TestApexModel testApexModel1; private static TestApexModel testApexModel2; @@ -51,23 +44,10 @@ public class MfpModelTest { */ @BeforeClass public static void setup() throws Exception { - Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); - connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); testApexModel1 = new TestApexModel<>(AxPolicyModel.class, new TestMfpModelCreator.TestMfp1ModelCreator()); testApexModel2 = new TestApexModel<>(AxPolicyModel.class, new TestMfpModelCreator.TestMfp2ModelCreator()); } - /** - * Teardown. - * - * @throws Exception if there is an error - */ - @AfterClass - public static void teardown() throws Exception { - connection.close(); - new File("derby.log").delete(); - } - /** * Test model is valid. * diff --git a/examples/examples-myfirstpolicy/src/test/resources/META-INF/persistence.xml b/examples/examples-myfirstpolicy/src/test/resources/META-INF/persistence.xml index 7acc7a0e9..909f413eb 100644 --- a/examples/examples-myfirstpolicy/src/test/resources/META-INF/persistence.xml +++ b/examples/examples-myfirstpolicy/src/test/resources/META-INF/persistence.xml @@ -57,10 +57,8 @@ org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel - - - - + + diff --git a/examples/examples-pcvs/pom.xml b/examples/examples-pcvs/pom.xml index 5cc65e6a1..7b5b92c77 100644 --- a/examples/examples-pcvs/pom.xml +++ b/examples/examples-pcvs/pom.xml @@ -71,12 +71,6 @@ ${project.version} test - - org.apache.derby - derby - ${version.derby} - test - diff --git a/examples/examples-servlet/pom.xml b/examples/examples-servlet/pom.xml index d1bd0a28c..fcf773022 100644 --- a/examples/examples-servlet/pom.xml +++ b/examples/examples-servlet/pom.xml @@ -55,11 +55,6 @@ plugins-executor-javascript ${project.version} - - org.onap.policy.apex-pdp.context - context-test-utils - ${project.version} - org.onap.policy.apex-pdp.testsuites.integration integration-common diff --git a/examples/pom.xml b/examples/pom.xml index a8dca24b2..acba94098 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -32,7 +32,6 @@ ${project.artifactId} Specific source code and other artifacts for Apex example applications. - examples-myfirstpolicy examples-aadm @@ -44,6 +43,14 @@ examples-servlet + + + com.h2database + h2 + test + + + apexSite diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/dao/EntityTest.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/dao/EntityTest.java index 0258b9305..36b18d783 100644 --- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/dao/EntityTest.java +++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/dao/EntityTest.java @@ -26,17 +26,12 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import java.io.File; -import java.sql.Connection; -import java.sql.DriverManager; import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.TreeSet; import java.util.UUID; -import org.junit.After; -import org.junit.Before; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.ApexException; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; @@ -48,21 +43,8 @@ import org.onap.policy.apex.model.basicmodel.concepts.DummyEntity; * JUnit test class. */ public class EntityTest { - private Connection connection; private ApexDao apexDao; - @Before - public void setup() throws Exception { - Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); - connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); - } - - @After - public void teardown() throws Exception { - connection.close(); - new File("derby.log").delete(); - } - @Test public void testEntityTestSanity() throws ApexException { final DaoParameters daoParameters = new DaoParameters(); diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/SupportApexBasicModelTester.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/SupportApexBasicModelTester.java index a89be5477..375d15ae8 100644 --- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/SupportApexBasicModelTester.java +++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/SupportApexBasicModelTester.java @@ -23,11 +23,6 @@ package org.onap.policy.apex.model.basicmodel.handling; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import java.io.File; -import java.sql.Connection; -import java.sql.DriverManager; - -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.ApexException; @@ -37,28 +32,18 @@ import org.onap.policy.apex.model.basicmodel.dao.DaoParameters; import org.onap.policy.apex.model.basicmodel.test.TestApexModel; public class SupportApexBasicModelTester { - private Connection connection; TestApexModel testApexModel; /** * Set up the test. - * + * * @throws Exception any exception thrown by the test */ @Before public void setup() throws Exception { - Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); - connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); - testApexModel = new TestApexModel(AxModel.class, new DummyApexBasicModelCreator()); } - @After - public void teardown() throws Exception { - connection.close(); - new File("derby.log").delete(); - } - @Test public void testModelValid() throws Exception { final AxValidationResult result = testApexModel.testApexModelValid(); diff --git a/model/basic-model/src/test/resources/META-INF/persistence.xml b/model/basic-model/src/test/resources/META-INF/persistence.xml index 68f03e8e5..01a8989bb 100644 --- a/model/basic-model/src/test/resources/META-INF/persistence.xml +++ b/model/basic-model/src/test/resources/META-INF/persistence.xml @@ -33,10 +33,8 @@ org.onap.policy.apex.model.basicmodel.concepts.DummyEntity - - - - + + diff --git a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/handling/ApexContextModelTest.java b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/handling/ApexContextModelTest.java index 948c2024c..f41c39fd2 100644 --- a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/handling/ApexContextModelTest.java +++ b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/handling/ApexContextModelTest.java @@ -22,11 +22,6 @@ package org.onap.policy.apex.model.contextmodel.handling; import static org.junit.Assert.assertTrue; -import java.io.File; -import java.sql.Connection; -import java.sql.DriverManager; - -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; @@ -36,33 +31,23 @@ import org.onap.policy.apex.model.contextmodel.concepts.AxContextModel; /** * Apex context model tests. - * + * * @author liam * */ public class ApexContextModelTest { - private Connection connection; TestApexModel testApexModel; /** * Set up tests. - * + * * @throws Exception a testing exception */ @Before public void setup() throws Exception { - Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); - connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); - testApexModel = new TestApexModel(AxContextModel.class, new TestApexContextModelCreator()); } - @After - public void teardown() throws Exception { - connection.close(); - new File("derby.log").delete(); - } - @Test public void testModelValid() throws Exception { final AxValidationResult result = testApexModel.testApexModelValid(); diff --git a/model/context-model/src/test/resources/META-INF/persistence.xml b/model/context-model/src/test/resources/META-INF/persistence.xml index b7911caa2..b4ba68a38 100644 --- a/model/context-model/src/test/resources/META-INF/persistence.xml +++ b/model/context-model/src/test/resources/META-INF/persistence.xml @@ -38,10 +38,8 @@ org.onap.policy.apex.model.contextmodel.concepts.AxContextModel - - - - + + diff --git a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/ApexEngineModelTest.java b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/ApexEngineModelTest.java index d0b8f3e78..770c29a93 100644 --- a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/ApexEngineModelTest.java +++ b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/ApexEngineModelTest.java @@ -5,15 +5,15 @@ * 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========================================================= */ @@ -22,11 +22,6 @@ package org.onap.policy.apex.model.enginemodel.handling; import static org.junit.Assert.assertTrue; -import java.io.File; -import java.sql.Connection; -import java.sql.DriverManager; - -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; @@ -35,28 +30,18 @@ import org.onap.policy.apex.model.basicmodel.test.TestApexModel; import org.onap.policy.apex.model.enginemodel.concepts.AxEngineModel; public class ApexEngineModelTest { - private Connection connection; TestApexModel testApexModel; /** * Set up the test. - * + * * @throws Exception errors from test setup */ @Before public void setup() throws Exception { - Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); - connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); - testApexModel = new TestApexModel(AxEngineModel.class, new DummyTestApexEngineModelCreator()); } - @After - public void teardown() throws Exception { - connection.close(); - new File("derby.log").delete(); - } - @Test public void testModelValid() throws Exception { final AxValidationResult result = testApexModel.testApexModelValid(); diff --git a/model/engine-model/src/test/resources/META-INF/persistence.xml b/model/engine-model/src/test/resources/META-INF/persistence.xml index a157cf34f..42048d85d 100644 --- a/model/engine-model/src/test/resources/META-INF/persistence.xml +++ b/model/engine-model/src/test/resources/META-INF/persistence.xml @@ -59,10 +59,8 @@ org.onap.policy.apex.model.enginemodel.concepts.AxEngineStats - - - - + + diff --git a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/handling/ApexEventModelTest.java b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/handling/ApexEventModelTest.java index 88736d1f0..db752a61b 100644 --- a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/handling/ApexEventModelTest.java +++ b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/handling/ApexEventModelTest.java @@ -22,11 +22,6 @@ package org.onap.policy.apex.model.eventmodel.handling; import static org.junit.Assert.assertTrue; -import java.io.File; -import java.sql.Connection; -import java.sql.DriverManager; - -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; @@ -35,28 +30,18 @@ import org.onap.policy.apex.model.basicmodel.test.TestApexModel; import org.onap.policy.apex.model.eventmodel.concepts.AxEventModel; public class ApexEventModelTest { - private Connection connection; TestApexModel testApexModel; /** * Set up the test. - * + * * @throws Exception exceptions from the test */ @Before public void setup() throws Exception { - Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); - connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); - testApexModel = new TestApexModel(AxEventModel.class, new DummyTestApexEventModelCreator()); } - @After - public void teardown() throws Exception { - connection.close(); - new File("derby.log").delete(); - } - @Test public void testModelValid() throws Exception { final AxValidationResult result = testApexModel.testApexModelValid(); diff --git a/model/event-model/src/test/resources/META-INF/persistence.xml b/model/event-model/src/test/resources/META-INF/persistence.xml index 9e61cbd73..0184cada6 100644 --- a/model/event-model/src/test/resources/META-INF/persistence.xml +++ b/model/event-model/src/test/resources/META-INF/persistence.xml @@ -44,10 +44,8 @@ org.onap.policy.apex.model.eventmodel.concepts.AxEventModel - - - - + + diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexModelApiTest.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexModelApiTest.java index 462b1cd8b..df5e54ca9 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexModelApiTest.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexModelApiTest.java @@ -5,15 +5,15 @@ * 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========================================================= */ @@ -48,14 +48,14 @@ public class ApexModelApiTest { @Before public void setup() throws Exception { - Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); - connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); + // Hold the h2 database up for entire tests + connection = DriverManager.getConnection("jdbc:h2:mem:testdb"); } @After public void teardown() throws Exception { + // Close the h2 database after tests connection.close(); - new File("derby.log").delete(); } @Test diff --git a/model/model-api/src/test/resources/META-INF/persistence.xml b/model/model-api/src/test/resources/META-INF/persistence.xml index f834e0f49..2603d5496 100644 --- a/model/model-api/src/test/resources/META-INF/persistence.xml +++ b/model/model-api/src/test/resources/META-INF/persistence.xml @@ -57,11 +57,9 @@ org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel - - - - - + + + diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/handling/ApexPolicyModelTest.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/handling/ApexPolicyModelTest.java index 7a240e18b..a521272ae 100644 --- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/handling/ApexPolicyModelTest.java +++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/handling/ApexPolicyModelTest.java @@ -5,15 +5,15 @@ * 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========================================================= */ @@ -23,11 +23,6 @@ package org.onap.policy.apex.model.policymodel.handling; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import java.io.File; -import java.sql.Connection; -import java.sql.DriverManager; - -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; @@ -36,28 +31,18 @@ import org.onap.policy.apex.model.basicmodel.test.TestApexModel; import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; public class ApexPolicyModelTest { - private Connection connection; TestApexModel testApexModel; /** * Set up the policy model tests. - * + * * @throws Exception on setup errors */ @Before public void setup() throws Exception { - Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); - connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); - testApexModel = new TestApexModel(AxPolicyModel.class, new SupportApexPolicyModelCreator()); } - @After - public void teardown() throws Exception { - connection.close(); - new File("derby.log").delete(); - } - @Test public void testModelValid() throws Exception { final AxValidationResult result = testApexModel.testApexModelValid(); diff --git a/model/policy-model/src/test/resources/META-INF/persistence.xml b/model/policy-model/src/test/resources/META-INF/persistence.xml index cd9a420d0..0eee729a1 100644 --- a/model/policy-model/src/test/resources/META-INF/persistence.xml +++ b/model/policy-model/src/test/resources/META-INF/persistence.xml @@ -57,10 +57,8 @@ org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel - - - - + + diff --git a/model/pom.xml b/model/pom.xml index 187a043da..2ff6aa110 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -32,15 +32,6 @@ ${project.artifactId} The model for Apex, it comtains definitions of all Apex concepts and also has handling for Apex models. - - - org.apache.derby - derby - ${version.derby} - test - - - utilities basic-model @@ -51,6 +42,14 @@ model-api + + + com.h2database + h2 + test + + + apexSite diff --git a/packages/apex-pdp-package-full/pom.xml b/packages/apex-pdp-package-full/pom.xml index 078088bad..4897cbe8d 100644 --- a/packages/apex-pdp-package-full/pom.xml +++ b/packages/apex-pdp-package-full/pom.xml @@ -135,11 +135,6 @@ plugins-persistence-jpa-eclipselink ${project.version} - - org.onap.policy.apex-pdp.plugins.plugins-persistence.plugins-persistence-jpa - plugins-persistence-jpa-hibernate - ${project.version} - @@ -212,11 +207,6 @@ - - org.onap.policy.apex-pdp.context - context-test-utils - ${project.version} - org.onap.policy.apex-pdp.testsuites.integration integration-common diff --git a/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-hazelcast/pom.xml b/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-hazelcast/pom.xml index 28b822553..582ef1c71 100644 --- a/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-hazelcast/pom.xml +++ b/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-hazelcast/pom.xml @@ -35,12 +35,6 @@ hazelcast ${version.hazelcast} - - org.onap.policy.apex-pdp.context - context-test-utils - ${project.version} - test - diff --git a/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-hazelcast/src/test/java/org/onap/policy/apex/plugins/context/distribution/hazelcast/HazelcastContextDistributorTest.java b/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-hazelcast/src/test/java/org/onap/policy/apex/plugins/context/distribution/hazelcast/HazelcastContextDistributorTest.java deleted file mode 100644 index 9d7f003ee..000000000 --- a/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-hazelcast/src/test/java/org/onap/policy/apex/plugins/context/distribution/hazelcast/HazelcastContextDistributorTest.java +++ /dev/null @@ -1,138 +0,0 @@ -/*- - * ============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.After; -import org.junit.Before; -import org.junit.Test; -import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters; -import org.onap.policy.apex.context.parameters.ContextParameterConstants; -import org.onap.policy.apex.context.parameters.ContextParameters; -import org.onap.policy.apex.context.parameters.SchemaParameters; -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.onap.policy.common.parameters.ParameterService; -import org.slf4j.ext.XLogger; -import org.slf4j.ext.XLoggerFactory; - -/** - * The Class HazelcastContextDistributorTest. - */ -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); - - private SchemaParameters schemaParameters; - private ContextParameters contextParameters; - - /** - * Before test. - */ - @Before - public void beforeTest() { - contextParameters = new ContextParameters(); - - contextParameters.setName(ContextParameterConstants.MAIN_GROUP_NAME); - contextParameters.getDistributorParameters().setName(ContextParameterConstants.DISTRIBUTOR_GROUP_NAME); - contextParameters.getLockManagerParameters().setName(ContextParameterConstants.LOCKING_GROUP_NAME); - contextParameters.getPersistorParameters().setName(ContextParameterConstants.PERSISTENCE_GROUP_NAME); - - contextParameters.getDistributorParameters().setPluginClass(HAZEL_CAST_PLUGIN_CLASS); - - ParameterService.register(contextParameters); - ParameterService.register(contextParameters.getDistributorParameters()); - ParameterService.register(contextParameters.getLockManagerParameters()); - ParameterService.register(contextParameters.getPersistorParameters()); - - schemaParameters = new SchemaParameters(); - schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME); - schemaParameters.getSchemaHelperParameterMap().put("JAVA", new JavaSchemaHelperParameters()); - - ParameterService.register(schemaParameters); - } - - /** - * After test. - */ - @After - public void afterTest() { - ParameterService.deregister(schemaParameters); - - ParameterService.deregister(contextParameters.getDistributorParameters()); - ParameterService.deregister(contextParameters.getLockManagerParameters()); - ParameterService.deregister(contextParameters.getPersistorParameters()); - ParameterService.deregister(contextParameters); - } - - /** - * Test context album update hazelcast. - * - * @throws ApexModelException the apex model exception - * @throws IOException Signals that an I/O exception has occurred. - * @throws ApexException the apex exception - */ - @Test - public void testContextAlbumUpdateHazelcast() throws ApexModelException, IOException, ApexException { - logger.debug("Running testContextAlbumUpdateHazelcast test . . ."); - - new ContextAlbumUpdate().testContextAlbumUpdate(); - - logger.debug("Ran testContextAlbumUpdateHazelcast test"); - } - - /** - * Test context instantiation hazelcast. - * - * @throws ApexModelException the apex model exception - * @throws IOException Signals that an I/O exception has occurred. - * @throws ApexException the apex exception - */ - @Test - public void testContextInstantiationHazelcast() throws ApexModelException, IOException, ApexException { - logger.debug("Running testContextInstantiationHazelcast test . . ."); - - new ContextInstantiation().testContextInstantiation(); - - logger.debug("Ran testContextInstantiationHazelcast test"); - } - - /** - * Test context update hazelcast. - * - * @throws ApexModelException the apex model exception - * @throws IOException Signals that an I/O exception has occurred. - * @throws ApexException the apex exception - */ - @Test - public void testContextUpdateHazelcast() throws ApexModelException, IOException, ApexException { - logger.debug("Running testContextUpdateHazelcast test . . ."); - - new ContextUpdate().testContextUpdate(); - - logger.debug("Ran testContextUpdateHazelcast test"); - } -} diff --git a/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-infinispan/pom.xml b/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-infinispan/pom.xml index 5cfdc2e18..b01b955c4 100644 --- a/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-infinispan/pom.xml +++ b/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-infinispan/pom.xml @@ -41,12 +41,6 @@ - - org.onap.policy.apex-pdp.context - context-test-utils - ${project.version} - test - diff --git a/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-infinispan/src/test/java/org/onap/policy/apex/plugins/context/distribution/infinispan/InfinispanContextDistributorTest.java b/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-infinispan/src/test/java/org/onap/policy/apex/plugins/context/distribution/infinispan/InfinispanContextDistributorTest.java deleted file mode 100644 index 3da1cf509..000000000 --- a/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-infinispan/src/test/java/org/onap/policy/apex/plugins/context/distribution/infinispan/InfinispanContextDistributorTest.java +++ /dev/null @@ -1,156 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 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.infinispan; - -import java.io.IOException; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters; -import org.onap.policy.apex.context.parameters.ContextParameterConstants; -import org.onap.policy.apex.context.parameters.ContextParameters; -import org.onap.policy.apex.context.parameters.SchemaParameters; -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.context.test.distribution.SequentialContextInstantiation; -import org.onap.policy.apex.model.basicmodel.concepts.ApexException; -import org.onap.policy.apex.model.basicmodel.handling.ApexModelException; -import org.onap.policy.common.parameters.ParameterService; -import org.slf4j.ext.XLogger; -import org.slf4j.ext.XLoggerFactory; - -/** - * The Class InfinispanContextDistributorTest. - */ -public class InfinispanContextDistributorTest { - private static final XLogger logger = XLoggerFactory.getXLogger(InfinispanContextDistributorTest.class); - - private static final String PLUGIN_CLASS = InfinispanContextDistributor.class.getCanonicalName(); - - private SchemaParameters schemaParameters; - private ContextParameters contextParameters; - - /** - * Before test. - */ - @Before - public void beforeTest() { - contextParameters = new ContextParameters(); - - contextParameters.setName(ContextParameterConstants.MAIN_GROUP_NAME); - InfinispanDistributorParameters inifinispanDistributorParameters = new InfinispanDistributorParameters(); - inifinispanDistributorParameters.setName(ContextParameterConstants.DISTRIBUTOR_GROUP_NAME); - inifinispanDistributorParameters.setPluginClass(PLUGIN_CLASS); - contextParameters.setDistributorParameters(inifinispanDistributorParameters); - contextParameters.getLockManagerParameters().setName(ContextParameterConstants.LOCKING_GROUP_NAME); - contextParameters.getPersistorParameters().setName(ContextParameterConstants.PERSISTENCE_GROUP_NAME); - - ParameterService.register(contextParameters); - ParameterService.register(contextParameters.getDistributorParameters()); - ParameterService.register(contextParameters.getLockManagerParameters()); - ParameterService.register(contextParameters.getPersistorParameters()); - - schemaParameters = new SchemaParameters(); - schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME); - schemaParameters.getSchemaHelperParameterMap().put("JAVA", new JavaSchemaHelperParameters()); - - ParameterService.register(schemaParameters); - } - - /** - * After test. - */ - @After - public void afterTest() { - ParameterService.deregister(schemaParameters); - - ParameterService.deregister(contextParameters.getDistributorParameters()); - ParameterService.deregister(contextParameters.getLockManagerParameters()); - ParameterService.deregister(contextParameters.getPersistorParameters()); - ParameterService.deregister(contextParameters); - } - - /** - * Test context album update infinispan. - * - * @throws ApexModelException the apex model exception - * @throws IOException Signals that an I/O exception has occurred. - * @throws ApexException the apex exception - */ - @Test - public void testContextAlbumUpdateInfinispan() throws ApexModelException, IOException, ApexException { - logger.debug("Running testContextAlbumUpdateInfinispan test . . ."); - - new ContextAlbumUpdate().testContextAlbumUpdate(); - - logger.debug("Ran testContextAlbumUpdateInfinispan test"); - } - - /** - * Test context instantiation infinispan. - * - * @throws ApexModelException the apex model exception - * @throws IOException Signals that an I/O exception has occurred. - * @throws ApexException the apex exception - */ - @Test - public void testContextInstantiationInfinispan() throws ApexModelException, IOException, ApexException { - logger.debug("Running testContextInstantiationInfinispan test . . ."); - - new ContextInstantiation().testContextInstantiation(); - - logger.debug("Ran testContextInstantiationInfinispan test"); - } - - /** - * Test context update infinispan. - * - * @throws ApexModelException the apex model exception - * @throws IOException Signals that an I/O exception has occurred. - * @throws ApexException the apex exception - */ - @Test - public void testContextUpdateInfinispan() throws ApexModelException, IOException, ApexException { - logger.debug("Running testContextUpdateInfinispan test . . ."); - - new ContextUpdate().testContextUpdate(); - - logger.debug("Ran testContextUpdateInfinispan test"); - } - - /** - * Test sequential context instantiation infinispan. - * - * @throws ApexModelException the apex model exception - * @throws IOException Signals that an I/O exception has occurred. - * @throws ApexException the apex exception - */ - @Test - public void testSequentialContextInstantiationInfinispan() throws ApexModelException, IOException, ApexException { - logger.debug("Running testSequentialContextInstantiationInfinispan test . . ."); - - new SequentialContextInstantiation().testSequentialContextInstantiation(); - - logger.debug("Ran testSequentialContextInstantiationInfinispan test"); - } -} diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/pom.xml b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/pom.xml index 0459cd75c..6aa42291f 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/pom.xml +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/pom.xml @@ -52,12 +52,6 @@ ${project.version} test - - org.onap.policy.apex-pdp.context - context-test-utils - ${project.version} - test - org.glassfish.jersey.inject jersey-hk2 diff --git a/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/EclipselinkApexDaoTest.java b/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/EclipselinkApexDaoTest.java index 21b58f878..311af8257 100644 --- a/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/EclipselinkApexDaoTest.java +++ b/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/EclipselinkApexDaoTest.java @@ -5,15 +5,15 @@ * 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========================================================= */ @@ -32,16 +32,16 @@ import java.util.List; import org.junit.After; import org.junit.Before; import org.junit.Test; -import org.onap.policy.apex.context.test.entities.ArtifactKeyTestEntity; -import org.onap.policy.apex.context.test.entities.ReferenceKeyTestEntity; import org.onap.policy.apex.model.basicmodel.concepts.ApexException; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey; import org.onap.policy.apex.model.basicmodel.dao.DaoParameters; +import org.onap.policy.apex.plugins.persistence.jpa.eclipselink.entities.ArtifactKeyTestEntity; +import org.onap.policy.apex.plugins.persistence.jpa.eclipselink.entities.ReferenceKeyTestEntity; /** * Junit tests for class EclipselinkApexDao. - * + * * @author Dinh Danh Le (dinh.danh.le@ericsson.com) * */ @@ -57,7 +57,7 @@ public class EclipselinkApexDaoTest { /** * Setup the tests. - * + * * @throws ApexException Exceptions from test setup */ @Before @@ -192,7 +192,7 @@ public class EclipselinkApexDaoTest { new AxReferenceKey(owner0Key, "Entity02"), new AxReferenceKey(owner0Key, "Entity03") }); - + // prepare 2 more AxReferenceKeys corresponding to owner1Key final AxReferenceKey refKey11 = new AxReferenceKey(owner1Key, "Entity11"); final AxReferenceKey refKey12 = new AxReferenceKey(owner1Key, "Entity12"); diff --git a/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/ArtifactKeyTestEntity.java b/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/ArtifactKeyTestEntity.java new file mode 100644 index 000000000..cd0d7d16d --- /dev/null +++ b/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/ArtifactKeyTestEntity.java @@ -0,0 +1,257 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.persistence.jpa.eclipselink.entities; + +import java.util.Arrays; +import java.util.List; + +import javax.persistence.EmbeddedId; +import javax.persistence.Entity; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlElement; + +import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; +import org.onap.policy.apex.model.basicmodel.concepts.AxConcept; +import org.onap.policy.apex.model.basicmodel.concepts.AxKey; +import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; + +/** + * The Class ArtifactKeyTestEntity is an entity for testing artifact keys. + */ +@Entity +@Table(name = "ArtifactKeyTestEntity") +public class ArtifactKeyTestEntity extends AxConcept { + private static final long serialVersionUID = -2962570563281067896L; + + @EmbeddedId() + @XmlElement(name = "key", required = true) + protected AxArtifactKey key; + + private double doubleValue; + + /** + * Instantiates a new artifact key test entity. + */ + public ArtifactKeyTestEntity() { + this.key = new AxArtifactKey(); + this.doubleValue = 0; + } + + /** + * Instantiates a new artifact key test entity. + * + * @param doubleValue the double value + */ + public ArtifactKeyTestEntity(final Double doubleValue) { + this.key = new AxArtifactKey(); + this.doubleValue = doubleValue; + } + + /** + * Instantiates a new artifact key test entity. + * + * @param key the key + * @param doubleValue the double value + */ + public ArtifactKeyTestEntity(final AxArtifactKey key, final Double doubleValue) { + this.key = key; + this.doubleValue = doubleValue; + } + + /* + * (non-Javadoc) + * + * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#getKey() + */ + @Override + public AxArtifactKey getKey() { + return key; + } + + /* + * (non-Javadoc) + * + * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#getKeys() + */ + @Override + public List getKeys() { + return Arrays.asList((AxKey) getKey()); + } + + /** + * Sets the key. + * + * @param key the new key + */ + public void setKey(final AxArtifactKey key) { + this.key = key; + } + + /** + * Check set key. + * + * @return true, if successful + */ + public boolean checkSetKey() { + return (this.key != null); + } + + /** + * Gets the double value. + * + * @return the double value + */ + public double getDoubleValue() { + return doubleValue; + } + + /** + * Sets the double value. + * + * @param doubleValue the new double value + */ + public void setDoubleValue(final double doubleValue) { + this.doubleValue = doubleValue; + } + + /* + * (non-Javadoc) + * + * @see + * org.onap.policy.apex.model.basicmodel.concepts.AxConcept#validate(org.onap.policy.apex.model.basicmodel.concepts. + * AxValidationResult) + */ + @Override + public AxValidationResult validate(final AxValidationResult result) { + return key.validate(result); + } + + /* + * (non-Javadoc) + * + * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#clean() + */ + @Override + public void clean() { + key.clean(); + } + + /* + * (non-Javadoc) + * + * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#toString() + */ + @Override + public String toString() { + return "ArtifactKeyTestEntity [key=" + key + ", doubleValue=" + doubleValue + "]"; + } + + /* + * (non-Javadoc) + * + * @see + * org.onap.policy.apex.model.basicmodel.concepts.AxConcept#copyTo(org.onap.policy.apex.model.basicmodel.concepts. + * AxConcept) + */ + @Override + public AxConcept copyTo(final AxConcept target) { + final Object copyObject = ((target == null) ? new ArtifactKeyTestEntity() : target); + if (copyObject instanceof ArtifactKeyTestEntity) { + final ArtifactKeyTestEntity copy = ((ArtifactKeyTestEntity) copyObject); + if (this.checkSetKey()) { + copy.setKey(new AxArtifactKey(key)); + } else { + copy.key = null; + } + copy.doubleValue = doubleValue; + return copy; + } else { + return null; + } + } + + /* + * (non-Javadoc) + * + * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#hashCode() + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((key == null) ? 0 : key.hashCode()); + return result; + } + + /* + * (non-Javadoc) + * + * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (obj == null) { + return false; + } + if (this == obj) { + return true; + } + if (getClass() != obj.getClass()) { + return false; + } + final ArtifactKeyTestEntity other = (ArtifactKeyTestEntity) obj; + if (key == null) { + if (other.key != null) { + return false; + } + } else if (!key.equals(other.key)) { + return false; + } + return (Double.compare(doubleValue, other.doubleValue) == 0); + } + + /* + * (non-Javadoc) + * + * @see java.lang.Comparable#compareTo(java.lang.Object) + */ + @Override + public int compareTo(final AxConcept otherObj) { + if (otherObj == null) { + return -1; + } + if (this == otherObj) { + return 0; + } + if (getClass() != otherObj.getClass()) { + return -1; + } + final ArtifactKeyTestEntity other = (ArtifactKeyTestEntity) otherObj; + if (key == null) { + if (other.key != null) { + return 1; + } + } else if (!key.equals(other.key)) { + return key.compareTo(other.key); + } + return Double.compare(doubleValue, other.doubleValue); + } +} diff --git a/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/ReferenceKeyTestEntity.java b/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/ReferenceKeyTestEntity.java new file mode 100644 index 000000000..eb5db7145 --- /dev/null +++ b/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/ReferenceKeyTestEntity.java @@ -0,0 +1,260 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.persistence.jpa.eclipselink.entities; + +import java.util.Arrays; +import java.util.List; + +import javax.persistence.EmbeddedId; +import javax.persistence.Entity; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import org.onap.policy.apex.model.basicmodel.concepts.AxConcept; +import org.onap.policy.apex.model.basicmodel.concepts.AxKey; +import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey; +import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; +import org.onap.policy.apex.model.basicmodel.xml.AxReferenceKeyAdapter; + +/** + * The Class ReferenceKeyTestEntity provides a reference key test concept. + */ +@Entity +@Table(name = "ReferenceKeyTestEntity") +public class ReferenceKeyTestEntity extends AxConcept { + private static final long serialVersionUID = -2962570563281067895L; + + @EmbeddedId() + @XmlElement(name = "key", required = true) + @XmlJavaTypeAdapter(AxReferenceKeyAdapter.class) + protected AxReferenceKey key; + + private double doubleValue; + + /** + * Instantiates a new reference key test entity. + */ + public ReferenceKeyTestEntity() { + this.key = new AxReferenceKey(); + this.doubleValue = 0; + } + + /** + * Instantiates a new reference key test entity. + * + * @param doubleValue the double value + */ + public ReferenceKeyTestEntity(final Double doubleValue) { + this.key = new AxReferenceKey(); + this.doubleValue = doubleValue; + } + + /** + * Instantiates a new reference key test entity. + * + * @param key the key + * @param doubleValue the double value + */ + public ReferenceKeyTestEntity(final AxReferenceKey key, final Double doubleValue) { + this.key = key; + this.doubleValue = doubleValue; + } + + /* + * (non-Javadoc) + * + * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#getKey() + */ + @Override + public AxReferenceKey getKey() { + return key; + } + + /* + * (non-Javadoc) + * + * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#getKeys() + */ + @Override + public List getKeys() { + return Arrays.asList((AxKey) getKey()); + } + + /** + * Sets the key. + * + * @param key the new key + */ + public void setKey(final AxReferenceKey key) { + this.key = key; + } + + /** + * Check set key. + * + * @return true, if successful + */ + public boolean checkSetKey() { + return (this.key != null); + } + + /** + * Gets the double value. + * + * @return the double value + */ + public double getDoubleValue() { + return doubleValue; + } + + /** + * Sets the double value. + * + * @param doubleValue the new double value + */ + public void setDoubleValue(final double doubleValue) { + this.doubleValue = doubleValue; + } + + /* + * (non-Javadoc) + * + * @see + * org.onap.policy.apex.model.basicmodel.concepts.AxConcept#validate(org.onap.policy.apex.model.basicmodel.concepts. + * AxValidationResult) + */ + @Override + public AxValidationResult validate(final AxValidationResult result) { + return key.validate(result); + } + + /* + * (non-Javadoc) + * + * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#clean() + */ + @Override + public void clean() { + key.clean(); + } + + /* + * (non-Javadoc) + * + * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#toString() + */ + @Override + public String toString() { + return "ReferenceKeyTestEntity [key=" + key + ", doubleValue=" + doubleValue + "]"; + } + + /* + * (non-Javadoc) + * + * @see + * org.onap.policy.apex.model.basicmodel.concepts.AxConcept#copyTo(org.onap.policy.apex.model.basicmodel.concepts. + * AxConcept) + */ + @Override + public AxConcept copyTo(final AxConcept target) { + final Object copyObject = ((target == null) ? new ReferenceKeyTestEntity() : target); + if (copyObject instanceof ReferenceKeyTestEntity) { + final ReferenceKeyTestEntity copy = ((ReferenceKeyTestEntity) copyObject); + if (this.checkSetKey()) { + copy.setKey(new AxReferenceKey(key)); + } else { + copy.key = null; + } + copy.doubleValue = doubleValue; + return copy; + } else { + return null; + } + } + + /* + * (non-Javadoc) + * + * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#hashCode() + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((key == null) ? 0 : key.hashCode()); + return result; + } + + /* + * (non-Javadoc) + * + * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (obj == null) { + return false; + } + if (this == obj) { + return true; + } + if (getClass() != obj.getClass()) { + return false; + } + final ReferenceKeyTestEntity other = (ReferenceKeyTestEntity) obj; + if (key == null) { + if (other.key != null) { + return false; + } + } else if (!key.equals(other.key)) { + return false; + } + return (Double.compare(doubleValue, other.doubleValue) == 0); + } + + /* + * (non-Javadoc) + * + * @see java.lang.Comparable#compareTo(java.lang.Object) + */ + @Override + public int compareTo(final AxConcept otherObj) { + if (otherObj == null) { + return -1; + } + if (this == otherObj) { + return 0; + } + if (getClass() != otherObj.getClass()) { + return -1; + } + final ReferenceKeyTestEntity other = (ReferenceKeyTestEntity) otherObj; + if (key == null) { + if (other.key != null) { + return 1; + } + } else if (!key.equals(other.key)) { + return key.compareTo(other.key); + } + return Double.compare(doubleValue, other.doubleValue); + } +} diff --git a/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/package-info.java b/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/package-info.java new file mode 100644 index 000000000..b30d40559 --- /dev/null +++ b/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/package-info.java @@ -0,0 +1,24 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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========================================================= + */ + +/** + * Contains common test entities. + */ +package org.onap.policy.apex.plugins.persistence.jpa.eclipselink.entities; diff --git a/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/resources/META-INF/persistence.xml b/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/resources/META-INF/persistence.xml index 130079dd9..3f8be58e4 100644 --- a/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/resources/META-INF/persistence.xml +++ b/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/resources/META-INF/persistence.xml @@ -24,8 +24,8 @@ org.eclipse.persistence.jpa.PersistenceProvider - org.onap.policy.apex.context.test.entities.ReferenceKeyTestEntity - org.onap.policy.apex.context.test.entities.ArtifactKeyTestEntity + org.onap.policy.apex.plugins.persistence.jpa.eclipselink.entities.ReferenceKeyTestEntity + org.onap.policy.apex.plugins.persistence.jpa.eclipselink.entities.ArtifactKeyTestEntity diff --git a/plugins/plugins-persistence/plugins-persistence-jpa/pom.xml b/plugins/plugins-persistence/plugins-persistence-jpa/pom.xml index 8425af3ee..b43cc4d71 100644 --- a/plugins/plugins-persistence/plugins-persistence-jpa/pom.xml +++ b/plugins/plugins-persistence/plugins-persistence-jpa/pom.xml @@ -38,11 +38,6 @@ basic-model ${project.version} - - org.onap.policy.apex-pdp.context - context-test-utils - ${project.version} - com.h2database h2 diff --git a/pom.xml b/pom.xml index 95c11235d..f464f2c22 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,6 @@ UTF-8 UTF-8 - 10.13.1.1 1.4 1.1.1 2.26 diff --git a/services/services-engine/pom.xml b/services/services-engine/pom.xml index 2b68f2731..24872d536 100644 --- a/services/services-engine/pom.xml +++ b/services/services-engine/pom.xml @@ -54,12 +54,6 @@ core-protocols ${project.version} - - org.onap.policy.apex-pdp.context - context-test-utils - ${project.version} - test - commons-cli commons-cli diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextBooleanItem.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextBooleanItem.java new file mode 100644 index 000000000..84d896c8a --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextBooleanItem.java @@ -0,0 +1,112 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.context.test.concepts; + +import java.io.Serializable; + +/** + * The Class TestContextItem000. + */ +public class TestContextBooleanItem implements Serializable { + private static final int HASH_PRIME_1 = 31; + private static final int HASH_PRIME_2 = 1231; + private static final int HASH_PRIME_3 = 1237; + + private static final long serialVersionUID = 7241008665286367796L; + + private boolean flag = false; + + /** + * The Constructor. + */ + public TestContextBooleanItem() {} + + /** + * The Constructor. + * + * @param flag the flag + */ + public TestContextBooleanItem(final Boolean flag) { + this.flag = flag; + } + + /** + * Gets the flag. + * + * @return the flag + */ + public boolean getFlag() { + return flag; + } + + /** + * Sets the flag. + * + * @param flag the flag + */ + public void setFlag(final boolean flag) { + this.flag = flag; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = HASH_PRIME_1; + int result = 1; + result = prime * result + (flag ? HASH_PRIME_2 : HASH_PRIME_3); + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TestContextBooleanItem other = (TestContextBooleanItem) obj; + return flag == other.flag; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "TestContextItem000 [flag=" + flag + "]"; + } +} diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextByteItem.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextByteItem.java new file mode 100644 index 000000000..87d9bc678 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextByteItem.java @@ -0,0 +1,110 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.context.test.concepts; + +import java.io.Serializable; + +/** + * The Class TestContextItem001. + */ +public class TestContextByteItem implements Serializable { + private static final long serialVersionUID = 1361938145823720386L; + + private static final int HASH_PRIME_1 = 31; + + private byte byteValue = 0; + + /** + * The Constructor. + */ + public TestContextByteItem() {} + + /** + * The Constructor. + * + * @param byteValue the byte value + */ + public TestContextByteItem(final Byte byteValue) { + this.byteValue = byteValue; + } + + /** + * Gets the byte value. + * + * @return the byte value + */ + public byte getByteValue() { + return byteValue; + } + + /** + * Sets the byte value. + * + * @param byteValue the byte value + */ + public void setByteValue(final byte byteValue) { + this.byteValue = byteValue; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = HASH_PRIME_1; + int result = 1; + result = prime * result + byteValue; + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TestContextByteItem other = (TestContextByteItem) obj; + return byteValue == other.byteValue; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "TestContextItem001 [byteValue=" + byteValue + "]"; + } +} diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateItem.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateItem.java new file mode 100644 index 000000000..c6cc4a781 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateItem.java @@ -0,0 +1,242 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.context.test.concepts; + +import java.io.Serializable; +import java.util.Calendar; +import java.util.Date; +import java.util.TimeZone; + +/** + * The Class TestContextItem008. + */ +public class TestContextDateItem implements Serializable { + private static final long serialVersionUID = -6984963129968805460L; + + private static final int HASH_PRIME_1 = 31; + private static final int FOUR_BYTES = 32; + + private long time; + + private int year; + private int month; + private int day; + private int hour; + private int minute; + private int second; + private int milliSecond; + + /** + * The Constructor. + */ + public TestContextDateItem() { + this(new Date(System.currentTimeMillis())); + } + + /** + * The Constructor. + * + * @param dateValue the date value + */ + public TestContextDateItem(final Date dateValue) { + if (dateValue != null) { + setDateValue(dateValue.getTime()); + } + else { + new Date(0); + } + } + + /** + * The Constructor. + * + * @param time the time + */ + public TestContextDateItem(final long time) { + setDateValue(time); + } + + /** + * Gets the time. + * + * @return the time + */ + public long getTime() { + return time; + } + + /** + * Gets the year. + * + * @return the year + */ + public int getYear() { + return year; + } + + /** + * Gets the month. + * + * @return the month + */ + public int getMonth() { + return month; + } + + /** + * Gets the day. + * + * @return the day + */ + public int getDay() { + return day; + } + + /** + * Gets the hour. + * + * @return the hour + */ + public int getHour() { + return hour; + } + + /** + * Gets the minute. + * + * @return the minute + */ + public int getMinute() { + return minute; + } + + /** + * Gets the second. + * + * @return the second + */ + public int getSecond() { + return second; + } + + /** + * Gets the milli second. + * + * @return the milli second + */ + public int getMilliSecond() { + return milliSecond; + } + + /** + * Gets the date value. + * + * @return the date value + */ + public Date getDateValue() { + return new Date(time); + } + + /** + * Sets the date value. + * + * @param dateValue the date value + */ + public void setDateValue(final Date dateValue) { + if (dateValue != null) { + setDateValue(dateValue.getTime()); + } + } + + /** + * Sets the date value. + * + * @param dateValue the date value + */ + public void setDateValue(final long dateValue) { + this.time = dateValue; + + final Calendar calendar = Calendar.getInstance(); + calendar.setTimeZone(TimeZone.getTimeZone("UTC")); + calendar.setTimeInMillis(time); + + year = calendar.get(Calendar.YEAR); + month = calendar.get(Calendar.MONTH); + day = calendar.get(Calendar.DAY_OF_MONTH); + hour = calendar.get(Calendar.HOUR); + minute = calendar.get(Calendar.MINUTE); + second = calendar.get(Calendar.SECOND); + milliSecond = calendar.get(Calendar.MILLISECOND); + } + + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = HASH_PRIME_1; + int result = 1; + result = prime * result + day; + result = prime * result + hour; + result = prime * result + milliSecond; + result = prime * result + minute; + result = prime * result + month; + result = prime * result + second; + result = prime * result + (int) (time ^ (time >>> FOUR_BYTES)); + result = prime * result + year; + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TestContextDateItem other = (TestContextDateItem) obj; + return time == other.time; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "TestContextItem008 [time=" + time + ", year=" + year + ", month=" + month + ", day=" + day + ", hour=" + + hour + ", minute=" + minute + ", second=" + second + ", milliSecond=" + milliSecond + "]"; + } +} diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateLocaleItem.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateLocaleItem.java new file mode 100644 index 000000000..84024578d --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateLocaleItem.java @@ -0,0 +1,254 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.context.test.concepts; + +import java.io.Serializable; +import java.util.Locale; +import java.util.TimeZone; + +/** + * The Class TestContextItem00A. + */ +public class TestContextDateLocaleItem implements Serializable { + private static final long serialVersionUID = -6579903685538233754L; + + private static final int HASH_PRIME_1 = 31; + private static final int HASH_PRIME_2 = 1231; + private static final int HASH_PRIME_3 = 1237; + + private TestContextDateItem dateValue = new TestContextDateItem(System.currentTimeMillis()); + private String timeZoneString = TimeZone.getTimeZone("Europe/Dublin").getDisplayName(); + private boolean dst = false; + private int utcOffset = 0; + private Locale locale = Locale.ENGLISH; + + /** + * The Constructor. + */ + public TestContextDateLocaleItem() { + } + + /** + * The Constructor. + * + * @param dateValue the date value + * @param tzValue the tz value + * @param dst the dst + * @param utcOffset the utc offset + * @param language the language + * @param country the country + */ + public TestContextDateLocaleItem(final TestContextDateItem dateValue, final String tzValue, final boolean dst, + final int utcOffset, final String language, final String country) { + this.dateValue = dateValue; + this.timeZoneString = TimeZone.getTimeZone(tzValue).getDisplayName(); + this.dst = dst; + this.utcOffset = utcOffset; + + this.locale = new Locale(language, country); + } + + /** + * The Constructor. + * + * @param original the original + */ + public TestContextDateLocaleItem(final TestContextDateLocaleItem original) { + this.dateValue = original.dateValue; + this.timeZoneString = TimeZone.getTimeZone(original.timeZoneString).getDisplayName(); + this.dst = original.dst; + this.utcOffset = original.utcOffset; + + this.locale = new Locale(original.getLocale().getCountry(), original.getLocale().getLanguage()); + } + + /** + * Gets the date value. + * + * @return the date value + */ + public TestContextDateItem getDateValue() { + return dateValue; + } + + /** + * Sets the date value. + * + * @param dateValue the date value + */ + public void setDateValue(final TestContextDateItem dateValue) { + this.dateValue = dateValue; + } + + /** + * Gets the TZ value. + * + * @return the TZ value + */ + public String getTzValue() { + return timeZoneString; + } + + /** + * Sets the TZ value. + * + * @param tzValue the TZ value + */ + public void setTzValue(final String tzValue) { + if (tzValue != null) { + this.timeZoneString = TimeZone.getTimeZone(tzValue).getDisplayName(); + } else { + this.timeZoneString = null; + } + } + + /** + * Gets the DST. + * + * @return the dst + */ + public boolean getDst() { + return dst; + } + + /** + * Sets the DST. + * + * @param newDst the dst + */ + public void setDst(final boolean newDst) { + this.dst = newDst; + } + + /** + * Gets the UTC offset. + * + * @return the UTC offset + */ + public int getUtcOffset() { + return utcOffset; + } + + /** + * Sets the UTC offset. + * + * @param newUtcOffset the UTC offset + */ + public void setUtcOffset(final int newUtcOffset) { + this.utcOffset = newUtcOffset; + } + + /** + * Gets the locale. + * + * @return the locale + */ + public Locale getLocale() { + return locale; + } + + /** + * Sets the locale. + * + * @param locale the locale + */ + public void setLocale(final Locale locale) { + if (locale != null) { + this.locale = locale; + } + else { + this.locale = null; + } + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = HASH_PRIME_1; + int result = 1; + result = prime * result + ((dateValue == null) ? 0 : dateValue.hashCode()); + result = prime * result + (dst ? HASH_PRIME_2 : HASH_PRIME_3); + result = prime * result + ((locale == null) ? 0 : locale.hashCode()); + result = prime * result + ((timeZoneString == null) ? 0 : timeZoneString.hashCode()); + result = prime * result + utcOffset; + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TestContextDateLocaleItem other = (TestContextDateLocaleItem) obj; + if (dateValue == null) { + if (other.dateValue != null) { + return false; + } + } else if (!dateValue.equals(other.dateValue)) { + return false; + } + if (dst != other.dst) { + return false; + } + if (locale == null) { + if (other.locale != null) { + return false; + } + } else if (!locale.equals(other.locale)) { + return false; + } + if (timeZoneString == null) { + if (other.timeZoneString != null) { + return false; + } + } else if (!timeZoneString.equals(other.timeZoneString)) { + return false; + } + return utcOffset == other.utcOffset; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "TestContextItem00A [dateValue=" + dateValue + ", timeZoneString=" + timeZoneString + ", dst=" + dst + + ", utcOffset=" + utcOffset + ", locale=" + locale + "]"; + } +} diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateTzItem.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateTzItem.java new file mode 100644 index 000000000..90f108ce2 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDateTzItem.java @@ -0,0 +1,193 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.context.test.concepts; + +import java.io.Serializable; +import java.util.TimeZone; + +/** + * The Class TestContextItem009. + */ +public class TestContextDateTzItem implements Serializable { + private static final long serialVersionUID = 5604426823170331706L; + + private static final int HASH_PRIME_1 = 31; + private static final int HASH_PRIME_2 = 1231; + private static final int HASH_PRIME_3 = 1237; + + private TestContextDateItem dateValue = new TestContextDateItem(System.currentTimeMillis()); + private String timeZoneString = TimeZone.getTimeZone("Europe/Dublin").getDisplayName(); + private boolean dst = false; + + /** + * The Constructor. + */ + public TestContextDateTzItem() { + dst = true; + } + + /** + * The Constructor. + * + * @param dateValue the date value + * @param tzValue the tz value + * @param dst the dst + */ + public TestContextDateTzItem(final TestContextDateItem dateValue, final String tzValue, final boolean dst) { + this.dateValue = dateValue; + this.timeZoneString = TimeZone.getTimeZone(tzValue).getDisplayName(); + this.dst = dst; + } + + /** + * The Constructor. + * + * @param original the original + */ + public TestContextDateTzItem(final TestContextDateTzItem original) { + this.dateValue = original.dateValue; + this.timeZoneString = original.timeZoneString; + this.dst = original.dst; + } + + /** + * Gets the date value. + * + * @return the date value + */ + public TestContextDateItem getDateValue() { + return dateValue; + } + + /** + * Sets the date value. + * + * @param dateValue the date value + */ + public void setDateValue(final TestContextDateItem dateValue) { + this.dateValue = dateValue; + } + + /** + * Gets the TZ value. + * + * @return the TZ value + */ + public String getTzValue() { + return timeZoneString; + } + + /** + * Sets the TZ value. + * + * @param tzValue the TZ value + */ + public void setTzValue(final String tzValue) { + if (tzValue != null) { + this.timeZoneString = TimeZone.getTimeZone(tzValue).getDisplayName(); + } + else { + this.timeZoneString = null; + } + } + + /** + * Gets the DST. + * + * @return the dst + */ + public boolean getDst() { + return dst; + } + + /** + * Sets the DST. + * + * @param newDst the dst + */ + public void setDst(final boolean newDst) { + this.dst = newDst; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = HASH_PRIME_1; + int result = 1; + result = prime * result + ((dateValue == null) ? 0 : dateValue.hashCode()); + result = prime * result + (dst ? HASH_PRIME_2 : HASH_PRIME_3); + result = prime * result + ((timeZoneString == null) ? 0 : timeZoneString.hashCode()); + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TestContextDateTzItem other = (TestContextDateTzItem) obj; + if (dateValue == null) { + if (other.dateValue != null) { + return false; + } + } else if (!dateValue.equals(other.dateValue)) { + return false; + } + if (dst != other.dst) { + return false; + } + if (timeZoneString == null) { + if (other.timeZoneString != null) { + return false; + } + } + else if (!timeZoneString.equals(other.timeZoneString)) { + return false; + } + return true; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "TestContextItem009 [dateValue=" + dateValue + ", tzValue=" + timeZoneString + ", dst=" + dst + "]"; + } +} diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDoubleItem.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDoubleItem.java new file mode 100644 index 000000000..99bde4a5c --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextDoubleItem.java @@ -0,0 +1,113 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.context.test.concepts; + +import java.io.Serializable; + +/** + * The Class TestContextItem005. + */ +public class TestContextDoubleItem implements Serializable { + private static final long serialVersionUID = -2958758261076734821L; + + private static final int HASH_PRIME_1 = 31; + private static final int FOUR_BYTES = 32; + + private double doubleValue = 0; + + /** + * The Constructor. + */ + public TestContextDoubleItem() {} + + /** + * The Constructor. + * + * @param doubleValue the double value + */ + public TestContextDoubleItem(final Double doubleValue) { + this.doubleValue = doubleValue; + } + + /** + * Gets the double value. + * + * @return the double value + */ + public double getDoubleValue() { + return doubleValue; + } + + /** + * Sets the double value. + * + * @param doubleValue the double value + */ + public void setDoubleValue(final double doubleValue) { + this.doubleValue = doubleValue; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = HASH_PRIME_1; + int result = 1; + long temp; + temp = Double.doubleToLongBits(doubleValue); + result = prime * result + (int) (temp ^ (temp >>> FOUR_BYTES)); + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TestContextDoubleItem other = (TestContextDoubleItem) obj; + return Double.doubleToLongBits(doubleValue) == Double.doubleToLongBits(other.doubleValue); + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "TestContextItem005 [doubleValue=" + doubleValue + "]"; + } +} diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextFloatItem.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextFloatItem.java new file mode 100644 index 000000000..b7545653e --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextFloatItem.java @@ -0,0 +1,110 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.context.test.concepts; + +import java.io.Serializable; + +/** + * The Class TestContextItem004. + */ +public class TestContextFloatItem implements Serializable { + private static final long serialVersionUID = -3359180576903272400L; + + private static final int HASH_PRIME_1 = 31; + + private float floatValue = 0; + + /** + * The Constructor. + */ + public TestContextFloatItem() {} + + /** + * The Constructor. + * + * @param floatValue the float value + */ + public TestContextFloatItem(final Float floatValue) { + this.floatValue = floatValue; + } + + /** + * Gets the float value. + * + * @return the float value + */ + public float getFloatValue() { + return floatValue; + } + + /** + * Sets the float value. + * + * @param floatValue the float value + */ + public void setFloatValue(final float floatValue) { + this.floatValue = floatValue; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = HASH_PRIME_1; + int result = 1; + result = prime * result + Float.floatToIntBits(floatValue); + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TestContextFloatItem other = (TestContextFloatItem) obj; + return Float.floatToIntBits(floatValue) == Float.floatToIntBits(other.floatValue); + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "TestContextItem004 [floatValue=" + floatValue + "]"; + } +} diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextIntItem.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextIntItem.java new file mode 100644 index 000000000..e2b68f78b --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextIntItem.java @@ -0,0 +1,119 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.context.test.concepts; + +import java.io.Serializable; + +/** + * The Class TestContextItem002. + */ +public class TestContextIntItem implements Serializable { + private static final long serialVersionUID = -8978435658277900984L; + + private static final int HASH_PRIME_1 = 31; + + private int intValue = 0; + + /** + * The Constructor. + */ + public TestContextIntItem() {} + + /** + * The Constructor. + * + * @param intValue the int value + */ + public TestContextIntItem(final Integer intValue) { + this.intValue = intValue; + } + + /** + * The Constructor. + * + * @param original the original + */ + public TestContextIntItem(final TestContextIntItem original) { + this.intValue = original.intValue; + } + + /** + * Gets the int value. + * + * @return the int value + */ + public int getIntValue() { + return intValue; + } + + /** + * Sets the int value. + * + * @param intValue the int value + */ + public void setIntValue(final int intValue) { + this.intValue = intValue; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = HASH_PRIME_1; + int result = 1; + result = prime * result + intValue; + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TestContextIntItem other = (TestContextIntItem) obj; + return intValue == other.intValue; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "TestContextItem002 [intValue=" + intValue + "]"; + } +} diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextLongItem.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextLongItem.java new file mode 100644 index 000000000..6c9571f4d --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextLongItem.java @@ -0,0 +1,111 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.context.test.concepts; + +import java.io.Serializable; + +/** + * The Class TestContextItem003. + */ +public class TestContextLongItem implements Serializable { + private static final long serialVersionUID = 3599267534512489386L; + + private static final int HASH_PRIME_1 = 31; + private static final int FOUR_BYTES = 33; + + private long longValue = 0; + + /** + * The Constructor. + */ + public TestContextLongItem() {} + + /** + * The Constructor. + * + * @param longValue the long value + */ + public TestContextLongItem(final Long longValue) { + this.longValue = longValue; + } + + /** + * Gets the long value. + * + * @return the long value + */ + public long getLongValue() { + return longValue; + } + + /** + * Sets the long value. + * + * @param longValue the long value + */ + public void setLongValue(final long longValue) { + this.longValue = longValue; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = HASH_PRIME_1; + int result = 1; + result = prime * result + (int) (longValue ^ (longValue >>> FOUR_BYTES)); + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TestContextLongItem other = (TestContextLongItem) obj; + return longValue == other.longValue; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "TestContextItem003 [longValue=" + longValue + "]"; + } +} diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextLongObjectItem.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextLongObjectItem.java new file mode 100644 index 000000000..73d47c414 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextLongObjectItem.java @@ -0,0 +1,117 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.context.test.concepts; + +import java.io.Serializable; + +/** + * The Class TestContextItem007. + */ +public class TestContextLongObjectItem implements Serializable { + private static final long serialVersionUID = -1029406737866392421L; + + private static final int HASH_PRIME_1 = 31; + + private Long longValue = 0L; + + /** + * The Constructor. + */ + public TestContextLongObjectItem() {} + + /** + * The Constructor. + * + * @param longValue the long value + */ + public TestContextLongObjectItem(final Long longValue) { + this.longValue = longValue; + } + + /** + * Gets the long value. + * + * @return the long value + */ + public Long getLongValue() { + return longValue; + } + + /** + * Sets the long value. + * + * @param longValue the long value + */ + public void setLongValue(final Long longValue) { + this.longValue = longValue; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = HASH_PRIME_1; + int result = 1; + result = prime * result + ((longValue == null) ? 0 : longValue.hashCode()); + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TestContextLongObjectItem other = (TestContextLongObjectItem) obj; + if (longValue == null) { + if (other.longValue != null) { + return false; + } + } else if (!longValue.equals(other.longValue)) { + return false; + } + return true; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "TestContextItem007 [longValue=" + longValue + "]"; + } +} diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextStringItem.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextStringItem.java new file mode 100644 index 000000000..b1b27e7d3 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextStringItem.java @@ -0,0 +1,117 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.context.test.concepts; + +import java.io.Serializable; + +/** + * The Class TestContextItem006. + */ +public class TestContextStringItem implements Serializable { + private static final long serialVersionUID = -1074772190611125121L; + + private static final int HASH_PRIME_1 = 31; + + private String stringValue = ""; + + /** + * The Constructor. + */ + public TestContextStringItem() {} + + /** + * The Constructor. + * + * @param stringValue the string value + */ + public TestContextStringItem(final String stringValue) { + this.stringValue = stringValue; + } + + /** + * Gets the string value. + * + * @return the string value + */ + public String getStringValue() { + return stringValue; + } + + /** + * Sets the string value. + * + * @param stringValue the string value + */ + public void setStringValue(final String stringValue) { + this.stringValue = stringValue; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = HASH_PRIME_1; + int result = 1; + result = prime * result + ((stringValue == null) ? 0 : stringValue.hashCode()); + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TestContextStringItem other = (TestContextStringItem) obj; + if (stringValue == null) { + if (other.stringValue != null) { + return false; + } + } else if (!stringValue.equals(other.stringValue)) { + return false; + } + return true; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "TestContextItem006 [stringValue=" + stringValue + "]"; + } +} diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextTreeMapItem.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextTreeMapItem.java new file mode 100644 index 000000000..9111109fe --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextTreeMapItem.java @@ -0,0 +1,123 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.context.test.concepts; + +import java.io.Serializable; +import java.util.Map; +import java.util.TreeMap; + +/** + * The Class TestContextItem00C. + */ +public class TestContextTreeMapItem implements Serializable { + private static final long serialVersionUID = -7497746259264651884L; + + private static final int HASH_PRIME_1 = 31; + + private Map mapValue = new TreeMap<>(); + + /** + * The Constructor. + */ + public TestContextTreeMapItem() {} + + /** + * The Constructor. + * + * @param mapValue the map value + */ + public TestContextTreeMapItem(final Map mapValue) { + this.mapValue = mapValue; + } + + /** + * Gets the map value. + * + * @return the map value + */ + public Map getMapValue() { + if (mapValue == null) { + mapValue = new TreeMap<>(); + } + return mapValue; + } + + /** + * Sets the map value. + * + * @param mapValue the map value + */ + public void setMapValue(final Map mapValue) { + this.mapValue = mapValue; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = HASH_PRIME_1; + int result = 1; + result = prime * result + ((mapValue == null) ? 0 : mapValue.hashCode()); + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TestContextTreeMapItem other = (TestContextTreeMapItem) obj; + if (mapValue == null) { + if (other.mapValue != null) { + return false; + } + } else if (!mapValue.equals(other.mapValue)) { + return false; + } + return true; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "TestContextItem00C [mapValue=" + mapValue + "]"; + } + +} diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextTreeSetItem.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextTreeSetItem.java new file mode 100644 index 000000000..7172fa478 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestContextTreeSetItem.java @@ -0,0 +1,133 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.context.test.concepts; + +import java.io.Serializable; +import java.util.Arrays; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; + +/** + * The Class TestContextItem00B. + */ +public class TestContextTreeSetItem implements Serializable { + private static final long serialVersionUID = 1254589722957250388L; + + private static final int HASH_PRIME_1 = 31; + + private SortedSet setValue = new TreeSet<>(); + + /** + * The Constructor. + */ + public TestContextTreeSetItem() {} + + /** + * The Constructor. + * + * @param setArray the set array + */ + public TestContextTreeSetItem(final String[] setArray) { + this.setValue = new TreeSet<>(Arrays.asList(setArray)); + } + + /** + * The Constructor. + * + * @param setValue the set value + */ + public TestContextTreeSetItem(final SortedSet setValue) { + this.setValue = setValue; + } + + /** + * Gets the set value. + * + * @return the sets the value + */ + public Set getSetValue() { + if (setValue == null) { + setValue = new TreeSet<>(); + } + return setValue; + } + + /** + * Sets the set value. + * + * @param setValue the sets the value + */ + public void setSetValue(final SortedSet setValue) { + this.setValue = setValue; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = HASH_PRIME_1; + int result = 1; + result = prime * result + ((setValue == null) ? 0 : setValue.hashCode()); + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TestContextTreeSetItem other = (TestContextTreeSetItem) obj; + if (setValue == null) { + if (other.setValue != null) { + return false; + } + } else if (!setValue.equals(other.setValue)) { + return false; + } + return true; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "TestContextItem00B [setValue=" + setValue + "]"; + } +} diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestExternalContextItem.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestExternalContextItem.java new file mode 100644 index 000000000..77f86d226 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestExternalContextItem.java @@ -0,0 +1,435 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.context.test.concepts; + +import java.io.Serializable; + +/** + * The Class TestExternalContextItem. + */ +public class TestExternalContextItem implements Serializable { + private static final long serialVersionUID = 3512435733818672173L; + + private static final int HASH_PRIME_1 = 31; + + private TestContextBooleanItem testExternalContextItem000; + private TestContextByteItem testExternalContextItem001; + private TestContextIntItem testExternalContextItem002; + private TestContextLongItem testExternalContextItem003; + private TestContextFloatItem testExternalContextItem004; + private TestContextDoubleItem testExternalContextItem005; + private TestContextStringItem testExternalContextItem006; + private TestContextLongObjectItem testExternalContextItem007; + private TestContextDateItem testExternalContextItem008; + private TestContextDateTzItem testExternalContextItem009; + private TestContextDateLocaleItem testExternalContextItem00A; + private TestContextTreeSetItem testExternalContextItem00B; + private TestContextTreeMapItem testExternalContextItem00C; + + /** + * Gets the test external context item 000. + * + * @return the test external context item 000 + */ + public TestContextBooleanItem getTestExternalContextItem000() { + return testExternalContextItem000; + } + + /** + * Sets the test external context item 000. + * + * @param testExternalContextItem000 the test external context item 000 + */ + public void setTestExternalContextItem000(final TestContextBooleanItem testExternalContextItem000) { + this.testExternalContextItem000 = testExternalContextItem000; + } + + /** + * Gets the test external context item 001. + * + * @return the test external context item 001 + */ + public TestContextByteItem getTestExternalContextItem001() { + return testExternalContextItem001; + } + + /** + * Sets the test external context item 001. + * + * @param testExternalContextItem001 the test external context item 001 + */ + public void setTestExternalContextItem001(final TestContextByteItem testExternalContextItem001) { + this.testExternalContextItem001 = testExternalContextItem001; + } + + /** + * Gets the test external context item 002. + * + * @return the test external context item 002 + */ + public TestContextIntItem getTestExternalContextItem002() { + return testExternalContextItem002; + } + + /** + * Sets the test external context item 002. + * + * @param testExternalContextItem002 the test external context item 002 + */ + public void setTestExternalContextItem002(final TestContextIntItem testExternalContextItem002) { + this.testExternalContextItem002 = testExternalContextItem002; + } + + /** + * Gets the test external context item 003. + * + * @return the test external context item 003 + */ + public TestContextLongItem getTestExternalContextItem003() { + return testExternalContextItem003; + } + + /** + * Sets the test external context item 003. + * + * @param testExternalContextItem003 the test external context item 003 + */ + public void setTestExternalContextItem003(final TestContextLongItem testExternalContextItem003) { + this.testExternalContextItem003 = testExternalContextItem003; + } + + /** + * Gets the test external context item 004. + * + * @return the test external context item 004 + */ + public TestContextFloatItem getTestExternalContextItem004() { + return testExternalContextItem004; + } + + /** + * Sets the test external context item 004. + * + * @param testExternalContextItem004 the test external context item 004 + */ + public void setTestExternalContextItem004(final TestContextFloatItem testExternalContextItem004) { + this.testExternalContextItem004 = testExternalContextItem004; + } + + /** + * Gets the test external context item 005. + * + * @return the test external context item 005 + */ + public TestContextDoubleItem getTestExternalContextItem005() { + return testExternalContextItem005; + } + + /** + * Sets the test external context item 005. + * + * @param testExternalContextItem005 the test external context item 005 + */ + public void setTestExternalContextItem005(final TestContextDoubleItem testExternalContextItem005) { + this.testExternalContextItem005 = testExternalContextItem005; + } + + /** + * Gets the test external context item 006. + * + * @return the test external context item 006 + */ + public TestContextStringItem getTestExternalContextItem006() { + return testExternalContextItem006; + } + + /** + * Sets the test external context item 006. + * + * @param testExternalContextItem006 the test external context item 006 + */ + public void setTestExternalContextItem006(final TestContextStringItem testExternalContextItem006) { + this.testExternalContextItem006 = testExternalContextItem006; + } + + /** + * Gets the test external context item 007. + * + * @return the test external context item 007 + */ + public TestContextLongObjectItem getTestExternalContextItem007() { + return testExternalContextItem007; + } + + /** + * Sets the test external context item 007. + * + * @param testExternalContextItem007 the test external context item 007 + */ + public void setTestExternalContextItem007(final TestContextLongObjectItem testExternalContextItem007) { + this.testExternalContextItem007 = testExternalContextItem007; + } + + /** + * Gets the test external context item 008. + * + * @return the test external context item 008 + */ + public TestContextDateItem getTestExternalContextItem008() { + return testExternalContextItem008; + } + + /** + * Sets the test external context item 008. + * + * @param testExternalContextItem008 the test external context item 008 + */ + public void setTestExternalContextItem008(final TestContextDateItem testExternalContextItem008) { + this.testExternalContextItem008 = testExternalContextItem008; + } + + /** + * Gets the test external context item 009. + * + * @return the test external context item 009 + */ + public TestContextDateTzItem getTestExternalContextItem009() { + return testExternalContextItem009; + } + + /** + * Sets the test external context item 009. + * + * @param testExternalContextItem009 the test external context item 009 + */ + public void setTestExternalContextItem009(final TestContextDateTzItem testExternalContextItem009) { + this.testExternalContextItem009 = testExternalContextItem009; + } + + /** + * Gets the test external context item 00 A. + * + * @return the test external context item 00 A + */ + public TestContextDateLocaleItem getTestExternalContextItem00A() { + return testExternalContextItem00A; + } + + /** + * Sets the test external context item 00 A. + * + * @param testExternalContextItem00A the test external context item 00 A + */ + public void setTestExternalContextItem00A(final TestContextDateLocaleItem testExternalContextItem00A) { + this.testExternalContextItem00A = testExternalContextItem00A; + } + + /** + * Gets the test external context item 00 B. + * + * @return the test external context item 00 B + */ + public TestContextTreeSetItem getTestExternalContextItem00B() { + return testExternalContextItem00B; + } + + /** + * Sets the test external context item 00 B. + * + * @param testExternalContextItem00B the test external context item 00 B + */ + public void setTestExternalContextItem00B(final TestContextTreeSetItem testExternalContextItem00B) { + this.testExternalContextItem00B = testExternalContextItem00B; + } + + /** + * Gets the test external context item 00 C. + * + * @return the test external context item 00 C + */ + public TestContextTreeMapItem getTestExternalContextItem00C() { + return testExternalContextItem00C; + } + + /** + * Sets the test external context item 00 C. + * + * @param testExternalContextItem00C the test external context item 00 C + */ + public void setTestExternalContextItem00C(final TestContextTreeMapItem testExternalContextItem00C) { + this.testExternalContextItem00C = testExternalContextItem00C; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = HASH_PRIME_1; + int result = 1; + result = prime * result + ((testExternalContextItem000 == null) ? 0 : testExternalContextItem000.hashCode()); + result = prime * result + ((testExternalContextItem001 == null) ? 0 : testExternalContextItem001.hashCode()); + result = prime * result + ((testExternalContextItem002 == null) ? 0 : testExternalContextItem002.hashCode()); + result = prime * result + ((testExternalContextItem003 == null) ? 0 : testExternalContextItem003.hashCode()); + result = prime * result + ((testExternalContextItem004 == null) ? 0 : testExternalContextItem004.hashCode()); + result = prime * result + ((testExternalContextItem005 == null) ? 0 : testExternalContextItem005.hashCode()); + result = prime * result + ((testExternalContextItem006 == null) ? 0 : testExternalContextItem006.hashCode()); + result = prime * result + ((testExternalContextItem007 == null) ? 0 : testExternalContextItem007.hashCode()); + result = prime * result + ((testExternalContextItem008 == null) ? 0 : testExternalContextItem008.hashCode()); + result = prime * result + ((testExternalContextItem009 == null) ? 0 : testExternalContextItem009.hashCode()); + result = prime * result + ((testExternalContextItem00A == null) ? 0 : testExternalContextItem00A.hashCode()); + result = prime * result + ((testExternalContextItem00B == null) ? 0 : testExternalContextItem00B.hashCode()); + result = prime * result + ((testExternalContextItem00C == null) ? 0 : testExternalContextItem00C.hashCode()); + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TestExternalContextItem other = (TestExternalContextItem) obj; + if (testExternalContextItem000 == null) { + if (other.testExternalContextItem000 != null) { + return false; + } + } else if (!testExternalContextItem000.equals(other.testExternalContextItem000)) { + return false; + } + if (testExternalContextItem001 == null) { + if (other.testExternalContextItem001 != null) { + return false; + } + } else if (!testExternalContextItem001.equals(other.testExternalContextItem001)) { + return false; + } + if (testExternalContextItem002 == null) { + if (other.testExternalContextItem002 != null) { + return false; + } + } else if (!testExternalContextItem002.equals(other.testExternalContextItem002)) { + return false; + } + if (testExternalContextItem003 == null) { + if (other.testExternalContextItem003 != null) { + return false; + } + } else if (!testExternalContextItem003.equals(other.testExternalContextItem003)) { + return false; + } + if (testExternalContextItem004 == null) { + if (other.testExternalContextItem004 != null) { + return false; + } + } else if (!testExternalContextItem004.equals(other.testExternalContextItem004)) { + return false; + } + if (testExternalContextItem005 == null) { + if (other.testExternalContextItem005 != null) { + return false; + } + } else if (!testExternalContextItem005.equals(other.testExternalContextItem005)) { + return false; + } + if (testExternalContextItem006 == null) { + if (other.testExternalContextItem006 != null) { + return false; + } + } else if (!testExternalContextItem006.equals(other.testExternalContextItem006)) { + return false; + } + if (testExternalContextItem007 == null) { + if (other.testExternalContextItem007 != null) { + return false; + } + } else if (!testExternalContextItem007.equals(other.testExternalContextItem007)) { + return false; + } + if (testExternalContextItem008 == null) { + if (other.testExternalContextItem008 != null) { + return false; + } + } else if (!testExternalContextItem008.equals(other.testExternalContextItem008)) { + return false; + } + if (testExternalContextItem009 == null) { + if (other.testExternalContextItem009 != null) { + return false; + } + } else if (!testExternalContextItem009.equals(other.testExternalContextItem009)) { + return false; + } + if (testExternalContextItem00A == null) { + if (other.testExternalContextItem00A != null) { + return false; + } + } else if (!testExternalContextItem00A.equals(other.testExternalContextItem00A)) { + return false; + } + if (testExternalContextItem00B == null) { + if (other.testExternalContextItem00B != null) { + return false; + } + } else if (!testExternalContextItem00B.equals(other.testExternalContextItem00B)) { + return false; + } + if (testExternalContextItem00C == null) { + if (other.testExternalContextItem00C != null) { + return false; + } + } else if (!testExternalContextItem00C.equals(other.testExternalContextItem00C)) { + return false; + } + return true; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "TestExternalContextItem [testExternalContextItem000=" + testExternalContextItem000 + + ", testExternalContextItem001=" + testExternalContextItem001 + ", testExternalContextItem002=" + + testExternalContextItem002 + ", testExternalContextItem003=" + testExternalContextItem003 + + ", testExternalContextItem004=" + testExternalContextItem004 + ", testExternalContextItem005=" + + testExternalContextItem005 + ", testExternalContextItem006=" + testExternalContextItem006 + + ", testExternalContextItem007=" + testExternalContextItem007 + ", testExternalContextItem008=" + + testExternalContextItem008 + ", testExternalContextItem009=" + testExternalContextItem009 + + ", testExternalContextItem00A=" + testExternalContextItem00A + ", testExternalContextItem00B=" + + testExternalContextItem00B + ", testExternalContextItem00C=" + testExternalContextItem00C + "]"; + } +} diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestGlobalContextItem.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestGlobalContextItem.java new file mode 100644 index 000000000..5cd6a437d --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestGlobalContextItem.java @@ -0,0 +1,435 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.context.test.concepts; + +import java.io.Serializable; + +/** + * The Class TestGlobalContextItem. + */ +public class TestGlobalContextItem implements Serializable { + private static final long serialVersionUID = 3348445332683174361L; + + private static final int HASH_PRIME_1 = 31; + + private TestContextBooleanItem testGlobalContextItem000; + private TestContextByteItem testGlobalContextItem001; + private TestContextIntItem testGlobalContextItem002; + private TestContextLongItem testGlobalContextItem003; + private TestContextFloatItem testGlobalContextItem004; + private TestContextDoubleItem testGlobalContextItem005; + private TestContextStringItem testGlobalContextItem006; + private TestContextLongObjectItem testGlobalContextItem007; + private TestContextDateItem testGlobalContextItem008; + private TestContextDateTzItem testGlobalContextItem009; + private TestContextDateLocaleItem testGlobalContextItem00A; + private TestContextTreeSetItem testGlobalContextItem00B; + private TestContextTreeMapItem testGlobalContextItem00C; + + /** + * Gets the test global context item 000. + * + * @return the test global context item 000 + */ + public TestContextBooleanItem getTestGlobalContextItem000() { + return testGlobalContextItem000; + } + + /** + * Sets the test global context item 000. + * + * @param testGlobalContextItem000 the test global context item 000 + */ + public void setTestGlobalContextItem000(final TestContextBooleanItem testGlobalContextItem000) { + this.testGlobalContextItem000 = testGlobalContextItem000; + } + + /** + * Gets the test global context item 001. + * + * @return the test global context item 001 + */ + public TestContextByteItem getTestGlobalContextItem001() { + return testGlobalContextItem001; + } + + /** + * Sets the test global context item 001. + * + * @param testGlobalContextItem001 the test global context item 001 + */ + public void setTestGlobalContextItem001(final TestContextByteItem testGlobalContextItem001) { + this.testGlobalContextItem001 = testGlobalContextItem001; + } + + /** + * Gets the test global context item 002. + * + * @return the test global context item 002 + */ + public TestContextIntItem getTestGlobalContextItem002() { + return testGlobalContextItem002; + } + + /** + * Sets the test global context item 002. + * + * @param testGlobalContextItem002 the test global context item 002 + */ + public void setTestGlobalContextItem002(final TestContextIntItem testGlobalContextItem002) { + this.testGlobalContextItem002 = testGlobalContextItem002; + } + + /** + * Gets the test global context item 003. + * + * @return the test global context item 003 + */ + public TestContextLongItem getTestGlobalContextItem003() { + return testGlobalContextItem003; + } + + /** + * Sets the test global context item 003. + * + * @param testGlobalContextItem003 the test global context item 003 + */ + public void setTestGlobalContextItem003(final TestContextLongItem testGlobalContextItem003) { + this.testGlobalContextItem003 = testGlobalContextItem003; + } + + /** + * Gets the test global context item 004. + * + * @return the test global context item 004 + */ + public TestContextFloatItem getTestGlobalContextItem004() { + return testGlobalContextItem004; + } + + /** + * Sets the test global context item 004. + * + * @param testGlobalContextItem004 the test global context item 004 + */ + public void setTestGlobalContextItem004(final TestContextFloatItem testGlobalContextItem004) { + this.testGlobalContextItem004 = testGlobalContextItem004; + } + + /** + * Gets the test global context item 005. + * + * @return the test global context item 005 + */ + public TestContextDoubleItem getTestGlobalContextItem005() { + return testGlobalContextItem005; + } + + /** + * Sets the test global context item 005. + * + * @param testGlobalContextItem005 the test global context item 005 + */ + public void setTestGlobalContextItem005(final TestContextDoubleItem testGlobalContextItem005) { + this.testGlobalContextItem005 = testGlobalContextItem005; + } + + /** + * Gets the test global context item 006. + * + * @return the test global context item 006 + */ + public TestContextStringItem getTestGlobalContextItem006() { + return testGlobalContextItem006; + } + + /** + * Sets the test global context item 006. + * + * @param testGlobalContextItem006 the test global context item 006 + */ + public void setTestGlobalContextItem006(final TestContextStringItem testGlobalContextItem006) { + this.testGlobalContextItem006 = testGlobalContextItem006; + } + + /** + * Gets the test global context item 007. + * + * @return the test global context item 007 + */ + public TestContextLongObjectItem getTestGlobalContextItem007() { + return testGlobalContextItem007; + } + + /** + * Sets the test global context item 007. + * + * @param testGlobalContextItem007 the test global context item 007 + */ + public void setTestGlobalContextItem007(final TestContextLongObjectItem testGlobalContextItem007) { + this.testGlobalContextItem007 = testGlobalContextItem007; + } + + /** + * Gets the test global context item 008. + * + * @return the test global context item 008 + */ + public TestContextDateItem getTestGlobalContextItem008() { + return testGlobalContextItem008; + } + + /** + * Sets the test global context item 008. + * + * @param testGlobalContextItem008 the test global context item 008 + */ + public void setTestGlobalContextItem008(final TestContextDateItem testGlobalContextItem008) { + this.testGlobalContextItem008 = testGlobalContextItem008; + } + + /** + * Gets the test global context item 009. + * + * @return the test global context item 009 + */ + public TestContextDateTzItem getTestGlobalContextItem009() { + return testGlobalContextItem009; + } + + /** + * Sets the test global context item 009. + * + * @param testGlobalContextItem009 the test global context item 009 + */ + public void setTestGlobalContextItem009(final TestContextDateTzItem testGlobalContextItem009) { + this.testGlobalContextItem009 = testGlobalContextItem009; + } + + /** + * Gets the test global context item 00 A. + * + * @return the test global context item 00 A + */ + public TestContextDateLocaleItem getTestGlobalContextItem00A() { + return testGlobalContextItem00A; + } + + /** + * Sets the test global context item 00 A. + * + * @param testGlobalContextItem00A the test global context item 00 A + */ + public void setTestGlobalContextItem00A(final TestContextDateLocaleItem testGlobalContextItem00A) { + this.testGlobalContextItem00A = testGlobalContextItem00A; + } + + /** + * Gets the test global context item 00 B. + * + * @return the test global context item 00 B + */ + public TestContextTreeSetItem getTestGlobalContextItem00B() { + return testGlobalContextItem00B; + } + + /** + * Sets the test global context item 00 B. + * + * @param testGlobalContextItem00B the test global context item 00 B + */ + public void setTestGlobalContextItem00B(final TestContextTreeSetItem testGlobalContextItem00B) { + this.testGlobalContextItem00B = testGlobalContextItem00B; + } + + /** + * Gets the test global context item 00 C. + * + * @return the test global context item 00 C + */ + public TestContextTreeMapItem getTestGlobalContextItem00C() { + return testGlobalContextItem00C; + } + + /** + * Sets the test global context item 00 C. + * + * @param testGlobalContextItem00C the test global context item 00 C + */ + public void setTestGlobalContextItem00C(final TestContextTreeMapItem testGlobalContextItem00C) { + this.testGlobalContextItem00C = testGlobalContextItem00C; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = HASH_PRIME_1; + int result = 1; + result = prime * result + ((testGlobalContextItem000 == null) ? 0 : testGlobalContextItem000.hashCode()); + result = prime * result + ((testGlobalContextItem001 == null) ? 0 : testGlobalContextItem001.hashCode()); + result = prime * result + ((testGlobalContextItem002 == null) ? 0 : testGlobalContextItem002.hashCode()); + result = prime * result + ((testGlobalContextItem003 == null) ? 0 : testGlobalContextItem003.hashCode()); + result = prime * result + ((testGlobalContextItem004 == null) ? 0 : testGlobalContextItem004.hashCode()); + result = prime * result + ((testGlobalContextItem005 == null) ? 0 : testGlobalContextItem005.hashCode()); + result = prime * result + ((testGlobalContextItem006 == null) ? 0 : testGlobalContextItem006.hashCode()); + result = prime * result + ((testGlobalContextItem007 == null) ? 0 : testGlobalContextItem007.hashCode()); + result = prime * result + ((testGlobalContextItem008 == null) ? 0 : testGlobalContextItem008.hashCode()); + result = prime * result + ((testGlobalContextItem009 == null) ? 0 : testGlobalContextItem009.hashCode()); + result = prime * result + ((testGlobalContextItem00A == null) ? 0 : testGlobalContextItem00A.hashCode()); + result = prime * result + ((testGlobalContextItem00B == null) ? 0 : testGlobalContextItem00B.hashCode()); + result = prime * result + ((testGlobalContextItem00C == null) ? 0 : testGlobalContextItem00C.hashCode()); + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TestGlobalContextItem other = (TestGlobalContextItem) obj; + if (testGlobalContextItem000 == null) { + if (other.testGlobalContextItem000 != null) { + return false; + } + } else if (!testGlobalContextItem000.equals(other.testGlobalContextItem000)) { + return false; + } + if (testGlobalContextItem001 == null) { + if (other.testGlobalContextItem001 != null) { + return false; + } + } else if (!testGlobalContextItem001.equals(other.testGlobalContextItem001)) { + return false; + } + if (testGlobalContextItem002 == null) { + if (other.testGlobalContextItem002 != null) { + return false; + } + } else if (!testGlobalContextItem002.equals(other.testGlobalContextItem002)) { + return false; + } + if (testGlobalContextItem003 == null) { + if (other.testGlobalContextItem003 != null) { + return false; + } + } else if (!testGlobalContextItem003.equals(other.testGlobalContextItem003)) { + return false; + } + if (testGlobalContextItem004 == null) { + if (other.testGlobalContextItem004 != null) { + return false; + } + } else if (!testGlobalContextItem004.equals(other.testGlobalContextItem004)) { + return false; + } + if (testGlobalContextItem005 == null) { + if (other.testGlobalContextItem005 != null) { + return false; + } + } else if (!testGlobalContextItem005.equals(other.testGlobalContextItem005)) { + return false; + } + if (testGlobalContextItem006 == null) { + if (other.testGlobalContextItem006 != null) { + return false; + } + } else if (!testGlobalContextItem006.equals(other.testGlobalContextItem006)) { + return false; + } + if (testGlobalContextItem007 == null) { + if (other.testGlobalContextItem007 != null) { + return false; + } + } else if (!testGlobalContextItem007.equals(other.testGlobalContextItem007)) { + return false; + } + if (testGlobalContextItem008 == null) { + if (other.testGlobalContextItem008 != null) { + return false; + } + } else if (!testGlobalContextItem008.equals(other.testGlobalContextItem008)) { + return false; + } + if (testGlobalContextItem009 == null) { + if (other.testGlobalContextItem009 != null) { + return false; + } + } else if (!testGlobalContextItem009.equals(other.testGlobalContextItem009)) { + return false; + } + if (testGlobalContextItem00A == null) { + if (other.testGlobalContextItem00A != null) { + return false; + } + } else if (!testGlobalContextItem00A.equals(other.testGlobalContextItem00A)) { + return false; + } + if (testGlobalContextItem00B == null) { + if (other.testGlobalContextItem00B != null) { + return false; + } + } else if (!testGlobalContextItem00B.equals(other.testGlobalContextItem00B)) { + return false; + } + if (testGlobalContextItem00C == null) { + if (other.testGlobalContextItem00C != null) { + return false; + } + } else if (!testGlobalContextItem00C.equals(other.testGlobalContextItem00C)) { + return false; + } + return true; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "TestGlobalContextItem [testGlobalContextItem000=" + testGlobalContextItem000 + + ", testGlobalContextItem001=" + testGlobalContextItem001 + ", testGlobalContextItem002=" + + testGlobalContextItem002 + ", testGlobalContextItem003=" + testGlobalContextItem003 + + ", testGlobalContextItem004=" + testGlobalContextItem004 + ", testGlobalContextItem005=" + + testGlobalContextItem005 + ", testGlobalContextItem006=" + testGlobalContextItem006 + + ", testGlobalContextItem007=" + testGlobalContextItem007 + ", testGlobalContextItem008=" + + testGlobalContextItem008 + ", testGlobalContextItem009=" + testGlobalContextItem009 + + ", testGlobalContextItem00A=" + testGlobalContextItem00A + ", testGlobalContextItem00B=" + + testGlobalContextItem00B + ", testGlobalContextItem00C=" + testGlobalContextItem00C + "]"; + } +} diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestPolicyContextItem.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestPolicyContextItem.java new file mode 100644 index 000000000..f52d60228 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/TestPolicyContextItem.java @@ -0,0 +1,242 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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.context.test.concepts; + +import java.io.Serializable; + +/** + * The Class TestPolicyContextItem. + */ +public class TestPolicyContextItem implements Serializable { + private static final long serialVersionUID = 6336372857646152910L; + + private static final int HASH_PRIME_1 = 31; + + private TestContextStringItem testPolicyContextItem000; + private TestContextLongItem testPolicyContextItem001; + private TestContextDoubleItem testPolicyContextItem002; + private TestContextBooleanItem testPolicyContextItem003; + private TestContextLongItem testPolicyContextItem004; + private TestContextTreeMapItem testPolicyContextItem005; + + /** + * Gets the test policy context item 000. + * + * @return the test policy context item 000 + */ + public TestContextStringItem getTestPolicyContextItem000() { + return testPolicyContextItem000; + } + + /** + * Sets the test policy context item 000. + * + * @param testPolicyContextItem000 the test policy context item 000 + */ + public void setTestPolicyContextItem000(final TestContextStringItem testPolicyContextItem000) { + this.testPolicyContextItem000 = testPolicyContextItem000; + } + + /** + * Gets the test policy context item 001. + * + * @return the test policy context item 001 + */ + public TestContextLongItem getTestPolicyContextItem001() { + return testPolicyContextItem001; + } + + /** + * Sets the test policy context item 001. + * + * @param testPolicyContextItem001 the test policy context item 001 + */ + public void setTestPolicyContextItem001(final TestContextLongItem testPolicyContextItem001) { + this.testPolicyContextItem001 = testPolicyContextItem001; + } + + /** + * Gets the test policy context item 002. + * + * @return the test policy context item 002 + */ + public TestContextDoubleItem getTestPolicyContextItem002() { + return testPolicyContextItem002; + } + + /** + * Sets the test policy context item 002. + * + * @param testPolicyContextItem002 the test policy context item 002 + */ + public void setTestPolicyContextItem002(final TestContextDoubleItem testPolicyContextItem002) { + this.testPolicyContextItem002 = testPolicyContextItem002; + } + + /** + * Gets the test policy context item 003. + * + * @return the test policy context item 003 + */ + public TestContextBooleanItem getTestPolicyContextItem003() { + return testPolicyContextItem003; + } + + /** + * Sets the test policy context item 003. + * + * @param testPolicyContextItem003 the test policy context item 003 + */ + public void setTestPolicyContextItem003(final TestContextBooleanItem testPolicyContextItem003) { + this.testPolicyContextItem003 = testPolicyContextItem003; + } + + /** + * Gets the test policy context item 004. + * + * @return the test policy context item 004 + */ + public TestContextLongItem getTestPolicyContextItem004() { + return testPolicyContextItem004; + } + + /** + * Sets the test policy context item 004. + * + * @param testPolicyContextItem004 the test policy context item 004 + */ + public void setTestPolicyContextItem004(final TestContextLongItem testPolicyContextItem004) { + this.testPolicyContextItem004 = testPolicyContextItem004; + } + + /** + * Gets the test policy context item 005. + * + * @return the test policy context item 005 + */ + public TestContextTreeMapItem getTestPolicyContextItem005() { + return testPolicyContextItem005; + } + + /** + * Sets the test policy context item 005. + * + * @param testPolicyContextItem005 the test policy context item 005 + */ + public void setTestPolicyContextItem005(final TestContextTreeMapItem testPolicyContextItem005) { + this.testPolicyContextItem005 = testPolicyContextItem005; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = HASH_PRIME_1; + int result = 1; + result = prime * result + ((testPolicyContextItem000 == null) ? 0 : testPolicyContextItem000.hashCode()); + result = prime * result + ((testPolicyContextItem001 == null) ? 0 : testPolicyContextItem001.hashCode()); + result = prime * result + ((testPolicyContextItem002 == null) ? 0 : testPolicyContextItem002.hashCode()); + result = prime * result + ((testPolicyContextItem003 == null) ? 0 : testPolicyContextItem003.hashCode()); + result = prime * result + ((testPolicyContextItem004 == null) ? 0 : testPolicyContextItem004.hashCode()); + result = prime * result + ((testPolicyContextItem005 == null) ? 0 : testPolicyContextItem005.hashCode()); + return result; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final TestPolicyContextItem other = (TestPolicyContextItem) obj; + if (testPolicyContextItem000 == null) { + if (other.testPolicyContextItem000 != null) { + return false; + } + } else if (!testPolicyContextItem000.equals(other.testPolicyContextItem000)) { + return false; + } + if (testPolicyContextItem001 == null) { + if (other.testPolicyContextItem001 != null) { + return false; + } + } else if (!testPolicyContextItem001.equals(other.testPolicyContextItem001)) { + return false; + } + if (testPolicyContextItem002 == null) { + if (other.testPolicyContextItem002 != null) { + return false; + } + } else if (!testPolicyContextItem002.equals(other.testPolicyContextItem002)) { + return false; + } + if (testPolicyContextItem003 == null) { + if (other.testPolicyContextItem003 != null) { + return false; + } + } else if (!testPolicyContextItem003.equals(other.testPolicyContextItem003)) { + return false; + } + if (testPolicyContextItem004 == null) { + if (other.testPolicyContextItem004 != null) { + return false; + } + } else if (!testPolicyContextItem004.equals(other.testPolicyContextItem004)) { + return false; + } + if (testPolicyContextItem005 == null) { + if (other.testPolicyContextItem005 != null) { + return false; + } + } else if (!testPolicyContextItem005.equals(other.testPolicyContextItem005)) { + return false; + } + return true; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "TestPolicyContextItem [testPolicyContextItem000=" + testPolicyContextItem000 + + ", testPolicyContextItem001=" + testPolicyContextItem001 + ", testPolicyContextItem002=" + + testPolicyContextItem002 + ", testPolicyContextItem003=" + testPolicyContextItem003 + + ", testPolicyContextItem004=" + testPolicyContextItem004 + ", testPolicyContextItem005=" + + testPolicyContextItem005 + "]"; + } +} diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/package-info.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/package-info.java new file mode 100644 index 000000000..547d23878 --- /dev/null +++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/context/test/concepts/package-info.java @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * 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========================================================= + */ + +/** + * Defines test Java context classes. + * + * @author Liam Fallon (liam.fallon@ericsson.com) + */ + +package org.onap.policy.apex.context.test.concepts; diff --git a/testsuites/integration/integration-context-test/pom.xml b/testsuites/integration/integration-context-test/pom.xml index f8a96fd12..361d20a98 100644 --- a/testsuites/integration/integration-context-test/pom.xml +++ b/testsuites/integration/integration-context-test/pom.xml @@ -44,6 +44,12 @@ ${project.version} test + + org.onap.policy.apex-pdp.testsuites.integration + integration-common + ${project.version} + test + org.onap.policy.apex-pdp.plugins.plugins-context.plugins-context-distribution plugins-context-distribution-hazelcast diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/TestConcurrentContext.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/TestConcurrentContext.java index aa806b5e8..0759b7eeb 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/TestConcurrentContext.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/TestConcurrentContext.java @@ -45,6 +45,7 @@ import org.onap.policy.apex.context.parameters.ContextParameterConstants; import org.onap.policy.apex.context.parameters.ContextParameters; import org.onap.policy.apex.context.parameters.DistributorParameters; import org.onap.policy.apex.context.parameters.SchemaParameters; +import org.onap.policy.apex.context.test.concepts.TestContextLongItem; import org.onap.policy.apex.core.infrastructure.messaging.util.MessagingUtils; import org.onap.policy.apex.model.basicmodel.concepts.ApexException; import org.onap.policy.apex.model.basicmodel.handling.ApexModelException; @@ -54,7 +55,6 @@ import org.onap.policy.apex.plugins.context.distribution.infinispan.InfinispanDi import org.onap.policy.apex.plugins.context.locking.curator.CuratorLockManager; import org.onap.policy.apex.plugins.context.locking.curator.CuratorLockManagerParameters; import org.onap.policy.apex.plugins.context.locking.hazelcast.HazelcastLockManager; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextLongItem; import org.onap.policy.apex.testsuites.integration.context.lock.modifier.LockType; import org.onap.policy.apex.testsuites.integration.context.locking.ConcurrentContext; import org.onap.policy.apex.testsuites.integration.context.utils.ConfigrationProvider; diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextBooleanItem.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextBooleanItem.java deleted file mode 100644 index 24193848b..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextBooleanItem.java +++ /dev/null @@ -1,112 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.testsuites.integration.context.concepts; - -import java.io.Serializable; - -/** - * The Class TestContextItem000. - */ -public class TestContextBooleanItem implements Serializable { - private static final int HASH_PRIME_1 = 31; - private static final int HASH_PRIME_2 = 1231; - private static final int HASH_PRIME_3 = 1237; - - private static final long serialVersionUID = 7241008665286367796L; - - private boolean flag = false; - - /** - * The Constructor. - */ - public TestContextBooleanItem() {} - - /** - * The Constructor. - * - * @param flag the flag - */ - public TestContextBooleanItem(final Boolean flag) { - this.flag = flag; - } - - /** - * Gets the flag. - * - * @return the flag - */ - public boolean getFlag() { - return flag; - } - - /** - * Sets the flag. - * - * @param flag the flag - */ - public void setFlag(final boolean flag) { - this.flag = flag; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = HASH_PRIME_1; - int result = 1; - result = prime * result + (flag ? HASH_PRIME_2 : HASH_PRIME_3); - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TestContextBooleanItem other = (TestContextBooleanItem) obj; - return flag == other.flag; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "TestContextItem000 [flag=" + flag + "]"; - } -} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextByteItem.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextByteItem.java deleted file mode 100644 index a6d4b1a1e..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextByteItem.java +++ /dev/null @@ -1,110 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.testsuites.integration.context.concepts; - -import java.io.Serializable; - -/** - * The Class TestContextItem001. - */ -public class TestContextByteItem implements Serializable { - private static final long serialVersionUID = 1361938145823720386L; - - private static final int HASH_PRIME_1 = 31; - - private byte byteValue = 0; - - /** - * The Constructor. - */ - public TestContextByteItem() {} - - /** - * The Constructor. - * - * @param byteValue the byte value - */ - public TestContextByteItem(final Byte byteValue) { - this.byteValue = byteValue; - } - - /** - * Gets the byte value. - * - * @return the byte value - */ - public byte getByteValue() { - return byteValue; - } - - /** - * Sets the byte value. - * - * @param byteValue the byte value - */ - public void setByteValue(final byte byteValue) { - this.byteValue = byteValue; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = HASH_PRIME_1; - int result = 1; - result = prime * result + byteValue; - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TestContextByteItem other = (TestContextByteItem) obj; - return byteValue == other.byteValue; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "TestContextItem001 [byteValue=" + byteValue + "]"; - } -} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDateItem.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDateItem.java deleted file mode 100644 index 9cd3c6e81..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDateItem.java +++ /dev/null @@ -1,242 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.testsuites.integration.context.concepts; - -import java.io.Serializable; -import java.util.Calendar; -import java.util.Date; -import java.util.TimeZone; - -/** - * The Class TestContextItem008. - */ -public class TestContextDateItem implements Serializable { - private static final long serialVersionUID = -6984963129968805460L; - - private static final int HASH_PRIME_1 = 31; - private static final int FOUR_BYTES = 32; - - private long time; - - private int year; - private int month; - private int day; - private int hour; - private int minute; - private int second; - private int milliSecond; - - /** - * The Constructor. - */ - public TestContextDateItem() { - this(new Date(System.currentTimeMillis())); - } - - /** - * The Constructor. - * - * @param dateValue the date value - */ - public TestContextDateItem(final Date dateValue) { - if (dateValue != null) { - setDateValue(dateValue.getTime()); - } - else { - new Date(0); - } - } - - /** - * The Constructor. - * - * @param time the time - */ - public TestContextDateItem(final long time) { - setDateValue(time); - } - - /** - * Gets the time. - * - * @return the time - */ - public long getTime() { - return time; - } - - /** - * Gets the year. - * - * @return the year - */ - public int getYear() { - return year; - } - - /** - * Gets the month. - * - * @return the month - */ - public int getMonth() { - return month; - } - - /** - * Gets the day. - * - * @return the day - */ - public int getDay() { - return day; - } - - /** - * Gets the hour. - * - * @return the hour - */ - public int getHour() { - return hour; - } - - /** - * Gets the minute. - * - * @return the minute - */ - public int getMinute() { - return minute; - } - - /** - * Gets the second. - * - * @return the second - */ - public int getSecond() { - return second; - } - - /** - * Gets the milli second. - * - * @return the milli second - */ - public int getMilliSecond() { - return milliSecond; - } - - /** - * Gets the date value. - * - * @return the date value - */ - public Date getDateValue() { - return new Date(time); - } - - /** - * Sets the date value. - * - * @param dateValue the date value - */ - public void setDateValue(final Date dateValue) { - if (dateValue != null) { - setDateValue(dateValue.getTime()); - } - } - - /** - * Sets the date value. - * - * @param dateValue the date value - */ - public void setDateValue(final long dateValue) { - this.time = dateValue; - - final Calendar calendar = Calendar.getInstance(); - calendar.setTimeZone(TimeZone.getTimeZone("UTC")); - calendar.setTimeInMillis(time); - - year = calendar.get(Calendar.YEAR); - month = calendar.get(Calendar.MONTH); - day = calendar.get(Calendar.DAY_OF_MONTH); - hour = calendar.get(Calendar.HOUR); - minute = calendar.get(Calendar.MINUTE); - second = calendar.get(Calendar.SECOND); - milliSecond = calendar.get(Calendar.MILLISECOND); - } - - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = HASH_PRIME_1; - int result = 1; - result = prime * result + day; - result = prime * result + hour; - result = prime * result + milliSecond; - result = prime * result + minute; - result = prime * result + month; - result = prime * result + second; - result = prime * result + (int) (time ^ (time >>> FOUR_BYTES)); - result = prime * result + year; - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TestContextDateItem other = (TestContextDateItem) obj; - return time == other.time; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "TestContextItem008 [time=" + time + ", year=" + year + ", month=" + month + ", day=" + day + ", hour=" - + hour + ", minute=" + minute + ", second=" + second + ", milliSecond=" + milliSecond + "]"; - } -} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDateLocaleItem.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDateLocaleItem.java deleted file mode 100644 index 28c3e9ee3..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDateLocaleItem.java +++ /dev/null @@ -1,254 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.testsuites.integration.context.concepts; - -import java.io.Serializable; -import java.util.Locale; -import java.util.TimeZone; - -/** - * The Class TestContextItem00A. - */ -public class TestContextDateLocaleItem implements Serializable { - private static final long serialVersionUID = -6579903685538233754L; - - private static final int HASH_PRIME_1 = 31; - private static final int HASH_PRIME_2 = 1231; - private static final int HASH_PRIME_3 = 1237; - - private TestContextDateItem dateValue = new TestContextDateItem(System.currentTimeMillis()); - private String timeZoneString = TimeZone.getTimeZone("Europe/Dublin").getDisplayName(); - private boolean dst = false; - private int utcOffset = 0; - private Locale locale = Locale.ENGLISH; - - /** - * The Constructor. - */ - public TestContextDateLocaleItem() { - } - - /** - * The Constructor. - * - * @param dateValue the date value - * @param tzValue the tz value - * @param dst the dst - * @param utcOffset the utc offset - * @param language the language - * @param country the country - */ - public TestContextDateLocaleItem(final TestContextDateItem dateValue, final String tzValue, final boolean dst, - final int utcOffset, final String language, final String country) { - this.dateValue = dateValue; - this.timeZoneString = TimeZone.getTimeZone(tzValue).getDisplayName(); - this.dst = dst; - this.utcOffset = utcOffset; - - this.locale = new Locale(language, country); - } - - /** - * The Constructor. - * - * @param original the original - */ - public TestContextDateLocaleItem(final TestContextDateLocaleItem original) { - this.dateValue = original.dateValue; - this.timeZoneString = TimeZone.getTimeZone(original.timeZoneString).getDisplayName(); - this.dst = original.dst; - this.utcOffset = original.utcOffset; - - this.locale = new Locale(original.getLocale().getCountry(), original.getLocale().getLanguage()); - } - - /** - * Gets the date value. - * - * @return the date value - */ - public TestContextDateItem getDateValue() { - return dateValue; - } - - /** - * Sets the date value. - * - * @param dateValue the date value - */ - public void setDateValue(final TestContextDateItem dateValue) { - this.dateValue = dateValue; - } - - /** - * Gets the TZ value. - * - * @return the TZ value - */ - public String getTzValue() { - return timeZoneString; - } - - /** - * Sets the TZ value. - * - * @param tzValue the TZ value - */ - public void setTzValue(final String tzValue) { - if (tzValue != null) { - this.timeZoneString = TimeZone.getTimeZone(tzValue).getDisplayName(); - } else { - this.timeZoneString = null; - } - } - - /** - * Gets the DST. - * - * @return the dst - */ - public boolean getDst() { - return dst; - } - - /** - * Sets the DST. - * - * @param newDst the dst - */ - public void setDst(final boolean newDst) { - this.dst = newDst; - } - - /** - * Gets the UTC offset. - * - * @return the UTC offset - */ - public int getUtcOffset() { - return utcOffset; - } - - /** - * Sets the UTC offset. - * - * @param newUtcOffset the UTC offset - */ - public void setUtcOffset(final int newUtcOffset) { - this.utcOffset = newUtcOffset; - } - - /** - * Gets the locale. - * - * @return the locale - */ - public Locale getLocale() { - return locale; - } - - /** - * Sets the locale. - * - * @param locale the locale - */ - public void setLocale(final Locale locale) { - if (locale != null) { - this.locale = locale; - } - else { - this.locale = null; - } - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = HASH_PRIME_1; - int result = 1; - result = prime * result + ((dateValue == null) ? 0 : dateValue.hashCode()); - result = prime * result + (dst ? HASH_PRIME_2 : HASH_PRIME_3); - result = prime * result + ((locale == null) ? 0 : locale.hashCode()); - result = prime * result + ((timeZoneString == null) ? 0 : timeZoneString.hashCode()); - result = prime * result + utcOffset; - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TestContextDateLocaleItem other = (TestContextDateLocaleItem) obj; - if (dateValue == null) { - if (other.dateValue != null) { - return false; - } - } else if (!dateValue.equals(other.dateValue)) { - return false; - } - if (dst != other.dst) { - return false; - } - if (locale == null) { - if (other.locale != null) { - return false; - } - } else if (!locale.equals(other.locale)) { - return false; - } - if (timeZoneString == null) { - if (other.timeZoneString != null) { - return false; - } - } else if (!timeZoneString.equals(other.timeZoneString)) { - return false; - } - return utcOffset == other.utcOffset; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "TestContextItem00A [dateValue=" + dateValue + ", timeZoneString=" + timeZoneString + ", dst=" + dst - + ", utcOffset=" + utcOffset + ", locale=" + locale + "]"; - } -} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDateTzItem.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDateTzItem.java deleted file mode 100644 index b081cd55f..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDateTzItem.java +++ /dev/null @@ -1,193 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.testsuites.integration.context.concepts; - -import java.io.Serializable; -import java.util.TimeZone; - -/** - * The Class TestContextItem009. - */ -public class TestContextDateTzItem implements Serializable { - private static final long serialVersionUID = 5604426823170331706L; - - private static final int HASH_PRIME_1 = 31; - private static final int HASH_PRIME_2 = 1231; - private static final int HASH_PRIME_3 = 1237; - - private TestContextDateItem dateValue = new TestContextDateItem(System.currentTimeMillis()); - private String timeZoneString = TimeZone.getTimeZone("Europe/Dublin").getDisplayName(); - private boolean dst = false; - - /** - * The Constructor. - */ - public TestContextDateTzItem() { - dst = true; - } - - /** - * The Constructor. - * - * @param dateValue the date value - * @param tzValue the tz value - * @param dst the dst - */ - public TestContextDateTzItem(final TestContextDateItem dateValue, final String tzValue, final boolean dst) { - this.dateValue = dateValue; - this.timeZoneString = TimeZone.getTimeZone(tzValue).getDisplayName(); - this.dst = dst; - } - - /** - * The Constructor. - * - * @param original the original - */ - public TestContextDateTzItem(final TestContextDateTzItem original) { - this.dateValue = original.dateValue; - this.timeZoneString = original.timeZoneString; - this.dst = original.dst; - } - - /** - * Gets the date value. - * - * @return the date value - */ - public TestContextDateItem getDateValue() { - return dateValue; - } - - /** - * Sets the date value. - * - * @param dateValue the date value - */ - public void setDateValue(final TestContextDateItem dateValue) { - this.dateValue = dateValue; - } - - /** - * Gets the TZ value. - * - * @return the TZ value - */ - public String getTzValue() { - return timeZoneString; - } - - /** - * Sets the TZ value. - * - * @param tzValue the TZ value - */ - public void setTzValue(final String tzValue) { - if (tzValue != null) { - this.timeZoneString = TimeZone.getTimeZone(tzValue).getDisplayName(); - } - else { - this.timeZoneString = null; - } - } - - /** - * Gets the DST. - * - * @return the dst - */ - public boolean getDst() { - return dst; - } - - /** - * Sets the DST. - * - * @param newDst the dst - */ - public void setDst(final boolean newDst) { - this.dst = newDst; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = HASH_PRIME_1; - int result = 1; - result = prime * result + ((dateValue == null) ? 0 : dateValue.hashCode()); - result = prime * result + (dst ? HASH_PRIME_2 : HASH_PRIME_3); - result = prime * result + ((timeZoneString == null) ? 0 : timeZoneString.hashCode()); - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TestContextDateTzItem other = (TestContextDateTzItem) obj; - if (dateValue == null) { - if (other.dateValue != null) { - return false; - } - } else if (!dateValue.equals(other.dateValue)) { - return false; - } - if (dst != other.dst) { - return false; - } - if (timeZoneString == null) { - if (other.timeZoneString != null) { - return false; - } - } - else if (!timeZoneString.equals(other.timeZoneString)) { - return false; - } - return true; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "TestContextItem009 [dateValue=" + dateValue + ", tzValue=" + timeZoneString + ", dst=" + dst + "]"; - } -} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDoubleItem.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDoubleItem.java deleted file mode 100644 index 19f756051..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextDoubleItem.java +++ /dev/null @@ -1,113 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.testsuites.integration.context.concepts; - -import java.io.Serializable; - -/** - * The Class TestContextItem005. - */ -public class TestContextDoubleItem implements Serializable { - private static final long serialVersionUID = -2958758261076734821L; - - private static final int HASH_PRIME_1 = 31; - private static final int FOUR_BYTES = 32; - - private double doubleValue = 0; - - /** - * The Constructor. - */ - public TestContextDoubleItem() {} - - /** - * The Constructor. - * - * @param doubleValue the double value - */ - public TestContextDoubleItem(final Double doubleValue) { - this.doubleValue = doubleValue; - } - - /** - * Gets the double value. - * - * @return the double value - */ - public double getDoubleValue() { - return doubleValue; - } - - /** - * Sets the double value. - * - * @param doubleValue the double value - */ - public void setDoubleValue(final double doubleValue) { - this.doubleValue = doubleValue; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = HASH_PRIME_1; - int result = 1; - long temp; - temp = Double.doubleToLongBits(doubleValue); - result = prime * result + (int) (temp ^ (temp >>> FOUR_BYTES)); - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TestContextDoubleItem other = (TestContextDoubleItem) obj; - return Double.doubleToLongBits(doubleValue) == Double.doubleToLongBits(other.doubleValue); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "TestContextItem005 [doubleValue=" + doubleValue + "]"; - } -} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextFloatItem.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextFloatItem.java deleted file mode 100644 index 0883c1d8f..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextFloatItem.java +++ /dev/null @@ -1,110 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.testsuites.integration.context.concepts; - -import java.io.Serializable; - -/** - * The Class TestContextItem004. - */ -public class TestContextFloatItem implements Serializable { - private static final long serialVersionUID = -3359180576903272400L; - - private static final int HASH_PRIME_1 = 31; - - private float floatValue = 0; - - /** - * The Constructor. - */ - public TestContextFloatItem() {} - - /** - * The Constructor. - * - * @param floatValue the float value - */ - public TestContextFloatItem(final Float floatValue) { - this.floatValue = floatValue; - } - - /** - * Gets the float value. - * - * @return the float value - */ - public float getFloatValue() { - return floatValue; - } - - /** - * Sets the float value. - * - * @param floatValue the float value - */ - public void setFloatValue(final float floatValue) { - this.floatValue = floatValue; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = HASH_PRIME_1; - int result = 1; - result = prime * result + Float.floatToIntBits(floatValue); - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TestContextFloatItem other = (TestContextFloatItem) obj; - return Float.floatToIntBits(floatValue) == Float.floatToIntBits(other.floatValue); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "TestContextItem004 [floatValue=" + floatValue + "]"; - } -} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextIntItem.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextIntItem.java deleted file mode 100644 index 5932769b3..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextIntItem.java +++ /dev/null @@ -1,119 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.testsuites.integration.context.concepts; - -import java.io.Serializable; - -/** - * The Class TestContextItem002. - */ -public class TestContextIntItem implements Serializable { - private static final long serialVersionUID = -8978435658277900984L; - - private static final int HASH_PRIME_1 = 31; - - private int intValue = 0; - - /** - * The Constructor. - */ - public TestContextIntItem() {} - - /** - * The Constructor. - * - * @param intValue the int value - */ - public TestContextIntItem(final Integer intValue) { - this.intValue = intValue; - } - - /** - * The Constructor. - * - * @param original the original - */ - public TestContextIntItem(final TestContextIntItem original) { - this.intValue = original.intValue; - } - - /** - * Gets the int value. - * - * @return the int value - */ - public int getIntValue() { - return intValue; - } - - /** - * Sets the int value. - * - * @param intValue the int value - */ - public void setIntValue(final int intValue) { - this.intValue = intValue; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = HASH_PRIME_1; - int result = 1; - result = prime * result + intValue; - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TestContextIntItem other = (TestContextIntItem) obj; - return intValue == other.intValue; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "TestContextItem002 [intValue=" + intValue + "]"; - } -} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextLongItem.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextLongItem.java deleted file mode 100644 index 8ab1c2bd0..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextLongItem.java +++ /dev/null @@ -1,111 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.testsuites.integration.context.concepts; - -import java.io.Serializable; - -/** - * The Class TestContextItem003. - */ -public class TestContextLongItem implements Serializable { - private static final long serialVersionUID = 3599267534512489386L; - - private static final int HASH_PRIME_1 = 31; - private static final int FOUR_BYTES = 33; - - private long longValue = 0; - - /** - * The Constructor. - */ - public TestContextLongItem() {} - - /** - * The Constructor. - * - * @param longValue the long value - */ - public TestContextLongItem(final Long longValue) { - this.longValue = longValue; - } - - /** - * Gets the long value. - * - * @return the long value - */ - public long getLongValue() { - return longValue; - } - - /** - * Sets the long value. - * - * @param longValue the long value - */ - public void setLongValue(final long longValue) { - this.longValue = longValue; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = HASH_PRIME_1; - int result = 1; - result = prime * result + (int) (longValue ^ (longValue >>> FOUR_BYTES)); - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TestContextLongItem other = (TestContextLongItem) obj; - return longValue == other.longValue; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "TestContextItem003 [longValue=" + longValue + "]"; - } -} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextLongObjectItem.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextLongObjectItem.java deleted file mode 100644 index 56b027279..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextLongObjectItem.java +++ /dev/null @@ -1,117 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.testsuites.integration.context.concepts; - -import java.io.Serializable; - -/** - * The Class TestContextItem007. - */ -public class TestContextLongObjectItem implements Serializable { - private static final long serialVersionUID = -1029406737866392421L; - - private static final int HASH_PRIME_1 = 31; - - private Long longValue = 0L; - - /** - * The Constructor. - */ - public TestContextLongObjectItem() {} - - /** - * The Constructor. - * - * @param longValue the long value - */ - public TestContextLongObjectItem(final Long longValue) { - this.longValue = longValue; - } - - /** - * Gets the long value. - * - * @return the long value - */ - public Long getLongValue() { - return longValue; - } - - /** - * Sets the long value. - * - * @param longValue the long value - */ - public void setLongValue(final Long longValue) { - this.longValue = longValue; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = HASH_PRIME_1; - int result = 1; - result = prime * result + ((longValue == null) ? 0 : longValue.hashCode()); - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TestContextLongObjectItem other = (TestContextLongObjectItem) obj; - if (longValue == null) { - if (other.longValue != null) { - return false; - } - } else if (!longValue.equals(other.longValue)) { - return false; - } - return true; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "TestContextItem007 [longValue=" + longValue + "]"; - } -} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextStringItem.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextStringItem.java deleted file mode 100644 index bbf3167ad..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextStringItem.java +++ /dev/null @@ -1,117 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.testsuites.integration.context.concepts; - -import java.io.Serializable; - -/** - * The Class TestContextItem006. - */ -public class TestContextStringItem implements Serializable { - private static final long serialVersionUID = -1074772190611125121L; - - private static final int HASH_PRIME_1 = 31; - - private String stringValue = ""; - - /** - * The Constructor. - */ - public TestContextStringItem() {} - - /** - * The Constructor. - * - * @param stringValue the string value - */ - public TestContextStringItem(final String stringValue) { - this.stringValue = stringValue; - } - - /** - * Gets the string value. - * - * @return the string value - */ - public String getStringValue() { - return stringValue; - } - - /** - * Sets the string value. - * - * @param stringValue the string value - */ - public void setStringValue(final String stringValue) { - this.stringValue = stringValue; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = HASH_PRIME_1; - int result = 1; - result = prime * result + ((stringValue == null) ? 0 : stringValue.hashCode()); - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TestContextStringItem other = (TestContextStringItem) obj; - if (stringValue == null) { - if (other.stringValue != null) { - return false; - } - } else if (!stringValue.equals(other.stringValue)) { - return false; - } - return true; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "TestContextItem006 [stringValue=" + stringValue + "]"; - } -} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextTreeMapItem.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextTreeMapItem.java deleted file mode 100644 index 0d5741a8e..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextTreeMapItem.java +++ /dev/null @@ -1,123 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.testsuites.integration.context.concepts; - -import java.io.Serializable; -import java.util.Map; -import java.util.TreeMap; - -/** - * The Class TestContextItem00C. - */ -public class TestContextTreeMapItem implements Serializable { - private static final long serialVersionUID = -7497746259264651884L; - - private static final int HASH_PRIME_1 = 31; - - private Map mapValue = new TreeMap<>(); - - /** - * The Constructor. - */ - public TestContextTreeMapItem() {} - - /** - * The Constructor. - * - * @param mapValue the map value - */ - public TestContextTreeMapItem(final Map mapValue) { - this.mapValue = mapValue; - } - - /** - * Gets the map value. - * - * @return the map value - */ - public Map getMapValue() { - if (mapValue == null) { - mapValue = new TreeMap<>(); - } - return mapValue; - } - - /** - * Sets the map value. - * - * @param mapValue the map value - */ - public void setMapValue(final Map mapValue) { - this.mapValue = mapValue; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = HASH_PRIME_1; - int result = 1; - result = prime * result + ((mapValue == null) ? 0 : mapValue.hashCode()); - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TestContextTreeMapItem other = (TestContextTreeMapItem) obj; - if (mapValue == null) { - if (other.mapValue != null) { - return false; - } - } else if (!mapValue.equals(other.mapValue)) { - return false; - } - return true; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "TestContextItem00C [mapValue=" + mapValue + "]"; - } - -} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextTreeSetItem.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextTreeSetItem.java deleted file mode 100644 index 80cd3b179..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestContextTreeSetItem.java +++ /dev/null @@ -1,133 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.testsuites.integration.context.concepts; - -import java.io.Serializable; -import java.util.Arrays; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; - -/** - * The Class TestContextItem00B. - */ -public class TestContextTreeSetItem implements Serializable { - private static final long serialVersionUID = 1254589722957250388L; - - private static final int HASH_PRIME_1 = 31; - - private SortedSet setValue = new TreeSet<>(); - - /** - * The Constructor. - */ - public TestContextTreeSetItem() {} - - /** - * The Constructor. - * - * @param setArray the set array - */ - public TestContextTreeSetItem(final String[] setArray) { - this.setValue = new TreeSet<>(Arrays.asList(setArray)); - } - - /** - * The Constructor. - * - * @param setValue the set value - */ - public TestContextTreeSetItem(final SortedSet setValue) { - this.setValue = setValue; - } - - /** - * Gets the set value. - * - * @return the sets the value - */ - public Set getSetValue() { - if (setValue == null) { - setValue = new TreeSet<>(); - } - return setValue; - } - - /** - * Sets the set value. - * - * @param setValue the sets the value - */ - public void setSetValue(final SortedSet setValue) { - this.setValue = setValue; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = HASH_PRIME_1; - int result = 1; - result = prime * result + ((setValue == null) ? 0 : setValue.hashCode()); - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TestContextTreeSetItem other = (TestContextTreeSetItem) obj; - if (setValue == null) { - if (other.setValue != null) { - return false; - } - } else if (!setValue.equals(other.setValue)) { - return false; - } - return true; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "TestContextItem00B [setValue=" + setValue + "]"; - } -} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestExternalContextItem.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestExternalContextItem.java deleted file mode 100644 index fbf5e6c80..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestExternalContextItem.java +++ /dev/null @@ -1,435 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.testsuites.integration.context.concepts; - -import java.io.Serializable; - -/** - * The Class TestExternalContextItem. - */ -public class TestExternalContextItem implements Serializable { - private static final long serialVersionUID = 3512435733818672173L; - - private static final int HASH_PRIME_1 = 31; - - private TestContextBooleanItem testExternalContextItem000; - private TestContextByteItem testExternalContextItem001; - private TestContextIntItem testExternalContextItem002; - private TestContextLongItem testExternalContextItem003; - private TestContextFloatItem testExternalContextItem004; - private TestContextDoubleItem testExternalContextItem005; - private TestContextStringItem testExternalContextItem006; - private TestContextLongObjectItem testExternalContextItem007; - private TestContextDateItem testExternalContextItem008; - private TestContextDateTzItem testExternalContextItem009; - private TestContextDateLocaleItem testExternalContextItem00A; - private TestContextTreeSetItem testExternalContextItem00B; - private TestContextTreeMapItem testExternalContextItem00C; - - /** - * Gets the test external context item 000. - * - * @return the test external context item 000 - */ - public TestContextBooleanItem getTestExternalContextItem000() { - return testExternalContextItem000; - } - - /** - * Sets the test external context item 000. - * - * @param testExternalContextItem000 the test external context item 000 - */ - public void setTestExternalContextItem000(final TestContextBooleanItem testExternalContextItem000) { - this.testExternalContextItem000 = testExternalContextItem000; - } - - /** - * Gets the test external context item 001. - * - * @return the test external context item 001 - */ - public TestContextByteItem getTestExternalContextItem001() { - return testExternalContextItem001; - } - - /** - * Sets the test external context item 001. - * - * @param testExternalContextItem001 the test external context item 001 - */ - public void setTestExternalContextItem001(final TestContextByteItem testExternalContextItem001) { - this.testExternalContextItem001 = testExternalContextItem001; - } - - /** - * Gets the test external context item 002. - * - * @return the test external context item 002 - */ - public TestContextIntItem getTestExternalContextItem002() { - return testExternalContextItem002; - } - - /** - * Sets the test external context item 002. - * - * @param testExternalContextItem002 the test external context item 002 - */ - public void setTestExternalContextItem002(final TestContextIntItem testExternalContextItem002) { - this.testExternalContextItem002 = testExternalContextItem002; - } - - /** - * Gets the test external context item 003. - * - * @return the test external context item 003 - */ - public TestContextLongItem getTestExternalContextItem003() { - return testExternalContextItem003; - } - - /** - * Sets the test external context item 003. - * - * @param testExternalContextItem003 the test external context item 003 - */ - public void setTestExternalContextItem003(final TestContextLongItem testExternalContextItem003) { - this.testExternalContextItem003 = testExternalContextItem003; - } - - /** - * Gets the test external context item 004. - * - * @return the test external context item 004 - */ - public TestContextFloatItem getTestExternalContextItem004() { - return testExternalContextItem004; - } - - /** - * Sets the test external context item 004. - * - * @param testExternalContextItem004 the test external context item 004 - */ - public void setTestExternalContextItem004(final TestContextFloatItem testExternalContextItem004) { - this.testExternalContextItem004 = testExternalContextItem004; - } - - /** - * Gets the test external context item 005. - * - * @return the test external context item 005 - */ - public TestContextDoubleItem getTestExternalContextItem005() { - return testExternalContextItem005; - } - - /** - * Sets the test external context item 005. - * - * @param testExternalContextItem005 the test external context item 005 - */ - public void setTestExternalContextItem005(final TestContextDoubleItem testExternalContextItem005) { - this.testExternalContextItem005 = testExternalContextItem005; - } - - /** - * Gets the test external context item 006. - * - * @return the test external context item 006 - */ - public TestContextStringItem getTestExternalContextItem006() { - return testExternalContextItem006; - } - - /** - * Sets the test external context item 006. - * - * @param testExternalContextItem006 the test external context item 006 - */ - public void setTestExternalContextItem006(final TestContextStringItem testExternalContextItem006) { - this.testExternalContextItem006 = testExternalContextItem006; - } - - /** - * Gets the test external context item 007. - * - * @return the test external context item 007 - */ - public TestContextLongObjectItem getTestExternalContextItem007() { - return testExternalContextItem007; - } - - /** - * Sets the test external context item 007. - * - * @param testExternalContextItem007 the test external context item 007 - */ - public void setTestExternalContextItem007(final TestContextLongObjectItem testExternalContextItem007) { - this.testExternalContextItem007 = testExternalContextItem007; - } - - /** - * Gets the test external context item 008. - * - * @return the test external context item 008 - */ - public TestContextDateItem getTestExternalContextItem008() { - return testExternalContextItem008; - } - - /** - * Sets the test external context item 008. - * - * @param testExternalContextItem008 the test external context item 008 - */ - public void setTestExternalContextItem008(final TestContextDateItem testExternalContextItem008) { - this.testExternalContextItem008 = testExternalContextItem008; - } - - /** - * Gets the test external context item 009. - * - * @return the test external context item 009 - */ - public TestContextDateTzItem getTestExternalContextItem009() { - return testExternalContextItem009; - } - - /** - * Sets the test external context item 009. - * - * @param testExternalContextItem009 the test external context item 009 - */ - public void setTestExternalContextItem009(final TestContextDateTzItem testExternalContextItem009) { - this.testExternalContextItem009 = testExternalContextItem009; - } - - /** - * Gets the test external context item 00 A. - * - * @return the test external context item 00 A - */ - public TestContextDateLocaleItem getTestExternalContextItem00A() { - return testExternalContextItem00A; - } - - /** - * Sets the test external context item 00 A. - * - * @param testExternalContextItem00A the test external context item 00 A - */ - public void setTestExternalContextItem00A(final TestContextDateLocaleItem testExternalContextItem00A) { - this.testExternalContextItem00A = testExternalContextItem00A; - } - - /** - * Gets the test external context item 00 B. - * - * @return the test external context item 00 B - */ - public TestContextTreeSetItem getTestExternalContextItem00B() { - return testExternalContextItem00B; - } - - /** - * Sets the test external context item 00 B. - * - * @param testExternalContextItem00B the test external context item 00 B - */ - public void setTestExternalContextItem00B(final TestContextTreeSetItem testExternalContextItem00B) { - this.testExternalContextItem00B = testExternalContextItem00B; - } - - /** - * Gets the test external context item 00 C. - * - * @return the test external context item 00 C - */ - public TestContextTreeMapItem getTestExternalContextItem00C() { - return testExternalContextItem00C; - } - - /** - * Sets the test external context item 00 C. - * - * @param testExternalContextItem00C the test external context item 00 C - */ - public void setTestExternalContextItem00C(final TestContextTreeMapItem testExternalContextItem00C) { - this.testExternalContextItem00C = testExternalContextItem00C; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = HASH_PRIME_1; - int result = 1; - result = prime * result + ((testExternalContextItem000 == null) ? 0 : testExternalContextItem000.hashCode()); - result = prime * result + ((testExternalContextItem001 == null) ? 0 : testExternalContextItem001.hashCode()); - result = prime * result + ((testExternalContextItem002 == null) ? 0 : testExternalContextItem002.hashCode()); - result = prime * result + ((testExternalContextItem003 == null) ? 0 : testExternalContextItem003.hashCode()); - result = prime * result + ((testExternalContextItem004 == null) ? 0 : testExternalContextItem004.hashCode()); - result = prime * result + ((testExternalContextItem005 == null) ? 0 : testExternalContextItem005.hashCode()); - result = prime * result + ((testExternalContextItem006 == null) ? 0 : testExternalContextItem006.hashCode()); - result = prime * result + ((testExternalContextItem007 == null) ? 0 : testExternalContextItem007.hashCode()); - result = prime * result + ((testExternalContextItem008 == null) ? 0 : testExternalContextItem008.hashCode()); - result = prime * result + ((testExternalContextItem009 == null) ? 0 : testExternalContextItem009.hashCode()); - result = prime * result + ((testExternalContextItem00A == null) ? 0 : testExternalContextItem00A.hashCode()); - result = prime * result + ((testExternalContextItem00B == null) ? 0 : testExternalContextItem00B.hashCode()); - result = prime * result + ((testExternalContextItem00C == null) ? 0 : testExternalContextItem00C.hashCode()); - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TestExternalContextItem other = (TestExternalContextItem) obj; - if (testExternalContextItem000 == null) { - if (other.testExternalContextItem000 != null) { - return false; - } - } else if (!testExternalContextItem000.equals(other.testExternalContextItem000)) { - return false; - } - if (testExternalContextItem001 == null) { - if (other.testExternalContextItem001 != null) { - return false; - } - } else if (!testExternalContextItem001.equals(other.testExternalContextItem001)) { - return false; - } - if (testExternalContextItem002 == null) { - if (other.testExternalContextItem002 != null) { - return false; - } - } else if (!testExternalContextItem002.equals(other.testExternalContextItem002)) { - return false; - } - if (testExternalContextItem003 == null) { - if (other.testExternalContextItem003 != null) { - return false; - } - } else if (!testExternalContextItem003.equals(other.testExternalContextItem003)) { - return false; - } - if (testExternalContextItem004 == null) { - if (other.testExternalContextItem004 != null) { - return false; - } - } else if (!testExternalContextItem004.equals(other.testExternalContextItem004)) { - return false; - } - if (testExternalContextItem005 == null) { - if (other.testExternalContextItem005 != null) { - return false; - } - } else if (!testExternalContextItem005.equals(other.testExternalContextItem005)) { - return false; - } - if (testExternalContextItem006 == null) { - if (other.testExternalContextItem006 != null) { - return false; - } - } else if (!testExternalContextItem006.equals(other.testExternalContextItem006)) { - return false; - } - if (testExternalContextItem007 == null) { - if (other.testExternalContextItem007 != null) { - return false; - } - } else if (!testExternalContextItem007.equals(other.testExternalContextItem007)) { - return false; - } - if (testExternalContextItem008 == null) { - if (other.testExternalContextItem008 != null) { - return false; - } - } else if (!testExternalContextItem008.equals(other.testExternalContextItem008)) { - return false; - } - if (testExternalContextItem009 == null) { - if (other.testExternalContextItem009 != null) { - return false; - } - } else if (!testExternalContextItem009.equals(other.testExternalContextItem009)) { - return false; - } - if (testExternalContextItem00A == null) { - if (other.testExternalContextItem00A != null) { - return false; - } - } else if (!testExternalContextItem00A.equals(other.testExternalContextItem00A)) { - return false; - } - if (testExternalContextItem00B == null) { - if (other.testExternalContextItem00B != null) { - return false; - } - } else if (!testExternalContextItem00B.equals(other.testExternalContextItem00B)) { - return false; - } - if (testExternalContextItem00C == null) { - if (other.testExternalContextItem00C != null) { - return false; - } - } else if (!testExternalContextItem00C.equals(other.testExternalContextItem00C)) { - return false; - } - return true; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "TestExternalContextItem [testExternalContextItem000=" + testExternalContextItem000 - + ", testExternalContextItem001=" + testExternalContextItem001 + ", testExternalContextItem002=" - + testExternalContextItem002 + ", testExternalContextItem003=" + testExternalContextItem003 - + ", testExternalContextItem004=" + testExternalContextItem004 + ", testExternalContextItem005=" - + testExternalContextItem005 + ", testExternalContextItem006=" + testExternalContextItem006 - + ", testExternalContextItem007=" + testExternalContextItem007 + ", testExternalContextItem008=" - + testExternalContextItem008 + ", testExternalContextItem009=" + testExternalContextItem009 - + ", testExternalContextItem00A=" + testExternalContextItem00A + ", testExternalContextItem00B=" - + testExternalContextItem00B + ", testExternalContextItem00C=" + testExternalContextItem00C + "]"; - } -} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestGlobalContextItem.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestGlobalContextItem.java deleted file mode 100644 index c139d7469..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestGlobalContextItem.java +++ /dev/null @@ -1,435 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.testsuites.integration.context.concepts; - -import java.io.Serializable; - -/** - * The Class TestGlobalContextItem. - */ -public class TestGlobalContextItem implements Serializable { - private static final long serialVersionUID = 3348445332683174361L; - - private static final int HASH_PRIME_1 = 31; - - private TestContextBooleanItem testGlobalContextItem000; - private TestContextByteItem testGlobalContextItem001; - private TestContextIntItem testGlobalContextItem002; - private TestContextLongItem testGlobalContextItem003; - private TestContextFloatItem testGlobalContextItem004; - private TestContextDoubleItem testGlobalContextItem005; - private TestContextStringItem testGlobalContextItem006; - private TestContextLongObjectItem testGlobalContextItem007; - private TestContextDateItem testGlobalContextItem008; - private TestContextDateTzItem testGlobalContextItem009; - private TestContextDateLocaleItem testGlobalContextItem00A; - private TestContextTreeSetItem testGlobalContextItem00B; - private TestContextTreeMapItem testGlobalContextItem00C; - - /** - * Gets the test global context item 000. - * - * @return the test global context item 000 - */ - public TestContextBooleanItem getTestGlobalContextItem000() { - return testGlobalContextItem000; - } - - /** - * Sets the test global context item 000. - * - * @param testGlobalContextItem000 the test global context item 000 - */ - public void setTestGlobalContextItem000(final TestContextBooleanItem testGlobalContextItem000) { - this.testGlobalContextItem000 = testGlobalContextItem000; - } - - /** - * Gets the test global context item 001. - * - * @return the test global context item 001 - */ - public TestContextByteItem getTestGlobalContextItem001() { - return testGlobalContextItem001; - } - - /** - * Sets the test global context item 001. - * - * @param testGlobalContextItem001 the test global context item 001 - */ - public void setTestGlobalContextItem001(final TestContextByteItem testGlobalContextItem001) { - this.testGlobalContextItem001 = testGlobalContextItem001; - } - - /** - * Gets the test global context item 002. - * - * @return the test global context item 002 - */ - public TestContextIntItem getTestGlobalContextItem002() { - return testGlobalContextItem002; - } - - /** - * Sets the test global context item 002. - * - * @param testGlobalContextItem002 the test global context item 002 - */ - public void setTestGlobalContextItem002(final TestContextIntItem testGlobalContextItem002) { - this.testGlobalContextItem002 = testGlobalContextItem002; - } - - /** - * Gets the test global context item 003. - * - * @return the test global context item 003 - */ - public TestContextLongItem getTestGlobalContextItem003() { - return testGlobalContextItem003; - } - - /** - * Sets the test global context item 003. - * - * @param testGlobalContextItem003 the test global context item 003 - */ - public void setTestGlobalContextItem003(final TestContextLongItem testGlobalContextItem003) { - this.testGlobalContextItem003 = testGlobalContextItem003; - } - - /** - * Gets the test global context item 004. - * - * @return the test global context item 004 - */ - public TestContextFloatItem getTestGlobalContextItem004() { - return testGlobalContextItem004; - } - - /** - * Sets the test global context item 004. - * - * @param testGlobalContextItem004 the test global context item 004 - */ - public void setTestGlobalContextItem004(final TestContextFloatItem testGlobalContextItem004) { - this.testGlobalContextItem004 = testGlobalContextItem004; - } - - /** - * Gets the test global context item 005. - * - * @return the test global context item 005 - */ - public TestContextDoubleItem getTestGlobalContextItem005() { - return testGlobalContextItem005; - } - - /** - * Sets the test global context item 005. - * - * @param testGlobalContextItem005 the test global context item 005 - */ - public void setTestGlobalContextItem005(final TestContextDoubleItem testGlobalContextItem005) { - this.testGlobalContextItem005 = testGlobalContextItem005; - } - - /** - * Gets the test global context item 006. - * - * @return the test global context item 006 - */ - public TestContextStringItem getTestGlobalContextItem006() { - return testGlobalContextItem006; - } - - /** - * Sets the test global context item 006. - * - * @param testGlobalContextItem006 the test global context item 006 - */ - public void setTestGlobalContextItem006(final TestContextStringItem testGlobalContextItem006) { - this.testGlobalContextItem006 = testGlobalContextItem006; - } - - /** - * Gets the test global context item 007. - * - * @return the test global context item 007 - */ - public TestContextLongObjectItem getTestGlobalContextItem007() { - return testGlobalContextItem007; - } - - /** - * Sets the test global context item 007. - * - * @param testGlobalContextItem007 the test global context item 007 - */ - public void setTestGlobalContextItem007(final TestContextLongObjectItem testGlobalContextItem007) { - this.testGlobalContextItem007 = testGlobalContextItem007; - } - - /** - * Gets the test global context item 008. - * - * @return the test global context item 008 - */ - public TestContextDateItem getTestGlobalContextItem008() { - return testGlobalContextItem008; - } - - /** - * Sets the test global context item 008. - * - * @param testGlobalContextItem008 the test global context item 008 - */ - public void setTestGlobalContextItem008(final TestContextDateItem testGlobalContextItem008) { - this.testGlobalContextItem008 = testGlobalContextItem008; - } - - /** - * Gets the test global context item 009. - * - * @return the test global context item 009 - */ - public TestContextDateTzItem getTestGlobalContextItem009() { - return testGlobalContextItem009; - } - - /** - * Sets the test global context item 009. - * - * @param testGlobalContextItem009 the test global context item 009 - */ - public void setTestGlobalContextItem009(final TestContextDateTzItem testGlobalContextItem009) { - this.testGlobalContextItem009 = testGlobalContextItem009; - } - - /** - * Gets the test global context item 00 A. - * - * @return the test global context item 00 A - */ - public TestContextDateLocaleItem getTestGlobalContextItem00A() { - return testGlobalContextItem00A; - } - - /** - * Sets the test global context item 00 A. - * - * @param testGlobalContextItem00A the test global context item 00 A - */ - public void setTestGlobalContextItem00A(final TestContextDateLocaleItem testGlobalContextItem00A) { - this.testGlobalContextItem00A = testGlobalContextItem00A; - } - - /** - * Gets the test global context item 00 B. - * - * @return the test global context item 00 B - */ - public TestContextTreeSetItem getTestGlobalContextItem00B() { - return testGlobalContextItem00B; - } - - /** - * Sets the test global context item 00 B. - * - * @param testGlobalContextItem00B the test global context item 00 B - */ - public void setTestGlobalContextItem00B(final TestContextTreeSetItem testGlobalContextItem00B) { - this.testGlobalContextItem00B = testGlobalContextItem00B; - } - - /** - * Gets the test global context item 00 C. - * - * @return the test global context item 00 C - */ - public TestContextTreeMapItem getTestGlobalContextItem00C() { - return testGlobalContextItem00C; - } - - /** - * Sets the test global context item 00 C. - * - * @param testGlobalContextItem00C the test global context item 00 C - */ - public void setTestGlobalContextItem00C(final TestContextTreeMapItem testGlobalContextItem00C) { - this.testGlobalContextItem00C = testGlobalContextItem00C; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = HASH_PRIME_1; - int result = 1; - result = prime * result + ((testGlobalContextItem000 == null) ? 0 : testGlobalContextItem000.hashCode()); - result = prime * result + ((testGlobalContextItem001 == null) ? 0 : testGlobalContextItem001.hashCode()); - result = prime * result + ((testGlobalContextItem002 == null) ? 0 : testGlobalContextItem002.hashCode()); - result = prime * result + ((testGlobalContextItem003 == null) ? 0 : testGlobalContextItem003.hashCode()); - result = prime * result + ((testGlobalContextItem004 == null) ? 0 : testGlobalContextItem004.hashCode()); - result = prime * result + ((testGlobalContextItem005 == null) ? 0 : testGlobalContextItem005.hashCode()); - result = prime * result + ((testGlobalContextItem006 == null) ? 0 : testGlobalContextItem006.hashCode()); - result = prime * result + ((testGlobalContextItem007 == null) ? 0 : testGlobalContextItem007.hashCode()); - result = prime * result + ((testGlobalContextItem008 == null) ? 0 : testGlobalContextItem008.hashCode()); - result = prime * result + ((testGlobalContextItem009 == null) ? 0 : testGlobalContextItem009.hashCode()); - result = prime * result + ((testGlobalContextItem00A == null) ? 0 : testGlobalContextItem00A.hashCode()); - result = prime * result + ((testGlobalContextItem00B == null) ? 0 : testGlobalContextItem00B.hashCode()); - result = prime * result + ((testGlobalContextItem00C == null) ? 0 : testGlobalContextItem00C.hashCode()); - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TestGlobalContextItem other = (TestGlobalContextItem) obj; - if (testGlobalContextItem000 == null) { - if (other.testGlobalContextItem000 != null) { - return false; - } - } else if (!testGlobalContextItem000.equals(other.testGlobalContextItem000)) { - return false; - } - if (testGlobalContextItem001 == null) { - if (other.testGlobalContextItem001 != null) { - return false; - } - } else if (!testGlobalContextItem001.equals(other.testGlobalContextItem001)) { - return false; - } - if (testGlobalContextItem002 == null) { - if (other.testGlobalContextItem002 != null) { - return false; - } - } else if (!testGlobalContextItem002.equals(other.testGlobalContextItem002)) { - return false; - } - if (testGlobalContextItem003 == null) { - if (other.testGlobalContextItem003 != null) { - return false; - } - } else if (!testGlobalContextItem003.equals(other.testGlobalContextItem003)) { - return false; - } - if (testGlobalContextItem004 == null) { - if (other.testGlobalContextItem004 != null) { - return false; - } - } else if (!testGlobalContextItem004.equals(other.testGlobalContextItem004)) { - return false; - } - if (testGlobalContextItem005 == null) { - if (other.testGlobalContextItem005 != null) { - return false; - } - } else if (!testGlobalContextItem005.equals(other.testGlobalContextItem005)) { - return false; - } - if (testGlobalContextItem006 == null) { - if (other.testGlobalContextItem006 != null) { - return false; - } - } else if (!testGlobalContextItem006.equals(other.testGlobalContextItem006)) { - return false; - } - if (testGlobalContextItem007 == null) { - if (other.testGlobalContextItem007 != null) { - return false; - } - } else if (!testGlobalContextItem007.equals(other.testGlobalContextItem007)) { - return false; - } - if (testGlobalContextItem008 == null) { - if (other.testGlobalContextItem008 != null) { - return false; - } - } else if (!testGlobalContextItem008.equals(other.testGlobalContextItem008)) { - return false; - } - if (testGlobalContextItem009 == null) { - if (other.testGlobalContextItem009 != null) { - return false; - } - } else if (!testGlobalContextItem009.equals(other.testGlobalContextItem009)) { - return false; - } - if (testGlobalContextItem00A == null) { - if (other.testGlobalContextItem00A != null) { - return false; - } - } else if (!testGlobalContextItem00A.equals(other.testGlobalContextItem00A)) { - return false; - } - if (testGlobalContextItem00B == null) { - if (other.testGlobalContextItem00B != null) { - return false; - } - } else if (!testGlobalContextItem00B.equals(other.testGlobalContextItem00B)) { - return false; - } - if (testGlobalContextItem00C == null) { - if (other.testGlobalContextItem00C != null) { - return false; - } - } else if (!testGlobalContextItem00C.equals(other.testGlobalContextItem00C)) { - return false; - } - return true; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "TestGlobalContextItem [testGlobalContextItem000=" + testGlobalContextItem000 - + ", testGlobalContextItem001=" + testGlobalContextItem001 + ", testGlobalContextItem002=" - + testGlobalContextItem002 + ", testGlobalContextItem003=" + testGlobalContextItem003 - + ", testGlobalContextItem004=" + testGlobalContextItem004 + ", testGlobalContextItem005=" - + testGlobalContextItem005 + ", testGlobalContextItem006=" + testGlobalContextItem006 - + ", testGlobalContextItem007=" + testGlobalContextItem007 + ", testGlobalContextItem008=" - + testGlobalContextItem008 + ", testGlobalContextItem009=" + testGlobalContextItem009 - + ", testGlobalContextItem00A=" + testGlobalContextItem00A + ", testGlobalContextItem00B=" - + testGlobalContextItem00B + ", testGlobalContextItem00C=" + testGlobalContextItem00C + "]"; - } -} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestPolicyContextItem.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestPolicyContextItem.java deleted file mode 100644 index 39a0408a8..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/TestPolicyContextItem.java +++ /dev/null @@ -1,242 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.testsuites.integration.context.concepts; - -import java.io.Serializable; - -/** - * The Class TestPolicyContextItem. - */ -public class TestPolicyContextItem implements Serializable { - private static final long serialVersionUID = 6336372857646152910L; - - private static final int HASH_PRIME_1 = 31; - - private TestContextStringItem testPolicyContextItem000; - private TestContextLongItem testPolicyContextItem001; - private TestContextDoubleItem testPolicyContextItem002; - private TestContextBooleanItem testPolicyContextItem003; - private TestContextLongItem testPolicyContextItem004; - private TestContextTreeMapItem testPolicyContextItem005; - - /** - * Gets the test policy context item 000. - * - * @return the test policy context item 000 - */ - public TestContextStringItem getTestPolicyContextItem000() { - return testPolicyContextItem000; - } - - /** - * Sets the test policy context item 000. - * - * @param testPolicyContextItem000 the test policy context item 000 - */ - public void setTestPolicyContextItem000(final TestContextStringItem testPolicyContextItem000) { - this.testPolicyContextItem000 = testPolicyContextItem000; - } - - /** - * Gets the test policy context item 001. - * - * @return the test policy context item 001 - */ - public TestContextLongItem getTestPolicyContextItem001() { - return testPolicyContextItem001; - } - - /** - * Sets the test policy context item 001. - * - * @param testPolicyContextItem001 the test policy context item 001 - */ - public void setTestPolicyContextItem001(final TestContextLongItem testPolicyContextItem001) { - this.testPolicyContextItem001 = testPolicyContextItem001; - } - - /** - * Gets the test policy context item 002. - * - * @return the test policy context item 002 - */ - public TestContextDoubleItem getTestPolicyContextItem002() { - return testPolicyContextItem002; - } - - /** - * Sets the test policy context item 002. - * - * @param testPolicyContextItem002 the test policy context item 002 - */ - public void setTestPolicyContextItem002(final TestContextDoubleItem testPolicyContextItem002) { - this.testPolicyContextItem002 = testPolicyContextItem002; - } - - /** - * Gets the test policy context item 003. - * - * @return the test policy context item 003 - */ - public TestContextBooleanItem getTestPolicyContextItem003() { - return testPolicyContextItem003; - } - - /** - * Sets the test policy context item 003. - * - * @param testPolicyContextItem003 the test policy context item 003 - */ - public void setTestPolicyContextItem003(final TestContextBooleanItem testPolicyContextItem003) { - this.testPolicyContextItem003 = testPolicyContextItem003; - } - - /** - * Gets the test policy context item 004. - * - * @return the test policy context item 004 - */ - public TestContextLongItem getTestPolicyContextItem004() { - return testPolicyContextItem004; - } - - /** - * Sets the test policy context item 004. - * - * @param testPolicyContextItem004 the test policy context item 004 - */ - public void setTestPolicyContextItem004(final TestContextLongItem testPolicyContextItem004) { - this.testPolicyContextItem004 = testPolicyContextItem004; - } - - /** - * Gets the test policy context item 005. - * - * @return the test policy context item 005 - */ - public TestContextTreeMapItem getTestPolicyContextItem005() { - return testPolicyContextItem005; - } - - /** - * Sets the test policy context item 005. - * - * @param testPolicyContextItem005 the test policy context item 005 - */ - public void setTestPolicyContextItem005(final TestContextTreeMapItem testPolicyContextItem005) { - this.testPolicyContextItem005 = testPolicyContextItem005; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = HASH_PRIME_1; - int result = 1; - result = prime * result + ((testPolicyContextItem000 == null) ? 0 : testPolicyContextItem000.hashCode()); - result = prime * result + ((testPolicyContextItem001 == null) ? 0 : testPolicyContextItem001.hashCode()); - result = prime * result + ((testPolicyContextItem002 == null) ? 0 : testPolicyContextItem002.hashCode()); - result = prime * result + ((testPolicyContextItem003 == null) ? 0 : testPolicyContextItem003.hashCode()); - result = prime * result + ((testPolicyContextItem004 == null) ? 0 : testPolicyContextItem004.hashCode()); - result = prime * result + ((testPolicyContextItem005 == null) ? 0 : testPolicyContextItem005.hashCode()); - return result; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final TestPolicyContextItem other = (TestPolicyContextItem) obj; - if (testPolicyContextItem000 == null) { - if (other.testPolicyContextItem000 != null) { - return false; - } - } else if (!testPolicyContextItem000.equals(other.testPolicyContextItem000)) { - return false; - } - if (testPolicyContextItem001 == null) { - if (other.testPolicyContextItem001 != null) { - return false; - } - } else if (!testPolicyContextItem001.equals(other.testPolicyContextItem001)) { - return false; - } - if (testPolicyContextItem002 == null) { - if (other.testPolicyContextItem002 != null) { - return false; - } - } else if (!testPolicyContextItem002.equals(other.testPolicyContextItem002)) { - return false; - } - if (testPolicyContextItem003 == null) { - if (other.testPolicyContextItem003 != null) { - return false; - } - } else if (!testPolicyContextItem003.equals(other.testPolicyContextItem003)) { - return false; - } - if (testPolicyContextItem004 == null) { - if (other.testPolicyContextItem004 != null) { - return false; - } - } else if (!testPolicyContextItem004.equals(other.testPolicyContextItem004)) { - return false; - } - if (testPolicyContextItem005 == null) { - if (other.testPolicyContextItem005 != null) { - return false; - } - } else if (!testPolicyContextItem005.equals(other.testPolicyContextItem005)) { - return false; - } - return true; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "TestPolicyContextItem [testPolicyContextItem000=" + testPolicyContextItem000 - + ", testPolicyContextItem001=" + testPolicyContextItem001 + ", testPolicyContextItem002=" - + testPolicyContextItem002 + ", testPolicyContextItem003=" + testPolicyContextItem003 - + ", testPolicyContextItem004=" + testPolicyContextItem004 + ", testPolicyContextItem005=" - + testPolicyContextItem005 + "]"; - } -} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/package-info.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/package-info.java deleted file mode 100644 index e897dda2a..000000000 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/concepts/package-info.java +++ /dev/null @@ -1,28 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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========================================================= - */ - -/** - * Defines test Java context classes. - * - * @author Liam Fallon (liam.fallon@ericsson.com) - */ - -package org.onap.policy.apex.testsuites.integration.context.concepts; diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextInstantiation.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextInstantiation.java index 186df673b..502ccc17c 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextInstantiation.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextInstantiation.java @@ -62,25 +62,25 @@ import org.onap.policy.apex.context.ContextException; import org.onap.policy.apex.context.ContextRuntimeException; import org.onap.policy.apex.context.Distributor; import org.onap.policy.apex.context.impl.distribution.DistributorFactory; +import org.onap.policy.apex.context.test.concepts.TestContextBooleanItem; +import org.onap.policy.apex.context.test.concepts.TestContextByteItem; +import org.onap.policy.apex.context.test.concepts.TestContextDateItem; +import org.onap.policy.apex.context.test.concepts.TestContextDateLocaleItem; +import org.onap.policy.apex.context.test.concepts.TestContextDateTzItem; +import org.onap.policy.apex.context.test.concepts.TestContextDoubleItem; +import org.onap.policy.apex.context.test.concepts.TestContextFloatItem; +import org.onap.policy.apex.context.test.concepts.TestContextIntItem; +import org.onap.policy.apex.context.test.concepts.TestContextLongItem; +import org.onap.policy.apex.context.test.concepts.TestContextLongObjectItem; +import org.onap.policy.apex.context.test.concepts.TestContextStringItem; +import org.onap.policy.apex.context.test.concepts.TestContextTreeMapItem; +import org.onap.policy.apex.context.test.concepts.TestContextTreeSetItem; +import org.onap.policy.apex.context.test.concepts.TestExternalContextItem; +import org.onap.policy.apex.context.test.concepts.TestGlobalContextItem; +import org.onap.policy.apex.context.test.concepts.TestPolicyContextItem; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; import org.onap.policy.apex.model.contextmodel.concepts.AxContextModel; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextBooleanItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextByteItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextDateItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextDateLocaleItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextDateTzItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextDoubleItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextFloatItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextIntItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextLongItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextLongObjectItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextStringItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextTreeMapItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextTreeSetItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestExternalContextItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestGlobalContextItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestPolicyContextItem; import org.onap.policy.apex.testsuites.integration.context.factory.TestContextAlbumFactory; import org.onap.policy.apex.testsuites.integration.context.utils.Constants; import org.slf4j.ext.XLogger; diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextUpdate.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextUpdate.java index 0ed036992..24c63a12b 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextUpdate.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextUpdate.java @@ -45,12 +45,12 @@ import org.onap.policy.apex.context.ContextException; import org.onap.policy.apex.context.ContextRuntimeException; import org.onap.policy.apex.context.Distributor; import org.onap.policy.apex.context.impl.distribution.DistributorFactory; +import org.onap.policy.apex.context.test.concepts.TestContextDateItem; +import org.onap.policy.apex.context.test.concepts.TestContextDateLocaleItem; +import org.onap.policy.apex.context.test.concepts.TestContextTreeMapItem; import org.onap.policy.apex.model.basicmodel.concepts.ApexException; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.contextmodel.concepts.AxContextModel; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextDateItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextDateLocaleItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextTreeMapItem; import org.onap.policy.apex.testsuites.integration.context.factory.TestContextAlbumFactory; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/HazelcastContextDistributorTest.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/HazelcastContextDistributorTest.java new file mode 100644 index 000000000..9e6002565 --- /dev/null +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/HazelcastContextDistributorTest.java @@ -0,0 +1,136 @@ +/*- + * ============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.testsuites.integration.context.distribution; + +import java.io.IOException; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters; +import org.onap.policy.apex.context.parameters.ContextParameterConstants; +import org.onap.policy.apex.context.parameters.ContextParameters; +import org.onap.policy.apex.context.parameters.SchemaParameters; +import org.onap.policy.apex.model.basicmodel.concepts.ApexException; +import org.onap.policy.apex.model.basicmodel.handling.ApexModelException; +import org.onap.policy.apex.plugins.context.distribution.hazelcast.HazelcastContextDistributor; +import org.onap.policy.common.parameters.ParameterService; +import org.slf4j.ext.XLogger; +import org.slf4j.ext.XLoggerFactory; + +/** + * The Class HazelcastContextDistributorTest. + */ +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); + + private SchemaParameters schemaParameters; + private ContextParameters contextParameters; + + /** + * Before test. + */ + @Before + public void beforeTest() { + contextParameters = new ContextParameters(); + + contextParameters.setName(ContextParameterConstants.MAIN_GROUP_NAME); + contextParameters.getDistributorParameters().setName(ContextParameterConstants.DISTRIBUTOR_GROUP_NAME); + contextParameters.getLockManagerParameters().setName(ContextParameterConstants.LOCKING_GROUP_NAME); + contextParameters.getPersistorParameters().setName(ContextParameterConstants.PERSISTENCE_GROUP_NAME); + + contextParameters.getDistributorParameters().setPluginClass(HAZEL_CAST_PLUGIN_CLASS); + + ParameterService.register(contextParameters); + ParameterService.register(contextParameters.getDistributorParameters()); + ParameterService.register(contextParameters.getLockManagerParameters()); + ParameterService.register(contextParameters.getPersistorParameters()); + + schemaParameters = new SchemaParameters(); + schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME); + schemaParameters.getSchemaHelperParameterMap().put("JAVA", new JavaSchemaHelperParameters()); + + ParameterService.register(schemaParameters); + } + + /** + * After test. + */ + @After + public void afterTest() { + ParameterService.deregister(schemaParameters); + + ParameterService.deregister(contextParameters.getDistributorParameters()); + ParameterService.deregister(contextParameters.getLockManagerParameters()); + ParameterService.deregister(contextParameters.getPersistorParameters()); + ParameterService.deregister(contextParameters); + } + + /** + * Test context album update hazelcast. + * + * @throws ApexModelException the apex model exception + * @throws IOException Signals that an I/O exception has occurred. + * @throws ApexException the apex exception + */ + @Test + public void testContextAlbumUpdateHazelcast() throws ApexModelException, IOException, ApexException { + logger.debug("Running testContextAlbumUpdateHazelcast test . . ."); + + new ContextAlbumUpdate().testContextAlbumUpdate(); + + logger.debug("Ran testContextAlbumUpdateHazelcast test"); + } + + /** + * Test context instantiation hazelcast. + * + * @throws ApexModelException the apex model exception + * @throws IOException Signals that an I/O exception has occurred. + * @throws ApexException the apex exception + */ + @Test + public void testContextInstantiationHazelcast() throws ApexModelException, IOException, ApexException { + logger.debug("Running testContextInstantiationHazelcast test . . ."); + + new ContextInstantiation().testContextInstantiation(); + + logger.debug("Ran testContextInstantiationHazelcast test"); + } + + /** + * Test context update hazelcast. + * + * @throws ApexModelException the apex model exception + * @throws IOException Signals that an I/O exception has occurred. + * @throws ApexException the apex exception + */ + @Test + public void testContextUpdateHazelcast() throws ApexModelException, IOException, ApexException { + logger.debug("Running testContextUpdateHazelcast test . . ."); + + new ContextUpdate().testContextUpdate(); + + logger.debug("Ran testContextUpdateHazelcast test"); + } +} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/InfinispanContextDistributorTest.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/InfinispanContextDistributorTest.java new file mode 100644 index 000000000..b8cc597ef --- /dev/null +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/InfinispanContextDistributorTest.java @@ -0,0 +1,154 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 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.testsuites.integration.context.distribution; + +import java.io.IOException; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters; +import org.onap.policy.apex.context.parameters.ContextParameterConstants; +import org.onap.policy.apex.context.parameters.ContextParameters; +import org.onap.policy.apex.context.parameters.SchemaParameters; +import org.onap.policy.apex.model.basicmodel.concepts.ApexException; +import org.onap.policy.apex.model.basicmodel.handling.ApexModelException; +import org.onap.policy.apex.plugins.context.distribution.infinispan.InfinispanContextDistributor; +import org.onap.policy.apex.plugins.context.distribution.infinispan.InfinispanDistributorParameters; +import org.onap.policy.common.parameters.ParameterService; +import org.slf4j.ext.XLogger; +import org.slf4j.ext.XLoggerFactory; + +/** + * The Class InfinispanContextDistributorTest. + */ +public class InfinispanContextDistributorTest { + private static final XLogger logger = XLoggerFactory.getXLogger(InfinispanContextDistributorTest.class); + + private static final String PLUGIN_CLASS = InfinispanContextDistributor.class.getCanonicalName(); + + private SchemaParameters schemaParameters; + private ContextParameters contextParameters; + + /** + * Before test. + */ + @Before + public void beforeTest() { + contextParameters = new ContextParameters(); + + contextParameters.setName(ContextParameterConstants.MAIN_GROUP_NAME); + InfinispanDistributorParameters inifinispanDistributorParameters = new InfinispanDistributorParameters(); + inifinispanDistributorParameters.setName(ContextParameterConstants.DISTRIBUTOR_GROUP_NAME); + inifinispanDistributorParameters.setPluginClass(PLUGIN_CLASS); + contextParameters.setDistributorParameters(inifinispanDistributorParameters); + contextParameters.getLockManagerParameters().setName(ContextParameterConstants.LOCKING_GROUP_NAME); + contextParameters.getPersistorParameters().setName(ContextParameterConstants.PERSISTENCE_GROUP_NAME); + + ParameterService.register(contextParameters); + ParameterService.register(contextParameters.getDistributorParameters()); + ParameterService.register(contextParameters.getLockManagerParameters()); + ParameterService.register(contextParameters.getPersistorParameters()); + + schemaParameters = new SchemaParameters(); + schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME); + schemaParameters.getSchemaHelperParameterMap().put("JAVA", new JavaSchemaHelperParameters()); + + ParameterService.register(schemaParameters); + } + + /** + * After test. + */ + @After + public void afterTest() { + ParameterService.deregister(schemaParameters); + + ParameterService.deregister(contextParameters.getDistributorParameters()); + ParameterService.deregister(contextParameters.getLockManagerParameters()); + ParameterService.deregister(contextParameters.getPersistorParameters()); + ParameterService.deregister(contextParameters); + } + + /** + * Test context album update infinispan. + * + * @throws ApexModelException the apex model exception + * @throws IOException Signals that an I/O exception has occurred. + * @throws ApexException the apex exception + */ + @Test + public void testContextAlbumUpdateInfinispan() throws ApexModelException, IOException, ApexException { + logger.debug("Running testContextAlbumUpdateInfinispan test . . ."); + + new ContextAlbumUpdate().testContextAlbumUpdate(); + + logger.debug("Ran testContextAlbumUpdateInfinispan test"); + } + + /** + * Test context instantiation infinispan. + * + * @throws ApexModelException the apex model exception + * @throws IOException Signals that an I/O exception has occurred. + * @throws ApexException the apex exception + */ + @Test + public void testContextInstantiationInfinispan() throws ApexModelException, IOException, ApexException { + logger.debug("Running testContextInstantiationInfinispan test . . ."); + + new ContextInstantiation().testContextInstantiation(); + + logger.debug("Ran testContextInstantiationInfinispan test"); + } + + /** + * Test context update infinispan. + * + * @throws ApexModelException the apex model exception + * @throws IOException Signals that an I/O exception has occurred. + * @throws ApexException the apex exception + */ + @Test + public void testContextUpdateInfinispan() throws ApexModelException, IOException, ApexException { + logger.debug("Running testContextUpdateInfinispan test . . ."); + + new ContextUpdate().testContextUpdate(); + + logger.debug("Ran testContextUpdateInfinispan test"); + } + + /** + * Test sequential context instantiation infinispan. + * + * @throws ApexModelException the apex model exception + * @throws IOException Signals that an I/O exception has occurred. + * @throws ApexException the apex exception + */ + @Test + public void testSequentialContextInstantiationInfinispan() throws ApexModelException, IOException, ApexException { + logger.debug("Running testSequentialContextInstantiationInfinispan test . . ."); + + new SequentialContextInstantiation().testSequentialContextInstantiation(); + + logger.debug("Ran testSequentialContextInstantiationInfinispan test"); + } +} diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/SequentialContextInstantiation.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/SequentialContextInstantiation.java index 4c9339514..12f7f373f 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/SequentialContextInstantiation.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/SequentialContextInstantiation.java @@ -52,18 +52,18 @@ import org.onap.policy.apex.context.ContextAlbum; import org.onap.policy.apex.context.ContextException; import org.onap.policy.apex.context.Distributor; import org.onap.policy.apex.context.impl.distribution.DistributorFactory; +import org.onap.policy.apex.context.test.concepts.TestContextBooleanItem; +import org.onap.policy.apex.context.test.concepts.TestContextByteItem; +import org.onap.policy.apex.context.test.concepts.TestContextDateItem; +import org.onap.policy.apex.context.test.concepts.TestContextDateLocaleItem; +import org.onap.policy.apex.context.test.concepts.TestContextDateTzItem; +import org.onap.policy.apex.context.test.concepts.TestContextDoubleItem; +import org.onap.policy.apex.context.test.concepts.TestContextFloatItem; +import org.onap.policy.apex.context.test.concepts.TestContextIntItem; +import org.onap.policy.apex.context.test.concepts.TestContextLongItem; +import org.onap.policy.apex.context.test.concepts.TestContextLongObjectItem; +import org.onap.policy.apex.context.test.concepts.TestContextStringItem; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextBooleanItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextByteItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextDateItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextDateLocaleItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextDateTzItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextDoubleItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextFloatItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextIntItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextLongItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextLongObjectItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextStringItem; import org.onap.policy.apex.testsuites.integration.context.utils.Constants; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/factory/TestContextAlbumFactory.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/factory/TestContextAlbumFactory.java index 2efa80154..f8c1f597c 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/factory/TestContextAlbumFactory.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/factory/TestContextAlbumFactory.java @@ -29,6 +29,12 @@ import static org.onap.policy.apex.testsuites.integration.context.utils.Constant import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.POLICY_CONTEXT_ALBUM; import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.VERSION; +import org.onap.policy.apex.context.test.concepts.TestContextDateLocaleItem; +import org.onap.policy.apex.context.test.concepts.TestContextLongItem; +import org.onap.policy.apex.context.test.concepts.TestContextTreeMapItem; +import org.onap.policy.apex.context.test.concepts.TestExternalContextItem; +import org.onap.policy.apex.context.test.concepts.TestGlobalContextItem; +import org.onap.policy.apex.context.test.concepts.TestPolicyContextItem; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.basicmodel.concepts.AxKeyInformation; import org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbum; @@ -36,12 +42,6 @@ import org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbums; import org.onap.policy.apex.model.contextmodel.concepts.AxContextModel; import org.onap.policy.apex.model.contextmodel.concepts.AxContextSchema; import org.onap.policy.apex.model.contextmodel.concepts.AxContextSchemas; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextDateLocaleItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextLongItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextTreeMapItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestExternalContextItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestGlobalContextItem; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestPolicyContextItem; /** * The Class TestContextAlbumFactory creates test context albums. diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/NoLockAlbumModifier.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/NoLockAlbumModifier.java index 26f54e08c..e541aada7 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/NoLockAlbumModifier.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/NoLockAlbumModifier.java @@ -24,7 +24,7 @@ package org.onap.policy.apex.testsuites.integration.context.lock.modifier; import java.util.Random; import org.onap.policy.apex.context.ContextAlbum; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextLongItem; +import org.onap.policy.apex.context.test.concepts.TestContextLongItem; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/ReadLockAlbumModifier.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/ReadLockAlbumModifier.java index f5d22ed87..e9c435af5 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/ReadLockAlbumModifier.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/ReadLockAlbumModifier.java @@ -25,7 +25,7 @@ import java.util.Random; import org.onap.policy.apex.context.ContextAlbum; import org.onap.policy.apex.context.ContextException; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextLongItem; +import org.onap.policy.apex.context.test.concepts.TestContextLongItem; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/SingleValueWriteLockAlbumModifier.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/SingleValueWriteLockAlbumModifier.java index b54fe166f..ad38b03b5 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/SingleValueWriteLockAlbumModifier.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/SingleValueWriteLockAlbumModifier.java @@ -25,7 +25,7 @@ import static org.onap.policy.apex.testsuites.integration.context.utils.Constant import org.onap.policy.apex.context.ContextAlbum; import org.onap.policy.apex.context.ContextException; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextLongItem; +import org.onap.policy.apex.context.test.concepts.TestContextLongItem; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/WriteLockAlbumModifier.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/WriteLockAlbumModifier.java index 87214fb47..552365e92 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/WriteLockAlbumModifier.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/lock/modifier/WriteLockAlbumModifier.java @@ -25,7 +25,7 @@ import java.util.Random; import org.onap.policy.apex.context.ContextAlbum; import org.onap.policy.apex.context.ContextException; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextLongItem; +import org.onap.policy.apex.context.test.concepts.TestContextLongItem; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/locking/ConcurrentContext.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/locking/ConcurrentContext.java index 4326d5adb..2bcb38fec 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/locking/ConcurrentContext.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/locking/ConcurrentContext.java @@ -34,8 +34,8 @@ import java.util.concurrent.TimeUnit; import org.onap.policy.apex.context.ContextAlbum; import org.onap.policy.apex.context.ContextException; import org.onap.policy.apex.context.Distributor; +import org.onap.policy.apex.context.test.concepts.TestContextLongItem; import org.onap.policy.apex.model.basicmodel.concepts.ApexException; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextLongItem; import org.onap.policy.apex.testsuites.integration.context.utils.ConfigrationProvider; import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/ConfigrationProviderImpl.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/ConfigrationProviderImpl.java index fa5b564b8..0a9a195e9 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/ConfigrationProviderImpl.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/ConfigrationProviderImpl.java @@ -31,9 +31,9 @@ import org.onap.policy.apex.context.ContextException; import org.onap.policy.apex.context.ContextRuntimeException; import org.onap.policy.apex.context.Distributor; import org.onap.policy.apex.context.impl.distribution.DistributorFactory; +import org.onap.policy.apex.context.test.concepts.TestContextLongItem; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.contextmodel.concepts.AxContextModel; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestContextLongItem; import org.onap.policy.apex.testsuites.integration.context.factory.TestContextAlbumFactory; import org.onap.policy.apex.testsuites.integration.context.lock.modifier.AlbumModifier; import org.onap.policy.apex.testsuites.integration.context.lock.modifier.LockType; diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/Constants.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/Constants.java index ea80d4e7d..6fdcf6121 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/Constants.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/utils/Constants.java @@ -23,8 +23,8 @@ package org.onap.policy.apex.testsuites.integration.context.utils; import java.util.TimeZone; +import org.onap.policy.apex.context.test.concepts.TestPolicyContextItem; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; -import org.onap.policy.apex.testsuites.integration.context.concepts.TestPolicyContextItem; /** * The Class Constants provides constants for context tests. diff --git a/testsuites/integration/integration-executor-test/pom.xml b/testsuites/integration/integration-executor-test/pom.xml index 1a106eeeb..f50b84460 100644 --- a/testsuites/integration/integration-executor-test/pom.xml +++ b/testsuites/integration/integration-executor-test/pom.xml @@ -37,12 +37,6 @@ ${project.version} test - - org.onap.policy.apex-pdp.context - context-test-utils - ${project.version} - test - org.onap.policy.apex-pdp.testsuites.integration integration-common @@ -78,12 +72,6 @@ ${project.version} test - - org.apache.derby - derby - ${version.derby} - test - diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyDbWrite.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyDbWrite.java index e863a990a..426db8328 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyDbWrite.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyDbWrite.java @@ -5,15 +5,15 @@ * 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========================================================= */ @@ -23,7 +23,6 @@ package org.onap.policy.apex.testsuites.integration.executor.handling; import java.sql.Connection; import java.sql.DriverManager; -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.dao.DaoParameters; @@ -35,7 +34,6 @@ import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; * The Class TestApexSamplePolicyDbWrite. */ public class TestApexSamplePolicyDbWrite { - private Connection connection; TestApexModel testApexModel; /** @@ -45,22 +43,10 @@ public class TestApexSamplePolicyDbWrite { */ @Before public void setup() throws Exception { - connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); - final TestApexSamplePolicyModelCreator apexPolicyModelCreator = new TestApexSamplePolicyModelCreator("MVEL"); testApexModel = new TestApexModel(AxPolicyModel.class, apexPolicyModelCreator); } - /** - * Teardown. - * - * @throws Exception the exception - */ - @After - public void teardown() throws Exception { - connection.close(); - } - /** * Test model write read jpa. * @@ -72,6 +58,8 @@ public class TestApexSamplePolicyDbWrite { DaoParameters.setPluginClass(DefaultApexDao.class.getCanonicalName()); DaoParameters.setPersistenceUnit("SampleModelTest"); + Connection connection = DriverManager.getConnection("jdbc:h2:mem:testdb"); testApexModel.testApexModelWriteReadJpa(DaoParameters); + connection.close(); } } diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java index 1e7daad03..a5800956d 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexSamplePolicyModel.java @@ -5,15 +5,15 @@ * 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========================================================= */ @@ -25,7 +25,6 @@ import static org.junit.Assert.assertTrue; import java.sql.Connection; import java.sql.DriverManager; -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult; @@ -39,7 +38,6 @@ import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; */ public class TestApexSamplePolicyModel { private static final String VALID_MODEL_STRING = "***validation of model successful***"; - private Connection connection; private TestApexModel testApexModel; /** @@ -49,22 +47,10 @@ public class TestApexSamplePolicyModel { */ @Before public void setup() throws Exception { - connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true"); - testApexModel = new TestApexModel(AxPolicyModel.class, new TestApexSamplePolicyModelCreator("MVEL")); } - /** - * Teardown. - * - * @throws Exception the exception - */ - @After - public void teardown() throws Exception { - connection.close(); - } - /** * Test model valid. * @@ -107,8 +93,10 @@ public class TestApexSamplePolicyModel { DaoParameters.setPluginClass(DefaultApexDao.class.getCanonicalName()); DaoParameters.setPersistenceUnit("SampleModelTest"); + Connection connection = DriverManager.getConnection("jdbc:h2:mem:testdb"); testApexModel.testApexModelWriteReadJpa(DaoParameters); + connection.close(); } - + } diff --git a/testsuites/integration/integration-executor-test/src/test/resources/META-INF/persistence.xml b/testsuites/integration/integration-executor-test/src/test/resources/META-INF/persistence.xml index 40773a4d4..b2d6a96ed 100644 --- a/testsuites/integration/integration-executor-test/src/test/resources/META-INF/persistence.xml +++ b/testsuites/integration/integration-executor-test/src/test/resources/META-INF/persistence.xml @@ -57,10 +57,8 @@ org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel - - - - + + diff --git a/testsuites/integration/integration-uservice-test/pom.xml b/testsuites/integration/integration-uservice-test/pom.xml index 8772db0dd..1d48bf449 100644 --- a/testsuites/integration/integration-uservice-test/pom.xml +++ b/testsuites/integration/integration-uservice-test/pom.xml @@ -49,12 +49,6 @@ core-deployment ${project.version} - - org.onap.policy.apex-pdp.context - context-test-utils - ${project.version} - test - org.onap.policy.apex-pdp.plugins.plugins-context.plugins-context-schema plugins-context-schema-avro diff --git a/testsuites/integration/pom.xml b/testsuites/integration/pom.xml index c5b89a71c..17798d6ee 100644 --- a/testsuites/integration/pom.xml +++ b/testsuites/integration/pom.xml @@ -37,6 +37,14 @@ integration-uservice-test + + + com.h2database + h2 + test + + + apexAll diff --git a/testsuites/performance/performance-benchmark-test/pom.xml b/testsuites/performance/performance-benchmark-test/pom.xml index 6f6a978b1..747c3ddef 100644 --- a/testsuites/performance/performance-benchmark-test/pom.xml +++ b/testsuites/performance/performance-benchmark-test/pom.xml @@ -103,12 +103,6 @@ ${project.version} test - - org.onap.policy.apex-pdp.context - context-test-utils - ${project.version} - test - org.mockito mockito-all -- cgit 1.2.3-korg