summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--feature-distributed-locking/pom.xml6
-rw-r--r--feature-pooling-messages/src/main/feature/config/feature-pooling-messages.properties14
-rw-r--r--packages/base/src/files/bin/configure-maven9
-rw-r--r--policy-core/pom.xml3
-rw-r--r--policy-domains/src/test/java/org/onap/policy/drools/domain/models/controller/ControllerTopicTest.java45
-rw-r--r--policy-management/pom.xml8
-rw-r--r--policy-management/src/main/server/config/logback.xml8
-rw-r--r--policy-utils/pom.xml2
-rw-r--r--policy-utils/src/test/java/org/onap/policy/drools/policies/DomainMakerTest.java11
-rw-r--r--pom.xml9
10 files changed, 87 insertions, 28 deletions
diff --git a/feature-distributed-locking/pom.xml b/feature-distributed-locking/pom.xml
index 04f06784..24d3e048 100644
--- a/feature-distributed-locking/pom.xml
+++ b/feature-distributed-locking/pom.xml
@@ -3,7 +3,7 @@
ONAP Policy Engine - Drools PDP
================================================================================
Copyright (C) 2018-2022 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2020,2023 Nordix Foundation.
+ Modifications Copyright (C) 2020, 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.
@@ -100,12 +100,12 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
- <version>2.9.0</version>
+ <version>2.12.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
- <version>2.11.1</version>
+ <version>2.12.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
diff --git a/feature-pooling-messages/src/main/feature/config/feature-pooling-messages.properties b/feature-pooling-messages/src/main/feature/config/feature-pooling-messages.properties
index 8497538e..3870ede1 100644
--- a/feature-pooling-messages/src/main/feature/config/feature-pooling-messages.properties
+++ b/feature-pooling-messages/src/main/feature/config/feature-pooling-messages.properties
@@ -72,18 +72,18 @@
# be enabled at the same time.
pooling.usecases.enabled=true
-pooling.usecases.topic=${envd:POOLING_TOPIC}
+pooling.usecases.topic=${env:POOLING_TOPIC}
# the list of sources and sinks should be identical
-kafka.source.topics=${envd:POOLING_TOPIC}
-kafka.sink.topics=${envd:POOLING_TOPIC}
+kafka.source.topics=${env:POOLING_TOPIC}
+kafka.sink.topics=${env:POOLING_TOPIC}
-kafka.source.topics.policy-pdp-pooling.servers=${envd:KAFKA_SERVERS}
-kafka.source.topics.policy-pdp-pooling.effectiveTopic=${envd:POOLING_TOPIC}
+kafka.source.topics.policy-pdp-pooling.servers=${env:KAFKA_SERVERS}
+kafka.source.topics.policy-pdp-pooling.effectiveTopic=${env:POOLING_TOPIC}
kafka.source.topics.policy-pdp-pooling.apiKey=
kafka.source.topics.policy-pdp-pooling.apiSecret=
-kafka.sink.topics.policy-pdp-pooling.servers=${envd:KAFKA_SERVERS}
-kafka.sink.topics.policy-pdp-pooling.effectiveTopic=${envd:POOLING_TOPIC}
+kafka.sink.topics.policy-pdp-pooling.servers=${env:KAFKA_SERVERS}
+kafka.sink.topics.policy-pdp-pooling.effectiveTopic=${env:POOLING_TOPIC}
kafka.sink.topics.policy-pdp-pooling.apiKey=
kafka.sink.topics.policy-pdp-pooling.apiSecret=
diff --git a/packages/base/src/files/bin/configure-maven b/packages/base/src/files/bin/configure-maven
index 70c3d0cc..c62da818 100644
--- a/packages/base/src/files/bin/configure-maven
+++ b/packages/base/src/files/bin/configure-maven
@@ -4,6 +4,7 @@
# ONAP
# ================================================================================
# Copyright (C) 2019-2021 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.
@@ -24,11 +25,11 @@ if [ "${DEBUG}" = "y" ]; then
set -x
fi
-HOME_M2="${HOME}"/.m2
-mkdir -p "${HOME_M2}" 2> /dev/null
+export M2_HOME="${HOME}"/.m2
+mkdir -p "${M2_HOME}" 2> /dev/null
if [ -z "${SNAPSHOT_REPOSITORY_URL}" ] && [ -z "${RELEASE_REPOSITORY_URL}" ]; then
- ln -s -f "${POLICY_HOME}"/etc/m2/standalone-settings.xml "${HOME_M2}"/settings.xml
+ ln -s -f "${POLICY_HOME}"/etc/m2/standalone-settings.xml "${M2_HOME}"/settings.xml
else
- ln -s -f "${POLICY_HOME}"/etc/m2/settings.xml "${HOME_M2}"/settings.xml
+ ln -s -f "${POLICY_HOME}"/etc/m2/settings.xml "${M2_HOME}"/settings.xml
fi
diff --git a/policy-core/pom.xml b/policy-core/pom.xml
index 6f1052e9..57fd613c 100644
--- a/policy-core/pom.xml
+++ b/policy-core/pom.xml
@@ -105,7 +105,6 @@
<scope>provided</scope>
</dependency>
- <!-- Provided dependencies -->
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
@@ -132,7 +131,7 @@
</dependency>
<dependency>
<groupId>org.glassfish.hk2.external</groupId>
- <artifactId>javax.inject</artifactId>
+ <artifactId>jakarta.inject</artifactId>
</dependency>
</dependencies>
diff --git a/policy-domains/src/test/java/org/onap/policy/drools/domain/models/controller/ControllerTopicTest.java b/policy-domains/src/test/java/org/onap/policy/drools/domain/models/controller/ControllerTopicTest.java
new file mode 100644
index 00000000..aae1aec4
--- /dev/null
+++ b/policy-domains/src/test/java/org/onap/policy/drools/domain/models/controller/ControllerTopicTest.java
@@ -0,0 +1,45 @@
+/*
+ * ============LICENSE_START=======================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.drools.domain.models.controller;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+class ControllerTopicTest {
+
+ @Test
+ void testSinkTopic() {
+ var topic = new ControllerSinkTopic(ControllerSinkTopic.builder()
+ .topicName("SINK_TOPIC_NAME"));
+ Assertions.assertEquals("sink_topic_name", topic.getTopicName());
+ topic.setTopicName("NEW_TOPIC_NAME");
+ Assertions.assertEquals("new_topic_name", topic.getTopicName());
+ }
+
+ @Test
+ void testSourceTopic() {
+ var topic = new ControllerSourceTopic(ControllerSourceTopic.builder()
+ .topicName("SOURCE_TOPIC_NAME"));
+ Assertions.assertEquals("source_topic_name", topic.getTopicName());
+ topic.setTopicName("NEW_TOPIC_NAME");
+ Assertions.assertEquals("new_topic_name", topic.getTopicName());
+ }
+}
diff --git a/policy-management/pom.xml b/policy-management/pom.xml
index ed776b58..c2a3b376 100644
--- a/policy-management/pom.xml
+++ b/policy-management/pom.xml
@@ -299,12 +299,12 @@
<artifactId>mariadb-java-client</artifactId>
</dependency>
<dependency>
- <groupId>org.hibernate.orm</groupId>
- <artifactId>hibernate-core</artifactId>
+ <groupId>org.postgresql</groupId>
+ <artifactId>postgresql</artifactId>
</dependency>
<dependency>
- <groupId>org.hibernate.common</groupId>
- <artifactId>hibernate-commons-annotations</artifactId>
+ <groupId>org.hibernate.orm</groupId>
+ <artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
diff --git a/policy-management/src/main/server/config/logback.xml b/policy-management/src/main/server/config/logback.xml
index 1bd7770b..4e6756d9 100644
--- a/policy-management/src/main/server/config/logback.xml
+++ b/policy-management/src/main/server/config/logback.xml
@@ -3,6 +3,7 @@
policy-management
================================================================================
Copyright (C) 2017-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.
@@ -137,11 +138,18 @@
<appender-ref ref="AsyncNetworkOut" />
</logger>
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>${debugPattern}</pattern>
+ </encoder>
+ </appender>
+
<root level="INFO">
<appender-ref ref="AsyncDebugOut" />
<appender-ref ref="AsyncErrorOut" />
<appender-ref ref="AsyncMetricOut" />
<appender-ref ref="AsyncTransactionOut" />
+ <appender-ref ref="STDOUT" />
</root>
</configuration>
diff --git a/policy-utils/pom.xml b/policy-utils/pom.xml
index 14832417..319711a1 100644
--- a/policy-utils/pom.xml
+++ b/policy-utils/pom.xml
@@ -45,7 +45,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
- <version>2.8.0</version>
+ <version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
diff --git a/policy-utils/src/test/java/org/onap/policy/drools/policies/DomainMakerTest.java b/policy-utils/src/test/java/org/onap/policy/drools/policies/DomainMakerTest.java
index ee32cb2b..f8ffa503 100644
--- a/policy-utils/src/test/java/org/onap/policy/drools/policies/DomainMakerTest.java
+++ b/policy-utils/src/test/java/org/onap/policy/drools/policies/DomainMakerTest.java
@@ -71,6 +71,9 @@ class DomainMakerTest {
policy.setType("policy.type.Z");
assertFalse(domainMaker.isConformant(policy));
+
+ assertThatThrownBy(() -> domainMaker.isConformant(null))
+ .hasMessageContaining("policy is marked non-null but is null");
}
@Test
@@ -108,6 +111,12 @@ class DomainMakerTest {
domainAPolicy.getProperties().getNested().setNested1("");
ToscaConceptIdentifier ident1 = policy1.getTypeIdentifier();
assertFalse(domainMaker.conformance(ident1, domainAPolicy));
+
+ var policy2 = getToscaPolicy("src/test/resources/policyA.json");
+ policy2.setType("not.registered.type");
+ policy2.setTypeVersion("4.2.5");
+ assertFalse(domainMaker.conformance(policy2));
+ assertFalse(domainMaker.conformance(policy2.getTypeIdentifier(), domainAPolicy));
}
@Test
@@ -125,6 +134,8 @@ class DomainMakerTest {
policy.setTypeVersion("1.0.0");
assertFalse(domainMaker.isConformant(policy));
+
+ assertFalse(domainMaker.registerValidator(policy.getTypeIdentifier(), "$schema"));
}
@Test
diff --git a/pom.xml b/pom.xml
index e80ff124..bc188553 100644
--- a/pom.xml
+++ b/pom.xml
@@ -126,8 +126,8 @@
</dependency>
<dependency>
<groupId>org.glassfish.hk2.external</groupId>
- <artifactId>javax.inject</artifactId>
- <version>2.5.0-b62</version>
+ <artifactId>jakarta.inject</artifactId>
+ <version>2.6.1</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
@@ -135,11 +135,6 @@
<version>${version.json-path}</version>
</dependency>
<dependency>
- <groupId>org.hibernate.common</groupId>
- <artifactId>hibernate-commons-annotations</artifactId>
- <version>${hibernate.commons.annotations.version}</version>
- </dependency>
- <dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>${xml.apis.version}</version>