From e8e477ab80c6762fb05aebfe9becc630d2d51e39 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Mon, 14 Sep 2020 09:42:02 -0400 Subject: Release locks between junit tests Tdjam junits were randomly failing. Traced it down to the fact that the locks were being released asynchronously and thus were not always released when the next test cases requested them. Also simplified logging for tdjam junit tests. Fixed the property file so it isn't overwritten by the junit tests. Changes per review comments: - changed "Pattern" to "pattern" in logback xml Issue-ID: POLICY-2789 Change-Id: I325ec69cf7affa531d3c575e3a34bc0b0e1edac7 Signed-off-by: Jim Hahn --- .../src/test/java/org/onap/policy/controlloop/TdjamTest.java | 6 ++---- .../src/test/resources/config/tdjam-controller.properties | 2 +- .../common/controller-tdjam/src/test/resources/logback-test.xml | 6 +++--- 3 files changed, 6 insertions(+), 8 deletions(-) (limited to 'controlloop/common/controller-tdjam/src/test') diff --git a/controlloop/common/controller-tdjam/src/test/java/org/onap/policy/controlloop/TdjamTest.java b/controlloop/common/controller-tdjam/src/test/java/org/onap/policy/controlloop/TdjamTest.java index 8e286c44e..917e9adbd 100644 --- a/controlloop/common/controller-tdjam/src/test/java/org/onap/policy/controlloop/TdjamTest.java +++ b/controlloop/common/controller-tdjam/src/test/java/org/onap/policy/controlloop/TdjamTest.java @@ -26,7 +26,6 @@ import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.runner.RunWith; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.controlloop.common.rules.test.BaseTest; @@ -54,7 +53,6 @@ import org.onap.policy.simulators.Util; @RunWith(NamedRunner.class) @TestNames(prefixes = {"test"}) -@Ignore public class TdjamTest extends BaseTest { protected static final String CONTROLLER_NAME = "tdjam"; protected static PolicyController controller; @@ -95,7 +93,7 @@ public class TdjamTest extends BaseTest { */ @Before public void setUp() { - topics = topicMaker.get(); + init(); } /** @@ -103,7 +101,7 @@ public class TdjamTest extends BaseTest { */ @After public void tearDown() { - topics.destroy(); + finish(); } protected static PolicyEngine makeEngine() { diff --git a/controlloop/common/controller-tdjam/src/test/resources/config/tdjam-controller.properties b/controlloop/common/controller-tdjam/src/test/resources/config/tdjam-controller.properties index 41db06c51..135fa05cd 100644 --- a/controlloop/common/controller-tdjam/src/test/resources/config/tdjam-controller.properties +++ b/controlloop/common/controller-tdjam/src/test/resources/config/tdjam-controller.properties @@ -23,7 +23,7 @@ controller.type=tdjam rules.groupId=NonDroolsPolicyController rules.artifactId=tdjam -rules.version=1.0.0 +rules.version=1.0 noop.source.topics=DCAE_TOPIC,APPC-CL,APPC-LCM-WRITE,SDNR-CL-RSP,POLICY-CL-MGT,APPC-LCM-READ diff --git a/controlloop/common/controller-tdjam/src/test/resources/logback-test.xml b/controlloop/common/controller-tdjam/src/test/resources/logback-test.xml index 656cb8136..84b02f2e7 100644 --- a/controlloop/common/controller-tdjam/src/test/resources/logback-test.xml +++ b/controlloop/common/controller-tdjam/src/test/resources/logback-test.xml @@ -23,16 +23,16 @@ - %d{dd-MMM-yyyy HH:mm:ss.SSS} %-5level [%thread] %logger{36} - %msg%n + %d %level %msg%n - + - + -- cgit 1.2.3-korg