aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop')
-rw-r--r--controlloop/common/controller-usecases/pom.xml3
-rw-r--r--controlloop/common/eventmanager/pom.xml5
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImpl.java9
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParams.java14
-rw-r--r--controlloop/common/eventmanager/src/main/resources/META-INF/persistence.xml13
-rw-r--r--controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ClEventManagerWithEventTest.java40
-rw-r--r--controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImplTest.java30
-rw-r--r--controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java8
-rw-r--r--controlloop/common/eventmanager/src/test/resources/META-INF/persistence.xml33
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties5
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties5
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-CL-topic.properties10
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-READ-topic.properties5
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-WRITE-topic.properties5
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_CL_RSP-topic.properties1
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_TOPIC-topic.properties5
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/POLICY-CL-MGT-topic.properties5
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-RSP-topic.properties5
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-topic.properties5
-rw-r--r--controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties3
-rw-r--r--controlloop/common/feature-controlloop-trans/src/main/feature/config/feature-controlloop-trans.properties2
-rw-r--r--controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java2
-rw-r--r--controlloop/common/feature-controlloop-usecases/src/main/feature/config/logback-include-usecases.xml8
-rw-r--r--controlloop/common/rules-test/src/test/resources/rulesTest.drl35
24 files changed, 134 insertions, 122 deletions
diff --git a/controlloop/common/controller-usecases/pom.xml b/controlloop/common/controller-usecases/pom.xml
index c3b53acf1..e5443eb60 100644
--- a/controlloop/common/controller-usecases/pom.xml
+++ b/controlloop/common/controller-usecases/pom.xml
@@ -4,7 +4,7 @@
ONAP
================================================================================
Copyright (C) 2020-2022 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2023 Nordix Foundation.
+ Modifications Copyright (C) 2023-2024 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -177,7 +177,6 @@
<groupId>org.onap.policy.drools-pdp</groupId>
<artifactId>policy-management</artifactId>
<version>${version.policy.drools-pdp}</version>
- <scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
diff --git a/controlloop/common/eventmanager/pom.xml b/controlloop/common/eventmanager/pom.xml
index 2e7b0a497..c67021c47 100644
--- a/controlloop/common/eventmanager/pom.xml
+++ b/controlloop/common/eventmanager/pom.xml
@@ -37,11 +37,6 @@
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core-jakarta</artifactId>
- </dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImpl.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImpl.java
index 16cf527d5..1f6dfdca3 100644
--- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImpl.java
+++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImpl.java
@@ -3,7 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -85,14 +85,14 @@ public class OperationHistoryDataManagerImpl implements OperationHistoryDataMana
/**
* Number of records that have been inserted into the DB by this data manager
- * instance, whether or not they were committed.
+ * instance, whether they were committed.
*/
@Getter
private long recordsInserted = 0;
/**
* Number of records that have been updated within the DB by this data manager
- * instance, whether or not they were committed.
+ * instance, whether they were committed.
*/
@Getter
private long recordsUpdated = 0;
@@ -317,7 +317,6 @@ public class OperationHistoryDataManagerImpl implements OperationHistoryDataMana
props.put("jakarta.persistence.jdbc.url", params.getUrl());
props.put("jakarta.persistence.jdbc.user", params.getUserName());
props.put("jakarta.persistence.jdbc.password", params.getPassword());
- props.put("hibernate.dialect", params.getDbHibernateDialect());
return props;
}
@@ -337,6 +336,8 @@ public class OperationHistoryDataManagerImpl implements OperationHistoryDataMana
// the following may be overridden by junit tests
protected EntityManagerFactory makeEntityManagerFactory(String opsHistPu, Properties props) {
+ logger.info("Starting persistence unit {}", opsHistPu);
+ logger.info("Properties {}", props);
return Persistence.createEntityManagerFactory(opsHistPu, props);
}
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParams.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParams.java
index 054f4b1c1..1ea83761c 100644
--- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParams.java
+++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParams.java
@@ -3,7 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,7 +42,6 @@ import org.onap.policy.common.parameters.annotations.NotNull;
public class OperationHistoryDataManagerParams {
public static final String DEFAULT_PU = "OperationsHistoryPU";
public static final String DEFAULT_DRIVER = "org.mariadb.jdbc.Driver";
- public static final String DEFAULT_TYPE = "MariaDB";
@NotBlank
private String url;
@@ -58,9 +57,6 @@ public class OperationHistoryDataManagerParams {
@Builder.Default
private String driver = DEFAULT_DRIVER;
- @Builder.Default
- private String dbType = DEFAULT_TYPE;
-
/**
* Maximum number of records that can be waiting to be inserted into the DB. When the
* limit is reached, the oldest records are discarded.
@@ -86,12 +82,4 @@ public class OperationHistoryDataManagerParams {
public ValidationResult validate(String resultName) {
return new BeanValidator().validateTop(resultName, this);
}
-
- /**
- * Return the Hibernate dialect for the database type.
- * @return the dialect
- */
- public Object getDbHibernateDialect() {
- return "org.hibernate.dialect." + dbType + "Dialect";
- }
}
diff --git a/controlloop/common/eventmanager/src/main/resources/META-INF/persistence.xml b/controlloop/common/eventmanager/src/main/resources/META-INF/persistence.xml
index e55fda222..9a3e03488 100644
--- a/controlloop/common/eventmanager/src/main/resources/META-INF/persistence.xml
+++ b/controlloop/common/eventmanager/src/main/resources/META-INF/persistence.xml
@@ -4,7 +4,7 @@
drools-applications
================================================================================
Copyright (C) 2018-2021 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2023 Nordix Foundation.
+ Modifications Copyright (C) 2023-2024 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,19 +19,16 @@
limitations under the License.
============LICENSE_END=========================================================
-->
-<persistence xmlns="https://jakarta.ee/xml/ns/persistence"
+<persistence version="3.1" xmlns="https://jakarta.ee/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd"
- version="3.0">
+ xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd">
<persistence-unit name="OperationsHistoryPU" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>org.onap.policy.guard.OperationsHistory</class>
-
<properties>
- <property name="jakarta.persistence.schema-generation.database.action" value="create" />
- <property name="hibernate.dialect" value="org.hibernate.dialect.MariaDBDialect" />
- <property name="hibernate.show_sql" value="false" />
+ <property name="jakarta.persistence.schema-generation.database.action" value="none"/>
+ <property name="hibernate.show_sql" value="false"/>
</properties>
</persistence-unit>
</persistence>
diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ClEventManagerWithEventTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ClEventManagerWithEventTest.java
index 3b16f465b..6b60ec84c 100644
--- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ClEventManagerWithEventTest.java
+++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ClEventManagerWithEventTest.java
@@ -3,7 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2021, 2023 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -55,12 +55,9 @@ import org.onap.policy.controlloop.ControlLoopTargetType;
import org.onap.policy.controlloop.VirtualControlLoopEvent;
import org.onap.policy.controlloop.VirtualControlLoopNotification;
import org.onap.policy.controlloop.actorserviceprovider.ActorService;
-import org.onap.policy.controlloop.actorserviceprovider.Operation;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
-import org.onap.policy.controlloop.actorserviceprovider.Operator;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
-import org.onap.policy.controlloop.actorserviceprovider.spi.Actor;
import org.onap.policy.controlloop.drl.legacy.ControlLoopParams;
import org.onap.policy.controlloop.eventmanager.ClEventManagerWithEvent.NewEventStatus;
import org.onap.policy.controlloop.ophistory.OperationHistoryDataManager;
@@ -82,27 +79,21 @@ class ClEventManagerWithEventTest {
private static final String TARGET_PROP = "my-target-property";
private static final String MY_TARGET = "my-target";
private static final String EVENT_MGR_MULTI_YAML =
- "../eventmanager/src/test/resources/eventManager/event-mgr-multi.yaml";
+ "../eventmanager/src/test/resources/eventManager/event-mgr-multi.yaml";
private static final String EVENT_MGR_SIMPLE_YAML =
- "../eventmanager/src/test/resources/eventManager/event-mgr-simple.yaml";
+ "../eventmanager/src/test/resources/eventManager/event-mgr-simple.yaml";
private static final Coder yamlCoder = new StandardYamlCoder();
private static final String OUTCOME_MSG = "my outcome message";
private final PolicyEngine engineMgr = mock(PolicyEngine.class);
private final WorkingMemory workMem = mock(WorkingMemory.class);
private final InternalFactHandle factHandle = mock(InternalFactHandle.class);
- private final Operator policyOperator = mock(Operator.class);
- private final Operation policyOperation = mock(Operation.class);
- private final Actor policyActor = mock(Actor.class);
private final EventManagerServices services = mock(EventManagerServices.class);
private final ActorService actors = mock(ActorService.class);
private final OperationHistoryDataManager dataMgr = mock(OperationHistoryDataManager.class);
private final ExecutorService executor = mock(ExecutorService.class);
- private final MyStep stepa = mock(MyStep.class);
- private final MyStep stepb = mock(MyStep.class);
private List<LockImpl> locks;
- private ToscaPolicy tosca;
private ControlLoopParams params;
private VirtualControlLoopEvent event;
private ClEventManagerWithEvent<MyStep> mgr;
@@ -149,7 +140,7 @@ class ClEventManagerWithEventTest {
// invalid
event.setTarget("");
assertThatThrownBy(() -> new MyManager(services, params, event, workMem))
- .isInstanceOf(ControlLoopException.class);
+ .isInstanceOf(ControlLoopException.class);
}
@Test
@@ -209,7 +200,7 @@ class ClEventManagerWithEventTest {
// null case
assertThatThrownBy(() -> mgr.loadNextPolicy(null)).isInstanceOf(NullPointerException.class)
- .hasMessageContaining("lastResult");
+ .hasMessageContaining("lastResult");
}
@Test
@@ -218,10 +209,12 @@ class ClEventManagerWithEventTest {
OperationOutcome outcome = makeOutcome();
mgr.addToHistory(outcome);
- mgr.storeInDataBase(mgr.getPartialHistory().peekLast(), MY_TARGET);
+ var peeked = mgr.getPartialHistory().peekLast();
+ assertNotNull(peeked);
+ mgr.storeInDataBase(peeked, MY_TARGET);
verify(dataMgr).store(REQ_ID.toString(), event.getClosedLoopControlName(), event, MY_TARGET,
- mgr.getPartialHistory().peekLast().getClOperation());
+ peeked.getClOperation());
}
@Test
@@ -265,7 +258,7 @@ class ClEventManagerWithEventTest {
event.setTarget(null);
assertThatCode(() -> mgr.checkEventSyntax(event)).isInstanceOf(ControlLoopException.class)
- .hasMessage("No target field");
+ .hasMessage("No target field");
// abated supersedes previous errors - so it shouldn't throw an exception
event.setClosedLoopEventStatus(ControlLoopEventStatus.ABATED);
@@ -273,11 +266,11 @@ class ClEventManagerWithEventTest {
event.setRequestId(null);
assertThatCode(() -> mgr.checkEventSyntax(event)).isInstanceOf(ControlLoopException.class)
- .hasMessage("No request ID");
+ .hasMessage("No request ID");
event.setClosedLoopControlName(null);
assertThatCode(() -> mgr.checkEventSyntax(event)).isInstanceOf(ControlLoopException.class)
- .hasMessage("No control loop name");
+ .hasMessage("No control loop name");
}
@Test
@@ -290,13 +283,12 @@ class ClEventManagerWithEventTest {
event.setClosedLoopEventStatus(null);
assertThatCode(() -> mgr.checkEventSyntax(event)).isInstanceOf(ControlLoopException.class)
- .hasMessage("Invalid value in closedLoopEventStatus");
+ .hasMessage("Invalid value in closedLoopEventStatus");
}
private void loadPolicy(String fileName) throws CoderException {
- var template =
- yamlCoder.decode(ResourceUtils.getResourceAsString(fileName), ToscaServiceTemplate.class);
- tosca = template.getToscaTopologyTemplate().getPolicies().get(0).values().iterator().next();
+ var template = yamlCoder.decode(ResourceUtils.getResourceAsString(fileName), ToscaServiceTemplate.class);
+ ToscaPolicy tosca = template.getToscaTopologyTemplate().getPolicies().get(0).values().iterator().next();
params.setToscaPolicy(tosca);
}
@@ -325,7 +317,7 @@ class ClEventManagerWithEventTest {
private static final long serialVersionUID = 1L;
public MyManager(EventManagerServices services, ControlLoopParams params, VirtualControlLoopEvent event,
- WorkingMemory workMem) throws ControlLoopException {
+ WorkingMemory workMem) throws ControlLoopException {
super(services, params, event, workMem);
}
diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImplTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImplTest.java
index 22cfa643d..397c1c5fe 100644
--- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImplTest.java
+++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerImplTest.java
@@ -3,7 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -151,8 +151,8 @@ class OperationHistoryDataManagerImplTest {
// invalid properties
params.setUrl(null);
- assertThatCode(() -> new PseudoThread()).isInstanceOf(IllegalArgumentException.class)
- .hasMessageContaining("data-manager-properties");
+ assertThatCode(PseudoThread::new).isInstanceOf(IllegalArgumentException.class)
+ .hasMessageContaining("data-manager-properties");
}
@Test
@@ -192,7 +192,7 @@ class OperationHistoryDataManagerImplTest {
* Tests store() when it is already stopped.
*/
@Test
- void testStoreAlreadyStopped() throws InterruptedException {
+ void testStoreAlreadyStopped() {
mgr.stop();
// store
@@ -202,7 +202,7 @@ class OperationHistoryDataManagerImplTest {
}
/**
- * Tests store() when when the queue is full.
+ * Tests store() when the queue is full.
*/
@Test
void testStoreTooManyItems() throws InterruptedException {
@@ -217,7 +217,7 @@ class OperationHistoryDataManagerImplTest {
}
@Test
- void testRun() throws InterruptedException {
+ void testRun() {
// trigger thread shutdown when it completes this batch
when(emfSpy.createEntityManager()).thenAnswer(ans -> {
@@ -248,7 +248,7 @@ class OperationHistoryDataManagerImplTest {
* Tests run() when the entity manager throws an exception.
*/
@Test
- void testRunException() throws InterruptedException {
+ void testRunException() {
var count = new AtomicInteger(0);
when(emfSpy.createEntityManager()).thenAnswer(ans -> {
@@ -385,16 +385,14 @@ class OperationHistoryDataManagerImplTest {
}
private static OperationHistoryDataManagerParamsBuilder makeBuilder() {
- // @formatter:off
return OperationHistoryDataManagerParams.builder()
- .url("jdbc:h2:mem:" + OperationHistoryDataManagerImplTest.class.getSimpleName())
- .dbType("H2")
- .driver("org.h2.Driver")
- .userName("sa")
- .password("")
- .batchSize(BATCH_SIZE)
- .maxQueueLength(MAX_QUEUE_LENGTH);
- // @formatter:on
+ .url("jdbc:h2:mem:" + OperationHistoryDataManagerImplTest.class.getSimpleName())
+ .driver("org.h2.Driver")
+ .userName("sa")
+ .password("")
+ .persistenceUnit("OperationsHistoryTest")
+ .batchSize(BATCH_SIZE)
+ .maxQueueLength(MAX_QUEUE_LENGTH);
}
/**
diff --git a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java
index f0159aaff..623df93d0 100644
--- a/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java
+++ b/controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/ophistory/OperationHistoryDataManagerParamsTest.java
@@ -3,7 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,7 +38,6 @@ class OperationHistoryDataManagerParamsTest {
private static final String MY_PASS = "my-pass";
private static final String MY_PU = "my-pu";
private static final String MY_DRIVER = "my-driver";
- private static final String MY_DB_TYPE = "my-db-type";
private static final String MY_URL = "my-url";
private static final String MY_USER = "my-user";
@@ -56,7 +55,6 @@ class OperationHistoryDataManagerParamsTest {
assertEquals(MY_PASS, params.getPassword());
assertEquals(OperationHistoryDataManagerParams.DEFAULT_PU, params.getPersistenceUnit());
assertEquals(OperationHistoryDataManagerParams.DEFAULT_DRIVER, params.getDriver());
- assertEquals(OperationHistoryDataManagerParams.DEFAULT_TYPE, params.getDbType());
assertEquals(MY_URL, params.getUrl());
assertEquals(MY_USER, params.getUserName());
@@ -65,9 +63,6 @@ class OperationHistoryDataManagerParamsTest {
// use specified driver
assertEquals(MY_DRIVER, makeBuilder().driver(MY_DRIVER).build().getDriver());
-
- // use specified DB type
- assertEquals(MY_DB_TYPE, makeBuilder().dbType(MY_DB_TYPE).build().getDbType());
}
@Test
@@ -79,7 +74,6 @@ class OperationHistoryDataManagerParamsTest {
testValidateField("password", "null", params2 -> params2.setPassword(null));
testValidateField("persistenceUnit", "null", params2 -> params2.setPersistenceUnit(null));
testValidateField("driver", "null", params2 -> params2.setDriver(null));
- testValidateField("dbType", "null", params2 -> params2.setDbType(null));
// check edge cases
params.setBatchSize(0);
diff --git a/controlloop/common/eventmanager/src/test/resources/META-INF/persistence.xml b/controlloop/common/eventmanager/src/test/resources/META-INF/persistence.xml
new file mode 100644
index 000000000..f053f4fcb
--- /dev/null
+++ b/controlloop/common/eventmanager/src/test/resources/META-INF/persistence.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ============LICENSE_START=======================================================
+ drools-applications
+ ================================================================================
+ Copyright (C) 2024 Nordix Foundation.
+ ================================================================================
+ 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.
+ ============LICENSE_END=========================================================
+ -->
+<persistence version="3.1" xmlns="https://jakarta.ee/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd">
+
+ <persistence-unit name="OperationsHistoryTest" transaction-type="RESOURCE_LOCAL">
+ <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
+ <class>org.onap.policy.guard.OperationsHistory</class>
+ <properties>
+ <property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create"/>
+ <property name="hibernate.show_sql" value="false"/>
+ </properties>
+ </persistence-unit>
+</persistence>
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties
index 2efeaba17..c089e3645 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties
@@ -18,6 +18,7 @@
# ============LICENSE_END=========================================================
kafka.source.topics=a1-p-rsp
-kafka.source.topics.a1-p-rsp.servers=${envd:KAFKA_SERVERS}
-kafka.source.topics.a1-p-rsp.https=${envd:KAFKA_HTTPS:false}
+kafka.source.topics.a1-p-rsp.servers=${env:KAFKA_SERVERS}
+kafka.source.topics.a1-p-rsp.https=${env:KAFKA_HTTPS:false}
+kafka.source.topics.a1-p-rsp.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties
index a5c0ae9b1..360db50bc 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties
@@ -18,6 +18,7 @@
# ============LICENSE_END=========================================================
kafka.sink.topics=a1-p
-kafka.sink.topics.a1-p.servers=${envd:KAFKA_SERVERS}
-kafka.sink.topics.a1-p.https=${envd:KAFKA_HTTPS:false}
+kafka.sink.topics.a1-p.servers=${env:KAFKA_SERVERS}
+kafka.sink.topics.a1-p.https=${env:KAFKA_HTTPS:false}
+kafka.sink.topics.a1-p.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-CL-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-CL-topic.properties
index 5970ebc75..b8401e145 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-CL-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-CL-topic.properties
@@ -18,9 +18,11 @@
# ============LICENSE_END=========================================================
kafka.source.topics=appc-cl
-kafka.source.topics.appc-cl.servers=${envd:KAFKA_SERVERS}
-kafka.source.topics.appc-cl.https=${envd:KAFKA_HTTPS:false}
+kafka.source.topics.appc-cl.servers=${env:KAFKA_SERVERS}
+kafka.source.topics.appc-cl.https=${env:KAFKA_HTTPS:false}
+kafka.source.topics.appc-cl.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
kafka.sink.topics=appc-cl
-kafka.sink.topics.appc-cl.servers=${envd:KAFKA_SERVERS}
-kafka.sink.topics.appc-cl.https=${envd:KAFKA_HTTPS:false}
+kafka.sink.topics.appc-cl.servers=${env:KAFKA_SERVERS}
+kafka.sink.topics.appc-cl.https=${env:KAFKA_HTTPS:false}
+kafka.sink.topics.appc-cl.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-READ-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-READ-topic.properties
index 40efa7ee9..448d16aa2 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-READ-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-READ-topic.properties
@@ -18,5 +18,6 @@
# ============LICENSE_END=========================================================
kafka.sink.topics=appc-lcm-read
-kafka.sink.topics.appc-lcm-read.servers=${envd:KAFKA_SERVERS}
-kafka.sink.topics.appc-lcm-read.https=${envd:KAFKA_HTTPS:false}
+kafka.sink.topics.appc-lcm-read.servers=${env:KAFKA_SERVERS}
+kafka.sink.topics.appc-lcm-read.https=${env:KAFKA_HTTPS:false}
+kafka.sink.topics.appc-lcm-read.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-WRITE-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-WRITE-topic.properties
index a0a3065ee..4c75043f0 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-WRITE-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/APPC-LCM-WRITE-topic.properties
@@ -18,5 +18,6 @@
# ============LICENSE_END=========================================================
kafka.source.topics=appc-lcm-write
-kafka.source.topics.appc-lcm-write.servers=${envd:KAFKA_SERVERS}
-kafka.source.topics.appc-lcm-write.https=${envd:KAFKA_HTTPS:false}
+kafka.source.topics.appc-lcm-write.servers=${env:KAFKA_SERVERS}
+kafka.source.topics.appc-lcm-write.https=${env:KAFKA_HTTPS:false}
+kafka.source.topics.appc-lcm-write.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_CL_RSP-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_CL_RSP-topic.properties
index e3572c9c0..9f5a400eb 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_CL_RSP-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_CL_RSP-topic.properties
@@ -20,3 +20,4 @@
kafka.sink.topics=dcae_cl_rsp
kafka.sink.topics.dcae_cl_rsp.servers=${env:KAFKA_SERVERS}
kafka.sink.topics.dcae_cl_rsp.https=${envd:KAFKA_HTTPS:false}
+kafka.sink.topics.dcae_cl_rsp.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_TOPIC-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_TOPIC-topic.properties
index 6b2da4896..c7b433cc1 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_TOPIC-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/DCAE_TOPIC-topic.properties
@@ -19,6 +19,7 @@
kafka.source.topics=dcae_topic
kafka.source.topics.dcae_topic.effectiveTopic=${envd:DCAE_TOPIC}
-kafka.source.topics.dcae_topic.servers=${envd:KAFKA_SERVERS}
+kafka.source.topics.dcae_topic.servers=${env:KAFKA_SERVERS}
kafka.source.topics.dcae_topic.consumerGroup=${envd:DCAE_CONSUMER_GROUP}
-kafka.source.topics.dcae_topic.https=${envd:KAFKA_HTTPS:false}
+kafka.source.topics.dcae_topic.https=${env:KAFKA_HTTPS:false}
+kafka.source.topics.dcae_topic.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/POLICY-CL-MGT-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/POLICY-CL-MGT-topic.properties
index 7a6a4fb83..477a9da38 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/POLICY-CL-MGT-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/POLICY-CL-MGT-topic.properties
@@ -18,5 +18,6 @@
# ============LICENSE_END=========================================================
kafka.sink.topics=policy-cl-mgt
-kafka.sink.topics.policy-cl-mgt.servers=${envd:KAFKA_SERVERS}
-kafka.sink.topics.policy-cl-mgt.https=${envd:KAFKA_HTTPS:false}
+kafka.sink.topics.policy-cl-mgt.servers=${env:KAFKA_SERVERS}
+kafka.sink.topics.policy-cl-mgt.https=${env:KAFKA_HTTPS:false}
+kafka.sink.topics.policy-cl-mgt.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-RSP-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-RSP-topic.properties
index 001b9c0e2..abba1bf09 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-RSP-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-RSP-topic.properties
@@ -18,5 +18,6 @@
# ============LICENSE_END=========================================================
kafka.source.topics=sdnr-cl-rsp
-kafka.source.topics.sdnr-cl-rsp.servers=${envd:KAFKA_SERVERS}
-kafka.source.topics.sdnr-cl-rsp.https=${envd:KAFKA_HTTPS:false}
+kafka.source.topics.sdnr-cl-rsp.servers=${env:KAFKA_SERVERS}
+kafka.source.topics.sdnr-cl-rsp.https=${env:KAFKA_HTTPS:false}
+kafka.source.topics.sdnr-cl-rsp.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-topic.properties
index 3a58f8f42..f78fe76b7 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-topic.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/SDNR-CL-topic.properties
@@ -18,5 +18,6 @@
# ============LICENSE_END=========================================================
kafka.sink.topics=sdnr-cl
-kafka.sink.topics.sdnr-cl.servers=${envd:KAFKA_SERVERS}
-kafka.sink.topics.sdnr-cl.https=${envd:KAFKA_HTTPS:false}
+kafka.sink.topics.sdnr-cl.servers=${env:KAFKA_SERVERS}
+kafka.sink.topics.sdnr-cl.https=${env:KAFKA_HTTPS:false}
+kafka.sink.topics.sdnr-cl.additionalProps=${env:KAFKA_ADDITIONAL_PROPS}
diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties
index 7124989b5..96d2f9aea 100644
--- a/controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties
+++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties
@@ -24,12 +24,13 @@
operation.history.url=${envd:JDBC_URL}operationshistory${envd:JDBC_OPTS}
operation.history.userName=${envd:SQL_USER}
operation.history.password=${envd:SQL_PASSWORD}
+operation.history.driver=${envd:JDBC_DRIVER}
#
# Actor parameters
#
# Note: every operation must have at least one entry, otherwise it will not be
-# configured and started. Thus some of them have a "placeholder" property.
+# configured and started. Thus, some of them have a "placeholder" property.
#
actor.service.XACML.disabled=${envd:GUARD_DISABLED:false}
diff --git a/controlloop/common/feature-controlloop-trans/src/main/feature/config/feature-controlloop-trans.properties b/controlloop/common/feature-controlloop-trans/src/main/feature/config/feature-controlloop-trans.properties
index 7744defa4..f65baf248 100644
--- a/controlloop/common/feature-controlloop-trans/src/main/feature/config/feature-controlloop-trans.properties
+++ b/controlloop/common/feature-controlloop-trans/src/main/feature/config/feature-controlloop-trans.properties
@@ -18,4 +18,4 @@
# ============LICENSE_END=========================================================
###
controlloop.cache.transactions.size=100
-controllop.cache.transactions.timeout.seconds=1800
+controlloop.cache.transactions.timeout.seconds=1800
diff --git a/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java b/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java
index 1ada2714c..ac73f93dc 100644
--- a/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java
+++ b/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java
@@ -30,7 +30,6 @@ import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.core.Response;
import java.util.Collections;
import java.util.List;
-import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -150,7 +149,6 @@ class RestTransactionTrackerTest {
assertNotNull(HttpClient.getBody(response, clazz));
}
- @NotNull
private Response checkResponse(int statusCode, Response response) {
assertEquals(statusCode, response.getStatus());
return response;
diff --git a/controlloop/common/feature-controlloop-usecases/src/main/feature/config/logback-include-usecases.xml b/controlloop/common/feature-controlloop-usecases/src/main/feature/config/logback-include-usecases.xml
index 655ccd7ca..753d2e01c 100644
--- a/controlloop/common/feature-controlloop-usecases/src/main/feature/config/logback-include-usecases.xml
+++ b/controlloop/common/feature-controlloop-usecases/src/main/feature/config/logback-include-usecases.xml
@@ -3,6 +3,7 @@
feature-controlloop-usecases
================================================================================
Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ Modifications Copyright (C) 2024 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -49,8 +50,15 @@
<appender-ref ref="UsecasesOut" />
</appender>
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>${networkPattern}</pattern>
+ </encoder>
+ </appender>
+
<logger name="usecases" level="INFO" additivity="false">
<appender-ref ref="AsyncUsecasesOut" />
+ <appender-ref ref="STDOUT" />
</logger>
</included>
diff --git a/controlloop/common/rules-test/src/test/resources/rulesTest.drl b/controlloop/common/rules-test/src/test/resources/rulesTest.drl
index a1a89714a..31c4f66e7 100644
--- a/controlloop/common/rules-test/src/test/resources/rulesTest.drl
+++ b/controlloop/common/rules-test/src/test/resources/rulesTest.drl
@@ -40,7 +40,7 @@ import org.onap.policy.drools.system.PolicyEngineConstants;
rule "STARTED"
when
then
- System.out.println(drools.getRule().getName());
+ System.out.println(drools.getRule().getName());
end
/*
@@ -52,10 +52,9 @@ rule "INSERT.PARAMS"
when
$params : ControlLoopParams()
then
-
- Logger logger = LoggerFactory.getLogger(drools.getRule().getPackageName());
- logger.info("{}: {} : TOSCA-POLICY=[{}]", $params.getClosedLoopControlName(), $params.getPolicyName() + "."
- + drools.getRule().getName(), $params.getToscaPolicy());
+ Logger logger = LoggerFactory.getLogger(drools.getRule().getPackageName());
+ logger.info("{}: {} : TOSCA-POLICY=[{}]", $params.getClosedLoopControlName(), $params.getPolicyName() + "."
+ + drools.getRule().getName(), $params.getToscaPolicy());
end
/*
@@ -67,16 +66,15 @@ rule "NEW.TOSCA.POLICY"
when
$policy : ToscaPolicy()
then
+ Logger logger = LoggerFactory.getLogger(drools.getRule().getPackageName());
+ logger.info("{}: [{}|{}|{}|{}]: CONTENT: {}", drools.getRule().getName(),
+ $policy.getType(), $policy.getTypeVersion(), $policy.getName(),
+ $policy.getVersion(), $policy);
- Logger logger = LoggerFactory.getLogger(drools.getRule().getPackageName());
- logger.info("{}: [{}|{}|{}|{}]: CONTENT: {}", drools.getRule().getName(),
- $policy.getType(), $policy.getTypeVersion(), $policy.getName(),
- $policy.getVersion(), $policy);
-
- ControlLoopParams params = ControlLoopUtils.toControlLoopParams($policy);
- if (params != null) {
- insert(params);
- }
+ ControlLoopParams params = ControlLoopUtils.toControlLoopParams($policy);
+ if (params != null) {
+ insert(params);
+ }
end
/*
@@ -87,10 +85,9 @@ rule "REMOVE.PARAMS"
$params : ControlLoopParams( $policyName : getPolicyName(), $policyVersion : getPolicyVersion() )
not ( ToscaPolicy( getName() == $policyName, getVersion() == $policyVersion ) )
then
+ Logger logger = LoggerFactory.getLogger(drools.getRule().getPackageName());
+ logger.info("{}: [{}|{}|{}]", drools.getRule().getName(),
+ $params.getPolicyScope(), $params.getPolicyName(), $params.getPolicyVersion());
- Logger logger = LoggerFactory.getLogger(drools.getRule().getPackageName());
- logger.info("{}: [{}|{}|{}]", drools.getRule().getName(),
- $params.getPolicyScope(), $params.getPolicyName(), $params.getPolicyVersion());
-
- retract($params);
+ retract($params);
end