aboutsummaryrefslogtreecommitdiffstats
path: root/runtime-controlloop/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'runtime-controlloop/src/test')
-rw-r--r--runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/commissioning/CommissioningProviderTest.java31
-rw-r--r--runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/config/messaging/MessageDispatcherActivatorTest.java5
-rw-r--r--runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java2
-rw-r--r--runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/monitoring/TestMonitoringProvider.java17
-rw-r--r--runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/SupervisionMessagesTest.java4
-rw-r--r--runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/util/CommonTestData.java14
-rw-r--r--runtime-controlloop/src/test/resources/application_test.properties24
-rw-r--r--runtime-controlloop/src/test/resources/parameters/CommissioningConfig.json24
-rw-r--r--runtime-controlloop/src/test/resources/parameters/EmptyParameters.json0
-rw-r--r--runtime-controlloop/src/test/resources/parameters/InstantiationConfigParametersStd.json56
-rw-r--r--runtime-controlloop/src/test/resources/parameters/InstantiationConfigParameters_InvalidName.json35
-rw-r--r--runtime-controlloop/src/test/resources/parameters/InstantiationConfigParameters_sim.json55
-rw-r--r--runtime-controlloop/src/test/resources/parameters/InvalidParameters.json3
-rw-r--r--runtime-controlloop/src/test/resources/parameters/MinimumParametersH2.json53
-rw-r--r--runtime-controlloop/src/test/resources/parameters/NoParameters.json2
-rw-r--r--runtime-controlloop/src/test/resources/parameters/TestParameters.json12
-rw-r--r--runtime-controlloop/src/test/resources/parameters/Unreadable.json55
17 files changed, 47 insertions, 345 deletions
diff --git a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/commissioning/CommissioningProviderTest.java b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/commissioning/CommissioningProviderTest.java
index 440380781..448df4199 100644
--- a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/commissioning/CommissioningProviderTest.java
+++ b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/commissioning/CommissioningProviderTest.java
@@ -31,9 +31,6 @@ import org.junit.jupiter.api.Test;
import org.onap.policy.clamp.controlloop.models.controlloop.persistence.provider.ControlLoopProvider;
import org.onap.policy.clamp.controlloop.runtime.main.parameters.ClRuntimeParameterGroup;
import org.onap.policy.clamp.controlloop.runtime.util.CommonTestData;
-import org.onap.policy.common.utils.coder.Coder;
-import org.onap.policy.common.utils.coder.CoderException;
-import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.coder.YamlJsonTranslator;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.models.provider.PolicyModelsProvider;
@@ -46,31 +43,11 @@ class CommissioningProviderTest {
private static final String TOSCA_SERVICE_TEMPLATE_YAML =
"src/test/resources/rest/servicetemplates/pmsh_multiple_cl_tosca.yaml";
private static final String TEMPLATE_IS_NULL = ".*serviceTemplate is marked non-null but is null";
- private static final Coder CODER = new StandardCoder();
private static final YamlJsonTranslator yamlTranslator = new YamlJsonTranslator();
- private static int dbNum = 0;
- private static final Object lockit = new Object();
private PolicyModelsProvider modelsProvider = null;
private ControlLoopProvider clProvider = null;
- private static String getParameterGroupAsString() {
- dbNum++;
- return ResourceUtils.getResourceAsString("src/test/resources/parameters/TestParameters.json")
- .replace("jdbc:h2:mem:testdb", "jdbc:h2:mem:commissioningdb" + dbNum);
- }
-
- /**
- * return a Cl Runtime Parameters.
- *
- * @throws CoderException .
- */
- public ClRuntimeParameterGroup getClRuntimeParameterGroup() throws CoderException {
- synchronized (lockit) {
- return CODER.decode(getParameterGroupAsString(), ClRuntimeParameterGroup.class);
- }
- }
-
@AfterEach
void close() throws Exception {
if (modelsProvider != null) {
@@ -88,7 +65,7 @@ class CommissioningProviderTest {
*/
@Test
void testGetControlLoopDefinitions() throws Exception {
- ClRuntimeParameterGroup clRuntimeParameterGroup = getClRuntimeParameterGroup();
+ ClRuntimeParameterGroup clRuntimeParameterGroup = CommonTestData.geParameterGroup("getCLDefinitions");
modelsProvider =
CommonTestData.getPolicyModelsProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
clProvider = new ControlLoopProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
@@ -125,7 +102,7 @@ class CommissioningProviderTest {
*/
@Test
void testCreateControlLoopDefinitions() throws Exception {
- ClRuntimeParameterGroup clRuntimeParameterGroup = getClRuntimeParameterGroup();
+ ClRuntimeParameterGroup clRuntimeParameterGroup = CommonTestData.geParameterGroup("createCLDefinitions");
modelsProvider =
CommonTestData.getPolicyModelsProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
clProvider = new ControlLoopProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
@@ -154,7 +131,7 @@ class CommissioningProviderTest {
*/
@Test
void testDeleteControlLoopDefinitions() throws Exception {
- ClRuntimeParameterGroup clRuntimeParameterGroup = getClRuntimeParameterGroup();
+ ClRuntimeParameterGroup clRuntimeParameterGroup = CommonTestData.geParameterGroup("deleteCLDefinitions");
modelsProvider =
CommonTestData.getPolicyModelsProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
clProvider = new ControlLoopProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
@@ -182,7 +159,7 @@ class CommissioningProviderTest {
*/
@Test
void testGetControlLoopElementDefinitions() throws Exception {
- ClRuntimeParameterGroup clRuntimeParameterGroup = getClRuntimeParameterGroup();
+ ClRuntimeParameterGroup clRuntimeParameterGroup = CommonTestData.geParameterGroup("getCLElDefinitions");
modelsProvider =
CommonTestData.getPolicyModelsProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
clProvider = new ControlLoopProvider(clRuntimeParameterGroup.getDatabaseProviderParameters());
diff --git a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/config/messaging/MessageDispatcherActivatorTest.java b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/config/messaging/MessageDispatcherActivatorTest.java
index 2b4abaa3b..461c8b558 100644
--- a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/config/messaging/MessageDispatcherActivatorTest.java
+++ b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/config/messaging/MessageDispatcherActivatorTest.java
@@ -33,8 +33,8 @@ import static org.mockito.Mockito.when;
import org.junit.jupiter.api.Test;
import org.onap.policy.clamp.controlloop.runtime.main.parameters.ClRuntimeParameterGroup;
-import org.onap.policy.clamp.controlloop.runtime.main.parameters.ClRuntimeParameterHandler;
import org.onap.policy.clamp.controlloop.runtime.supervision.comm.ParticipantStatusListener;
+import org.onap.policy.clamp.controlloop.runtime.util.CommonTestData;
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.coder.StandardCoderObject;
@@ -52,8 +52,7 @@ class MessageDispatcherActivatorTest {
@Test
void testStartAndStop() throws Exception {
- final String path = "src/test/resources/parameters/TestParameters.json";
- ClRuntimeParameterGroup parameterGroup = new ClRuntimeParameterHandler().getParameters(path);
+ ClRuntimeParameterGroup parameterGroup = CommonTestData.geParameterGroup("dbtest");
var publisherFirst = spy(mock(Publisher.class));
var publisherSecond = spy(mock(Publisher.class));
diff --git a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java
index b92f341eb..b474b0cdf 100644
--- a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java
+++ b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/instantiation/ControlLoopInstantiationProviderTest.java
@@ -100,7 +100,7 @@ class ControlLoopInstantiationProviderTest {
*/
@BeforeAll
public static void setupDbProviderParameters() throws PfModelException {
- ClRuntimeParameterGroup controlLoopParameters = CommonTestData.geParameterGroup(0, "instantproviderdb");
+ ClRuntimeParameterGroup controlLoopParameters = CommonTestData.geParameterGroup("instantproviderdb");
modelsProvider =
CommonTestData.getPolicyModelsProvider(controlLoopParameters.getDatabaseProviderParameters());
diff --git a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/monitoring/TestMonitoringProvider.java b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/monitoring/TestMonitoringProvider.java
index c47211a2d..5f885ec97 100644
--- a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/monitoring/TestMonitoringProvider.java
+++ b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/monitoring/TestMonitoringProvider.java
@@ -97,7 +97,7 @@ class TestMonitoringProvider {
@Test
void testCreateParticipantStatistics() throws Exception {
- ClRuntimeParameterGroup parameters = CommonTestData.geParameterGroup(0, "createparStat");
+ ClRuntimeParameterGroup parameters = CommonTestData.geParameterGroup("createparStat");
participantStatisticsProvider = new ParticipantStatisticsProvider(parameters.getDatabaseProviderParameters());
clElementStatisticsProvider = new ClElementStatisticsProvider(parameters.getDatabaseProviderParameters());
clProvider = new ControlLoopProvider(parameters.getDatabaseProviderParameters());
@@ -123,7 +123,7 @@ class TestMonitoringProvider {
@Test
void testGetParticipantStatistics() throws Exception {
- ClRuntimeParameterGroup parameters = CommonTestData.geParameterGroup(0, "getparStat");
+ ClRuntimeParameterGroup parameters = CommonTestData.geParameterGroup("getparStat");
participantStatisticsProvider = new ParticipantStatisticsProvider(parameters.getDatabaseProviderParameters());
clElementStatisticsProvider = new ClElementStatisticsProvider(parameters.getDatabaseProviderParameters());
clProvider = new ControlLoopProvider(parameters.getDatabaseProviderParameters());
@@ -156,7 +156,7 @@ class TestMonitoringProvider {
@Test
void testCreateClElementStatistics() throws Exception {
- ClRuntimeParameterGroup parameters = CommonTestData.geParameterGroup(0, "createelemstat");
+ ClRuntimeParameterGroup parameters = CommonTestData.geParameterGroup("createelemstat");
participantStatisticsProvider = new ParticipantStatisticsProvider(parameters.getDatabaseProviderParameters());
clElementStatisticsProvider = new ClElementStatisticsProvider(parameters.getDatabaseProviderParameters());
clProvider = new ControlLoopProvider(parameters.getDatabaseProviderParameters());
@@ -183,14 +183,13 @@ class TestMonitoringProvider {
@Test
void testGetClElementStatistics() throws Exception {
- ClRuntimeParameterGroup parameters = CommonTestData.geParameterGroup(0, "getelemstat");
+ ClRuntimeParameterGroup parameters = CommonTestData.geParameterGroup("getelemstat");
participantStatisticsProvider = new ParticipantStatisticsProvider(parameters.getDatabaseProviderParameters());
clElementStatisticsProvider = new ClElementStatisticsProvider(parameters.getDatabaseProviderParameters());
clProvider = new ControlLoopProvider(parameters.getDatabaseProviderParameters());
MonitoringProvider provider =
new MonitoringProvider(participantStatisticsProvider, clElementStatisticsProvider, clProvider);
-
assertThatThrownBy(() -> {
provider.fetchFilteredClElementStatistics(null, null, null, null, null, 0);
}).hasMessageMatching("name is marked .*null but is null");
@@ -217,7 +216,7 @@ class TestMonitoringProvider {
@Test
void testGetParticipantStatsPerCL() throws Exception {
- ClRuntimeParameterGroup parameters = CommonTestData.geParameterGroup(0, "getparStatCL");
+ ClRuntimeParameterGroup parameters = CommonTestData.geParameterGroup("getparStatCL");
participantStatisticsProvider = new ParticipantStatisticsProvider(parameters.getDatabaseProviderParameters());
clElementStatisticsProvider = new ClElementStatisticsProvider(parameters.getDatabaseProviderParameters());
var mockClProvider = Mockito.mock(ControlLoopProvider.class);
@@ -253,7 +252,7 @@ class TestMonitoringProvider {
mockCL.setElements(new LinkedHashMap<>());
mockCL.getElements().put(mockClElement.getId(), mockClElement);
- ClRuntimeParameterGroup parameters = CommonTestData.geParameterGroup(0, "getelemstatPerCL");
+ ClRuntimeParameterGroup parameters = CommonTestData.geParameterGroup("getelemstatPerCL");
participantStatisticsProvider = new ParticipantStatisticsProvider(parameters.getDatabaseProviderParameters());
clElementStatisticsProvider = new ClElementStatisticsProvider(parameters.getDatabaseProviderParameters());
ControlLoopProvider mockClProvider = Mockito.mock(ControlLoopProvider.class);
@@ -265,8 +264,8 @@ class TestMonitoringProvider {
monitoringProvider.createClElementStatistics(inputClElementStatistics.getClElementStatistics());
- ClElementStatisticsList getResponse;
- getResponse = monitoringProvider.fetchClElementStatsPerControlLoop("testCLName", "1.001");
+ ClElementStatisticsList getResponse =
+ monitoringProvider.fetchClElementStatsPerControlLoop("testCLName", "1.001");
assertThat(getResponse.getClElementStatistics()).hasSize(2);
assertEquals(getResponse.getClElementStatistics().get(1).toString().replaceAll("\\s+", ""),
diff --git a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/SupervisionMessagesTest.java b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/SupervisionMessagesTest.java
index f08cda12b..305850cbd 100644
--- a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/SupervisionMessagesTest.java
+++ b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/supervision/comm/SupervisionMessagesTest.java
@@ -20,8 +20,6 @@
package org.onap.policy.clamp.controlloop.runtime.supervision.comm;
-import static org.assertj.core.api.Assertions.assertThat;
-
import java.time.Instant;
import java.util.Collections;
import java.util.List;
@@ -79,7 +77,7 @@ class SupervisionMessagesTest extends CommonRestController {
*/
@BeforeAll
public static void setupDbProviderParameters() throws PfModelException {
- ClRuntimeParameterGroup controlLoopParameters = CommonTestData.geParameterGroup(0, "instantproviderdb");
+ ClRuntimeParameterGroup controlLoopParameters = CommonTestData.geParameterGroup("instantproviderdb");
modelsProvider =
CommonTestData.getPolicyModelsProvider(controlLoopParameters.getDatabaseProviderParameters());
diff --git a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/util/CommonTestData.java b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/util/CommonTestData.java
index 464c14354..300c662ce 100644
--- a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/util/CommonTestData.java
+++ b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/util/CommonTestData.java
@@ -38,19 +38,18 @@ import org.onap.policy.models.provider.PolicyModelsProviderParameters;
*
*/
public class CommonTestData {
- private static final Coder coder = new StandardCoder();
+ private static final Coder CODER = new StandardCoder();
/**
* Gets the standard Control Loop parameters.
*
- * @param port port to be inserted into the parameters
* @param dbName the database name
* @return the standard Control Loop parameters
* @throws ControlLoopRuntimeException on errors reading the control loop parameters
*/
- public static ClRuntimeParameterGroup geParameterGroup(final int port, final String dbName) {
+ public static ClRuntimeParameterGroup geParameterGroup(final String dbName) {
try {
- return coder.decode(getParameterGroupAsString(port, dbName), ClRuntimeParameterGroup.class);
+ return CODER.convert(getParameterGroupAsString(dbName), ClRuntimeParameterGroup.class);
} catch (CoderException e) {
throw new ControlLoopRuntimeException(Status.NOT_ACCEPTABLE, "cannot read Control Loop parameters", e);
@@ -60,13 +59,12 @@ public class CommonTestData {
/**
* Gets the standard Control Loop parameters, as a String.
*
- * @param port port to be inserted into the parameters
* @param dbName the database name
* @return the standard Control Loop parameters as string
*/
- public static String getParameterGroupAsString(final int port, final String dbName) {
- return ResourceUtils.getResourceAsString("src/test/resources/parameters/InstantiationConfigParametersStd.json")
- .replace("${port}", String.valueOf(port)).replace("${dbName}", "jdbc:h2:mem:" + dbName);
+ public static String getParameterGroupAsString(final String dbName) {
+ return ResourceUtils.getResourceAsString("src/test/resources/parameters/TestParameters.json")
+ .replace("${dbName}", "jdbc:h2:mem:" + dbName);
}
/**
diff --git a/runtime-controlloop/src/test/resources/application_test.properties b/runtime-controlloop/src/test/resources/application_test.properties
index fc24ea290..e51db25ce 100644
--- a/runtime-controlloop/src/test/resources/application_test.properties
+++ b/runtime-controlloop/src/test/resources/application_test.properties
@@ -6,4 +6,26 @@ server.port=6969
server.servlet.context-path=/onap/controlloop
server.error.path=/error
-runtime.file=src/test/resources/parameters/TestParameters.json
+runtime.supervisionScannerIntervalSec=1000
+runtime.participantStateChangeIntervalSec=1000
+runtime.participantClUpdateIntervalSec=1000
+runtime.participantClStateChangeIntervalSec=1000
+runtime.participantParameters.heartBeatMs=120000
+runtime.participantParameters.updateParameters.maxRetryCount=1
+runtime.participantParameters.updateParameters.maxWaitMs=30000
+runtime.participantParameters.stateChangeParameters.maxRetryCount=1
+runtime.participantParameters.stateChangeParameters.maxWaitMs=30000
+runtime.databaseProviderParameters.name=PolicyProviderParameterGroup
+runtime.databaseProviderParameters.implementation=org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl
+runtime.databaseProviderParameters.databaseDriver=org.h2.Driver
+runtime.databaseProviderParameters.databaseUrl=jdbc:h2:mem:testdb
+runtime.databaseProviderParameters.databaseUser=policy
+runtime.databaseProviderParameters.databasePassword=P01icY
+runtime.databaseProviderParameters.persistenceUnit=ToscaConceptTest
+runtime.topicParameterGroup.topicSources[0].topic=POLICY-CLRUNTIME-PARTICIPANT
+runtime.topicParameterGroup.topicSources[0].servers[0]=localhost
+runtime.topicParameterGroup.topicSources[0].topicCommInfrastructure=dmaap
+runtime.topicParameterGroup.topicSources[0].fetchTimeout=15000
+runtime.topicParameterGroup.topicSinks[0].topic=POLICY-CLRUNTIME-PARTICIPANT
+runtime.topicParameterGroup.topicSinks[0].servers[0]=localhost
+runtime.topicParameterGroup.topicSinks[0].topicCommInfrastructure=dmaap
diff --git a/runtime-controlloop/src/test/resources/parameters/CommissioningConfig.json b/runtime-controlloop/src/test/resources/parameters/CommissioningConfig.json
deleted file mode 100644
index 762e3f793..000000000
--- a/runtime-controlloop/src/test/resources/parameters/CommissioningConfig.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "CommissioningGroup",
- "supervisionScannerIntervalSec" : 1000,
- "participantStateChangeIntervalSec" : 1000,
- "participantClUpdateIntervalSec" : 1000,
- "participantClStateChangeIntervalSec" : 1000,
- "restServerParameters": {
- "host": "127.0.0.1",
- "port": 6969,
- "userName": "admin",
- "password": "password",
- "https": false,
- "aaf": false
- },
- "databaseProviderParameters": {
- "name": "CommissioningProviderParameterGroup",
- "implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
- "databaseDriver": "org.h2.Driver",
- "databaseUrl": "jdbc:h2:mem:testdb",
- "databaseUser": "controlloop",
- "databasePassword": "C0ntr0lL00p",
- "persistenceUnit": "ToscaConceptTest"
- }
-}
diff --git a/runtime-controlloop/src/test/resources/parameters/EmptyParameters.json b/runtime-controlloop/src/test/resources/parameters/EmptyParameters.json
deleted file mode 100644
index e69de29bb..000000000
--- a/runtime-controlloop/src/test/resources/parameters/EmptyParameters.json
+++ /dev/null
diff --git a/runtime-controlloop/src/test/resources/parameters/InstantiationConfigParametersStd.json b/runtime-controlloop/src/test/resources/parameters/InstantiationConfigParametersStd.json
deleted file mode 100644
index 71df254e2..000000000
--- a/runtime-controlloop/src/test/resources/parameters/InstantiationConfigParametersStd.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "name": "ControlLoopRuntimeGroup",
- "supervisionScannerIntervalSec": 1000,
- "participantStateChangeIntervalSec": 1000,
- "participantClUpdateIntervalSec": 1000,
- "participantClStateChangeIntervalSec": 1000,
- "restServerParameters": {
- "host": "0.0.0.0",
- "port": ${port},
- "userName": "healthcheck",
- "password": "zb!XztG34",
- "https": false,
- "aaf": false
- },
- "participantParameters": {
- "heartBeatMs": 120000,
- "updateParameters": {
- "maxRetryCount": 1,
- "maxWaitMs": 30000
- },
- "stateChangeParameters": {
- "maxRetryCount": 1,
- "maxWaitMs": 30000
- }
- },
- "databaseProviderParameters": {
- "name": "PolicyProviderParameterGroup",
- "implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
- "databaseDriver": "org.h2.Driver",
- "databaseUrl": "${dbName}",
- "databaseUser": "policy",
- "databasePassword": "P01icY",
- "persistenceUnit": "InstantiationTests"
- },
- "topicParameterGroup": {
- "topicSources": [
- {
- "topic": "POLICY-CLRUNTIME-PARTICIPANT",
- "servers": [
- "localhost"
- ],
- "topicCommInfrastructure": "dmaap",
- "fetchTimeout": 15000
- }
- ],
- "topicSinks": [
- {
- "topic": "POLICY-CLRUNTIME-PARTICIPANT",
- "servers": [
- "localhost"
- ],
- "topicCommInfrastructure": "dmaap"
- }
- ]
- }
-}
diff --git a/runtime-controlloop/src/test/resources/parameters/InstantiationConfigParameters_InvalidName.json b/runtime-controlloop/src/test/resources/parameters/InstantiationConfigParameters_InvalidName.json
deleted file mode 100644
index 944bc770d..000000000
--- a/runtime-controlloop/src/test/resources/parameters/InstantiationConfigParameters_InvalidName.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "name": " ",
- "supervisionScannerIntervalSec": 1000,
- "participantStateChangeIntervalSec": 1000,
- "participantClUpdateIntervalSec": 1000,
- "participantClStateChangeIntervalSec": 1000,
- "restServerParameters": {
- "host": "127.0.0.1",
- "port": 6969,
- "userName": "admin",
- "password": "password",
- "https": false,
- "aaf": false
- },
- "pdpParameters": {
- "heartBeatMs": 1,
- "updateParameters": {
- "maxRetryCount": 1,
- "maxWaitMs": 1
- },
- "stateChangeParameters": {
- "maxRetryCount": 1,
- "maxWaitMs": 1
- }
- },
- "databaseProviderParameters": {
- "name": "PolicyProviderParameterGroup",
- "implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
- "databaseDriver": "org.h2.Driver",
- "databaseUrl": "jdbc:h2:mem:testdb",
- "databaseUser": "policy",
- "databasePassword": "P01icY",
- "persistenceUnit": "PdpGroupTest"
- }
-}
diff --git a/runtime-controlloop/src/test/resources/parameters/InstantiationConfigParameters_sim.json b/runtime-controlloop/src/test/resources/parameters/InstantiationConfigParameters_sim.json
deleted file mode 100644
index 47cb74838..000000000
--- a/runtime-controlloop/src/test/resources/parameters/InstantiationConfigParameters_sim.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "name": "Instantiation",
- "supervisionScannerIntervalSec": 1000,
- "participantStateChangeIntervalSec": 1000,
- "participantClUpdateIntervalSec": 1000,
- "participantClStateChangeIntervalSec": 1000,
- "restServerParameters": {
- "host": "127.0.0.1",
- "port": 6969,
- "userName": "admin",
- "password": "password",
- "https": false,
- "aaf": false
- },
- "pdpParameters": {
- "heartBeatMs": 10,
- "updateParameters": {
- "maxRetryCount": 1,
- "maxWaitMs": 30000
- },
- "stateChangeParameters": {
- "maxRetryCount": 1,
- "maxWaitMs": 30000
- }
- },
- "databaseProviderParameters": {
- "name": "PolicyProviderParameterGroup",
- "implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
- "databaseDriver": "org.mariadb.jdbc.Driver",
- "databaseUrl": "jdbc:mariadb://localhost:3306/policyadmin",
- "databaseUser": "policy",
- "databasePassword": "UDAxaWNZ",
- "persistenceUnit": "PolicyMariaDb"
- },
- "topicParameterGroup": {
- "topicSources": [
- {
- "topic": "INSTANTIATION",
- "servers": [
- "localhost:6845"
- ],
- "topicCommInfrastructure": "dmaap"
- }
- ],
- "topicSinks": [
- {
- "topic": "INSTANTIATION",
- "servers": [
- "localhost:6845"
- ],
- "topicCommInfrastructure": "dmaap"
- }
- ]
- }
-}
diff --git a/runtime-controlloop/src/test/resources/parameters/InvalidParameters.json b/runtime-controlloop/src/test/resources/parameters/InvalidParameters.json
deleted file mode 100644
index 976ec2937..000000000
--- a/runtime-controlloop/src/test/resources/parameters/InvalidParameters.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "name": ""
-}
diff --git a/runtime-controlloop/src/test/resources/parameters/MinimumParametersH2.json b/runtime-controlloop/src/test/resources/parameters/MinimumParametersH2.json
deleted file mode 100644
index 2be642943..000000000
--- a/runtime-controlloop/src/test/resources/parameters/MinimumParametersH2.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- "name": "PapGroup",
- "supervisionScannerIntervalSec": 1000,
- "participantStateChangeIntervalSec": 1000,
- "participantClUpdateIntervalSec": 1000,
- "participantClStateChangeIntervalSec": 1000,
- "restServerParameters": {
- "host": "0.0.0.0",
- "port": 6969,
- "userName": "healthcheck",
- "password": "zb!XztG34"
- },
- "pdpParameters": {
- "heartBeatMs": 1,
- "updateParameters": {
- "maxRetryCount": 1,
- "maxWaitMs": 1
- },
- "stateChangeParameters": {
- "maxRetryCount": 1,
- "maxWaitMs": 1
- }
- },
- "databaseProviderParameters": {
- "name": "PolicyProviderParameterGroup",
- "implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
- "databaseDriver": "org.h2.Driver",
- "databaseUrl": "jdbc:h2:mem:testdb",
- "databaseUser": "policy",
- "databasePassword": "P01icY",
- "persistenceUnit": "PdpGroupTest"
- },
- "topicParameterGroup": {
- "topicSources": [
- {
- "topic": "POLICY-PDP-PAP",
- "servers": [
- "message-router"
- ],
- "topicCommInfrastructure": "dmaap"
- }
- ],
- "topicSinks": [
- {
- "topic": "POLICY-PDP-PAP",
- "servers": [
- "message-router"
- ],
- "topicCommInfrastructure": "dmaap"
- }
- ]
- }
-}
diff --git a/runtime-controlloop/src/test/resources/parameters/NoParameters.json b/runtime-controlloop/src/test/resources/parameters/NoParameters.json
deleted file mode 100644
index 2c63c0851..000000000
--- a/runtime-controlloop/src/test/resources/parameters/NoParameters.json
+++ /dev/null
@@ -1,2 +0,0 @@
-{
-}
diff --git a/runtime-controlloop/src/test/resources/parameters/TestParameters.json b/runtime-controlloop/src/test/resources/parameters/TestParameters.json
index 680e070f2..07c90d7b2 100644
--- a/runtime-controlloop/src/test/resources/parameters/TestParameters.json
+++ b/runtime-controlloop/src/test/resources/parameters/TestParameters.json
@@ -4,14 +4,6 @@
"participantStateChangeIntervalSec": 1000,
"participantClUpdateIntervalSec": 1000,
"participantClStateChangeIntervalSec": 1000,
- "restServerParameters": {
- "host": "0.0.0.0",
- "port": 6969,
- "userName": "healthcheck",
- "password": "zb!XztG34",
- "https": false,
- "aaf": false
- },
"participantParameters": {
"heartBeatMs": 120000,
"updateParameters": {
@@ -27,10 +19,10 @@
"name": "PolicyProviderParameterGroup",
"implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
"databaseDriver": "org.h2.Driver",
- "databaseUrl": "jdbc:h2:mem:testdb",
+ "databaseUrl": "${dbName}",
"databaseUser": "policy",
"databasePassword": "P01icY",
- "persistenceUnit": "ToscaConceptTest"
+ "persistenceUnit": "InstantiationTests"
},
"topicParameterGroup": {
"topicSources": [
diff --git a/runtime-controlloop/src/test/resources/parameters/Unreadable.json b/runtime-controlloop/src/test/resources/parameters/Unreadable.json
deleted file mode 100644
index ddd04edc7..000000000
--- a/runtime-controlloop/src/test/resources/parameters/Unreadable.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "name": "ControlLoopRuntimeGroup",
- "supervisionScannerIntervalSec": 1000,
- "participantStateChangeIntervalSec": 1000,
- "participantClUpdateIntervalSec": 1000,
- "participantClStateChangeIntervalSec": 1000,
- "restServerParameters": {
- "host": "0.0.0.0",
- "port": 6969,
- "userName": "healthcheck",
- "password": "zb!XztG34",
- "https": false,
- "aaf": false
- },
- "participantParameters": {
- "heartBeatMs": 120000,
- "updateParameters": {
- "maxRetryCount": 1,
- "maxWaitMs": 30000
- },
- "stateChangeParameters": {
- "maxRetryCount": 1,
- "maxWaitMs": 30000
- }
- },
- "databaseProviderParameters": {
- "name": "PolicyProviderParameterGroup",
- "implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
- "databaseDriver": "org.h2.Driver",
- "databaseUrl": "jdbc:h2:mem:testdb",
- "databaseUser": "policy",
- "databasePassword": "P01icY",
- "persistenceUnit": "ToscaConceptTest"
- },
- "topicParameterGroup": {
- "topicSources": [
- {
- "topic": "POLICY-CLRUNTIME-PARTICIPANT",
- "servers": [
- "localhost"
- ],
- "topicCommInfrastructure": "dmaap",
- "fetchTimeout": 15000
- }
- ],
- "topicSinks": [
- {
- "topic": "POLICY-CLRUNTIME-PARTICIPANT",
- "servers": [
- "localhost"
- ],
- "topicCommInfrastructure": "dmaap"
- }
- ]
- }