Remove references to MariaDB from resource files 29/126629/2
authorwaynedunican <wayne.dunican@est.tech>
Tue, 4 Jan 2022 21:49:42 +0000 (21:49 +0000)
committerWayne Dunican <wayne.dunican@est.tech>
Wed, 19 Jan 2022 09:25:32 +0000 (09:25 +0000)
Issue-ID: POLICY-2086
Change-Id: I3c7d95863e1f46f5d0217bad6bd486de95e16b3a
Signed-off-by: Wayne Dunican <wayne.dunican@est.tech>
main/pom.xml
main/src/main/resources/META-INF/persistence.xml
main/src/test/java/org/onap/policy/api/main/parameters/TestApiParameterHandler.java
main/src/test/resources/parameters/ApiConfigParameters_Postgres.json [new file with mode: 0644]
packages/policy-api-tarball/src/main/resources/etc/defaultConfig.json
packages/policy-api-tarball/src/main/resources/etc/s3pConfig.json
testsuites/stability/src/main/resources/apisetup/config/api/etc/defaultConfig.json

index 1d04e40..5e54f2d 100644 (file)
@@ -4,6 +4,7 @@
    Modified Copyright (C) 2018 Samsung Electronics Co., Ltd.
    Copyright (C) 2019,2021 AT&T Intellectual Property. All rights reserved.
    Modifications Copyright (C) 2020 Bell Canada.
+   Modifications Copyright (C) 2022 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
             <groupId>org.mariadb.jdbc</groupId>
             <artifactId>mariadb-java-client</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.postgresql</groupId>
+            <artifactId>postgresql</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.assertj</groupId>
             <artifactId>assertj-core</artifactId>
index d744e0d..aabe0f1 100644 (file)
@@ -3,7 +3,7 @@
   ============LICENSE_START=======================================================
    Copyright (C) 2019-2020 Nordix Foundation.
    Modifications Copyright (C) 2021 AT&T Intellectual Property.
-   Modification Copyright 2021. Nordix Foundation.
+   Modification Copyright 2022 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
     xmlns="http://java.sun.com/xml/ns/persistence"
     version="2.0">
     <persistence-unit
-        name="PolicyMariaDb"
+        name="PolicyDb"
         transaction-type="RESOURCE_LOCAL">
         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
 
index 5443e8c..26ecd02 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Samsung Electronics Co., Ltd. All rights reserved.
  *  Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
- *  Modifications Copyright (C) 2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2022 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -126,6 +126,16 @@ public class TestApiParameterHandler {
         assertEquals(CommonTestData.API_GROUP_NAME, parGroup.getName());
     }
 
