summaryrefslogtreecommitdiffstats
path: root/model/engine-model/src/test
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-04-16 13:32:48 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-16 13:32:48 +0000
commitad9e9c590b5aadbd5f95fb6f93718f7922762cf1 (patch)
tree514aa3ccc88c6b4fea236e57450ff2d2f8d56b8c /model/engine-model/src/test
parent00ee73f723560c825818eab41a4d3db9785627d4 (diff)
parent3cb682fa71a1749fb99a47d7c8ede2b8984e2c07 (diff)
Merge "Fix Security and Unit Test DB issues"
Diffstat (limited to 'model/engine-model/src/test')
-rw-r--r--model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/ApexEngineModelTest.java23
-rw-r--r--model/engine-model/src/test/resources/META-INF/persistence.xml6
2 files changed, 6 insertions, 23 deletions
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<AxEngineModel> 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>(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 @@
<class>org.onap.policy.apex.model.enginemodel.concepts.AxEngineStats</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" />