Replace non-Javadoc comments with inheritDocs
[policy/apex-pdp.git] / testsuites / integration / integration-executor-test / src / test / java / org / onap / policy / apex / testsuites / integration / executor / handling / TestApexSamplePolicyModel.java
index 1e7daad..a2fa423 100644 (file)
@@ -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=========================================================
  */
@@ -25,7 +25,6 @@ import static org.junit.Assert.assertTrue;
 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;
@@ -39,7 +38,6 @@ import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
  */
 public class TestApexSamplePolicyModel {
     private static final String VALID_MODEL_STRING = "***validation of model successful***";
-    private Connection connection;
     private TestApexModel<AxPolicyModel> testApexModel;
 
     /**
@@ -49,22 +47,10 @@ public class TestApexSamplePolicyModel {
      */
     @Before
     public void setup() throws Exception {
-        connection = DriverManager.getConnection("jdbc:derby:memory:apex_test;create=true");
-
         testApexModel =
                 new TestApexModel<AxPolicyModel>(AxPolicyModel.class, new TestApexSamplePolicyModelCreator("MVEL"));
     }
 
-    /**
-     * Teardown.
-     *
-     * @throws Exception the exception
-     */
-    @After
-    public void teardown() throws Exception {
-        connection.close();
-    }
-
     /**
      * Test model valid.
      *
@@ -104,11 +90,13 @@ public class TestApexSamplePolicyModel {
     @Test
     public void testModelWriteReadJpa() throws Exception {
         final DaoParameters DaoParameters = new DaoParameters();
-        DaoParameters.setPluginClass(DefaultApexDao.class.getCanonicalName());
+        DaoParameters.setPluginClass(DefaultApexDao.class.getName());
         DaoParameters.setPersistenceUnit("SampleModelTest");
 
+        Connection connection = DriverManager.getConnection("jdbc:h2:mem:testdb");
         testApexModel.testApexModelWriteReadJpa(DaoParameters);
+        connection.close();
     }
 
-    
+
 }