aboutsummaryrefslogtreecommitdiffstats
path: root/model/model-api
diff options
context:
space:
mode:
Diffstat (limited to 'model/model-api')
-rw-r--r--model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexModelApiTest.java12
-rw-r--r--model/model-api/src/test/resources/META-INF/persistence.xml8
2 files changed, 9 insertions, 11 deletions
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 @@
<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="eclipselink.ddl-generation" value="create-tables" />
+ <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="create-or-extend-tables" />
<property name="eclipselink.ddl-generation.output-mode" value="database" />
<property name="eclipselink.logging.level" value="INFO" />
</properties>