+    @Test
+    public void testApiParameterGroup_Postgres() throws PolicyApiException, CommandLineException {
+        final String[] apiConfigParameters = {"-c", "parameters/ApiConfigParameters_Postgres.json"};
+        final ApiCommandLineArguments arguments = new ApiCommandLineArguments();
+        arguments.parse(apiConfigParameters);
+        final ApiParameterGroup parGroup = new ApiParameterHandler().getParameters(arguments);
+        assertTrue(arguments.checkSetConfigurationFilePath());
+        assertEquals(CommonTestData.API_GROUP_NAME, parGroup.getName());
+    }
+
     @Test
     public void testApiParameterGroup_Invalid() throws PolicyApiException, CommandLineException {
         final String[] apiConfigParameters = {"-c", "parameters/ApiConfigParameters_InvalidName.json"};
diff --git a/main/src/test/resources/parameters/ApiConfigParameters_Postgres.json b/main/src/test/resources/parameters/ApiConfigParameters_Postgres.json
new file mode 100644 (file)
index 0000000..e5c375a
--- /dev/null
@@ -0,0 +1,56 @@
+{
+    "name":"ApiGroup",
+    "restServerParameters":{
+        "host":"0.0.0.0",
+        "port":6968,
+        "userName":"healthcheck",
+        "password":"zb!XztG34",
+        "https":false
+    },
+    "databaseProviderParameters": {
+        "name": "PolicyProviderParameterGroup",
+        "implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
+        "databaseDriver": "org.postgresql.Driver",
+        "databaseUrl": "jdbc:postgresql://localhost:5432/policyadmin",
+        "databaseUser": "policy_user",
+        "databasePassword": "policy_user",
+        "persistenceUnit": "PolicyDb"
+    },
+    "preloadPolicyTypes": [
+        "policytypes/onap.policies.monitoring.tcagen2.yaml",
+        "policytypes/onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server.yaml",
+        "policytypes/onap.policies.monitoring.dcae-restconfcollector.yaml",
+        "policytypes/onap.policies.monitoring.dcae-pm-subscription-handler.yaml",
+        "policytypes/onap.policies.monitoring.dcae-pm-mapper.yaml",
+        "policytypes/onap.policies.Optimization.yaml",
+        "policytypes/onap.policies.optimization.Resource.yaml",
+        "policytypes/onap.policies.optimization.Service.yaml",
+        "policytypes/onap.policies.optimization.resource.AffinityPolicy.yaml",
+        "policytypes/onap.policies.optimization.resource.DistancePolicy.yaml",
+        "policytypes/onap.policies.optimization.resource.HpaPolicy.yaml",
+        "policytypes/onap.policies.optimization.resource.OptimizationPolicy.yaml",
+        "policytypes/onap.policies.optimization.resource.PciPolicy.yaml",
+        "policytypes/onap.policies.optimization.service.QueryPolicy.yaml",
+        "policytypes/onap.policies.optimization.service.SubscriberPolicy.yaml",
+        "policytypes/onap.policies.optimization.resource.Vim_fit.yaml",
+        "policytypes/onap.policies.optimization.resource.VnfPolicy.yaml",
+        "policytypes/onap.policies.controlloop.guard.Common.yaml",
+        "policytypes/onap.policies.controlloop.guard.common.Blacklist.yaml",
+        "policytypes/onap.policies.controlloop.guard.common.FrequencyLimiter.yaml",
+        "policytypes/onap.policies.controlloop.guard.common.MinMax.yaml",
+        "policytypes/onap.policies.controlloop.guard.common.Filter.yaml",
+        "policytypes/onap.policies.controlloop.guard.coordination.FirstBlocksSecond.yaml",
+        "policytypes/onap.policies.controlloop.Operational.yaml",
+        "policytypes/onap.policies.Naming.yaml",
+        "policytypes/onap.policies.Match.yaml",
+        "policytypes/onap.policies.native.Drools.yaml",
+        "policytypes/onap.policies.native.Xacml.yaml",
+        "policytypes/onap.policies.native.Apex.yaml",
+        "policytypes/onap.policies.controlloop.operational.Common.yaml",
+        "policytypes/onap.policies.controlloop.operational.common.Apex.yaml",
+        "policytypes/onap.policies.controlloop.operational.common.Drools.yaml"
+    ],
+    "preloadPolicies" : [
+        "policies/sdnc.policy.naming.input.tosca.yaml"
+    ]
+}
index 0aa4629..555a113 100644 (file)
@@ -16,7 +16,7 @@
         "databaseUrl": "jdbc:mariadb://mariadb:3306/policyadmin",
         "databaseUser": "policy_user",
         "databasePassword": "policy_user",
-        "persistenceUnit": "PolicyMariaDb"
+        "persistenceUnit": "PolicyDb"
     },
     "preloadPolicyTypes": [
         "policytypes/onap.policies.monitoring.tcagen2.yaml",
index 8a32b38..5bd1797 100644 (file)
@@ -15,7 +15,7 @@
         "databaseUrl": "jdbc:mariadb://mariadb:3306/policyadmin",
         "databaseUser": "policy_user",
         "databasePassword": "policy_user",
-        "persistenceUnit": "PolicyMariaDb"
+        "persistenceUnit": "PolicyDb"
     },
     "preloadPolicyTypes": [
         "policytypes/onap.policies.monitoring.tcagen2.yaml",
index e25c52b..59e6fc4 100644 (file)
@@ -15,7 +15,7 @@
         "databaseUrl": "jdbc:mariadb://mariadb:3306/policyadmin",
         "databaseUser": "policy_user",
         "databasePassword": "policy_user",
-        "persistenceUnit": "PolicyMariaDb"
+        "persistenceUnit": "PolicyDb"
     },
     "preloadPolicyTypes": [
         "policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app.yaml",