aboutsummaryrefslogtreecommitdiffstats
path: root/examples/examples-myfirstpolicy/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/examples-myfirstpolicy/src')
-rw-r--r--examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/MfpModelTest.java20
-rw-r--r--examples/examples-myfirstpolicy/src/test/resources/META-INF/persistence.xml6
2 files changed, 2 insertions, 24 deletions
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<AxPolicyModel> testApexModel1;
private static TestApexModel<AxPolicyModel> testApexModel2;
@@ -51,24 +44,11 @@ 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.
*
* @throws Exception if there is an error
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 @@
<class>org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel</class>
<properties>
- <property name="javax.persistence.jdbc.url" value="jdbc:derby:memory:apex_test" />
- <property name="javax.persistence.target-database" value="Derby" />
- <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver" />
-
+ <property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:testdb" />
+ <property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
<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" />