summaryrefslogtreecommitdiffstats
path: root/main/src/test
diff options
context:
space:
mode:
authorramverma <ram.krishna.verma@est.tech>2019-04-11 22:09:38 +0000
committerramverma <ram.krishna.verma@est.tech>2019-04-11 22:09:38 +0000
commite5e24d606ecdaa1fca547969d56c890764f26e45 (patch)
tree5f53456b2db089f722a22d3be5b51356a01d24fd /main/src/test
parent2a76364ed54301623718756d6088fc675516f9d0 (diff)
Adding code for db config & initial group creation
1) Adding code for initial PdpGroup/Subgroup creation. 2) Adding db configuration 3) Updated code as per change in policy/models Change-Id: If37870925001b333e0537e364eecb266c351cf5a Issue-ID: POLICY-1635 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
Diffstat (limited to 'main/src/test')
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/parameters/CommonTestData.java1
-rw-r--r--main/src/test/resources/META-INF/persistence.xml39
-rw-r--r--main/src/test/resources/parameters/MinimumParameters.json1
-rw-r--r--main/src/test/resources/parameters/PapConfigParameters.json3
-rw-r--r--main/src/test/resources/parameters/PapConfigParameters_InvalidName.json1
5 files changed, 5 insertions, 40 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/parameters/CommonTestData.java b/main/src/test/java/org/onap/policy/pap/main/parameters/CommonTestData.java
index 7de63cc2..e7ffce07 100644
--- a/main/src/test/java/org/onap/policy/pap/main/parameters/CommonTestData.java
+++ b/main/src/test/java/org/onap/policy/pap/main/parameters/CommonTestData.java
@@ -171,6 +171,7 @@ public class CommonTestData {
final Map<String, Object> map = new TreeMap<>();
map.put("name", PolicyModelsProviderParameters.class.getSimpleName());
map.put("implementation", DatabasePolicyModelsProviderImpl.class.getCanonicalName());
+ map.put("databaseDriver", "org.h2.Driver");
map.put("databaseUrl", "jdbc:h2:mem:testdb");
map.put("databaseUser", "policy");
map.put("databasePassword", Base64.getEncoder().encodeToString("P01icY".getBytes()));
diff --git a/main/src/test/resources/META-INF/persistence.xml b/main/src/test/resources/META-INF/persistence.xml
index a43afafc..7c455fb7 100644
--- a/main/src/test/resources/META-INF/persistence.xml
+++ b/main/src/test/resources/META-INF/persistence.xml
@@ -33,46 +33,7 @@
<class>org.onap.policy.models.pdp.persistence.concepts.JpaPdp</class>
<properties>
- <property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
- <property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:testdb" />
- <property name="javax.persistence.jdbc.user" value="policy" />
- <property name="javax.persistence.jdbc.password" value="P01icY" />
- <property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
- <property name="eclipselink.ddl-generation.output-mode" value="database" />
- <property name="eclipselink.logging.level" value="INFO" />
- </properties>
- </persistence-unit>
-
- <persistence-unit name="ToscaConceptMariaDBTest" transaction-type="RESOURCE_LOCAL">
- <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
-
- <class>org.onap.policy.models.dao.converters.CDataConditioner</class>
- <class>org.onap.policy.models.dao.converters.Uuid2String</class>
- <class>org.onap.policy.models.base.PfConceptKey</class>
- <class>org.onap.policy.models.tosca.simple.concepts.JpaToscaPolicyType</class>
- <class>org.onap.policy.models.tosca.simple.concepts.JpaToscaPolicy</class>
- <class>org.onap.policy.models.pdp.persistence.concepts.JpaPdpGroup</class>
- <class>org.onap.policy.models.pdp.persistence.concepts.JpaPdpSubGroup</class>
- <class>org.onap.policy.models.pdp.persistence.concepts.JpaPdp</class>
-
- <properties>
- <property name="javax.persistence.jdbc.driver" value="org.mariadb.jdbc.Driver" />
- <property name="javax.persistence.jdbc.url" value="jdbc:mariadb://localhost:3306/policy" />
- <property name="javax.persistence.jdbc.user" value="policy" />
- <property name="javax.persistence.jdbc.password" value="P01icY" />
<property name="javax.persistence.schema-generation.database.action" value="create" />
-
- <!-- property name="eclipselink.logging.level" value="ALL" />
- <property name="eclipselink.logging.level.jpa" value="ALL" />
- <property name="eclipselink.logging.level.ddl" value="ALL" />
- <property name="eclipselink.logging.level.connection" value="ALL" />
- <property name="eclipselink.logging.level.sql" value="ALL" />
- <property name="eclipselink.logging.level.transaction" value="ALL" />
- <property name="eclipselink.logging.level.sequencing" value="ALL" />
- <property name="eclipselink.logging.level.server" value="ALL" />
- <property name="eclipselink.logging.level.query" value="ALL" />
- <property name="eclipselink.logging.level.properties" value="ALL" /-->
-
<property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
<property name="eclipselink.ddl-generation.output-mode" value="database" />
<property name="eclipselink.logging.level" value="INFO" />
diff --git a/main/src/test/resources/parameters/MinimumParameters.json b/main/src/test/resources/parameters/MinimumParameters.json
index 7e7d3ee7..e611dc90 100644
--- a/main/src/test/resources/parameters/MinimumParameters.json
+++ b/main/src/test/resources/parameters/MinimumParameters.json
@@ -19,6 +19,7 @@
"databaseProviderParameters": {
"name": "PolicyProviderParameterGroup",
"implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
+ "databaseDriver": "org.h2.Driver",
"databaseUrl": "jdbc:h2:mem:testdb",
"databaseUser": "policy",
"databasePassword": "P01icY",
diff --git a/main/src/test/resources/parameters/PapConfigParameters.json b/main/src/test/resources/parameters/PapConfigParameters.json
index c967fdf1..05f25bb8 100644
--- a/main/src/test/resources/parameters/PapConfigParameters.json
+++ b/main/src/test/resources/parameters/PapConfigParameters.json
@@ -20,9 +20,10 @@
"databaseProviderParameters": {
"name": "PolicyProviderParameterGroup",
"implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
+ "databaseDriver": "org.h2.Driver",
"databaseUrl": "jdbc:h2:mem:testdb",
"databaseUser": "policy",
"databasePassword": "P01icY",
- "persistenceUnit": "PdpGroupTest"
+ "persistenceUnit": "ToscaConceptTest"
}
}
diff --git a/main/src/test/resources/parameters/PapConfigParameters_InvalidName.json b/main/src/test/resources/parameters/PapConfigParameters_InvalidName.json
index 8cb74172..d06ecfc8 100644
--- a/main/src/test/resources/parameters/PapConfigParameters_InvalidName.json
+++ b/main/src/test/resources/parameters/PapConfigParameters_InvalidName.json
@@ -19,6 +19,7 @@
"databaseProviderParameters": {
"name": "PolicyProviderParameterGroup",
"implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
+ "databaseDriver": "org.h2.Driver",
"databaseUrl": "jdbc:h2:mem:testdb",
"databaseUser": "policy",
"databasePassword": "P01icY",