aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-04-16 11:20:08 +0000
committerliamfallon <liam.fallon@est.tech>2019-04-16 11:20:08 +0000
commit3cb682fa71a1749fb99a47d7c8ede2b8984e2c07 (patch)
tree08aa6b83f985cfefcb0618d146b2e77428110055 /plugins
parent2ba499f11094cfd1321e59789869a0c475406b58 (diff)
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 <liam.fallon@est.tech>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-hazelcast/pom.xml6
-rw-r--r--plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-hazelcast/src/test/java/org/onap/policy/apex/plugins/context/distribution/hazelcast/HazelcastContextDistributorTest.java138
-rw-r--r--plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-infinispan/pom.xml6
-rw-r--r--plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-infinispan/src/test/java/org/onap/policy/apex/plugins/context/distribution/infinispan/InfinispanContextDistributorTest.java156
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/pom.xml6
-rw-r--r--plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/EclipselinkApexDaoTest.java16
-rw-r--r--plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/ArtifactKeyTestEntity.java257
-rw-r--r--plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/ReferenceKeyTestEntity.java260
-rw-r--r--plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/entities/package-info.java24
-rw-r--r--plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/resources/META-INF/persistence.xml4
-rw-r--r--plugins/plugins-persistence/plugins-persistence-jpa/pom.xml5
11 files changed, 551 insertions, 327 deletions
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 @@
<artifactId>hazelcast</artifactId>
<version>${version.hazelcast}</version>
</dependency>
- <dependency>
- <groupId>org.onap.policy.apex-pdp.context</groupId>
- <artifactId>context-test-utils</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
</dependencies>
<profiles>
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 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>org.onap.policy.apex-pdp.context</groupId>
- <artifactId>context-test-utils</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
</dependencies>
<profiles>
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
@@ -53,12 +53,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.apex-pdp.context</groupId>
- <artifactId>context-test-utils</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<scope>test</scope>
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<AxKey> 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<AxKey> 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 @@
<persistence-unit name="DAOTest" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
- <class>org.onap.policy.apex.context.test.entities.ReferenceKeyTestEntity</class>
- <class>org.onap.policy.apex.context.test.entities.ArtifactKeyTestEntity</class>
+ <class>org.onap.policy.apex.plugins.persistence.jpa.eclipselink.entities.ReferenceKeyTestEntity</class>
+ <class>org.onap.policy.apex.plugins.persistence.jpa.eclipselink.entities.ArtifactKeyTestEntity</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
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
@@ -39,11 +39,6 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.policy.apex-pdp.context</groupId>
- <artifactId>context-test-utils</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>