From c9d429d17c8e19620ff760870d295ce05d5190af Mon Sep 17 00:00:00 2001 From: Jorge Hernandez Date: Fri, 27 Oct 2017 15:31:19 -0500 Subject: remove explicit call to shutdown in junits since it will exit the process immediately in a graceful case and affect junit execution. Change-Id: Ibcbb65269203e189515f68c557686c29667307e2 Issue-ID: POLICY-386 Signed-off-by: Jorge Hernandez --- .../org/onap/policy/template/demo/ControlLoopFailureTest.java | 5 +++-- .../src/test/java/org/onap/policy/template/demo/Util.java | 1 - .../org/onap/policy/template/demo/VCPEControlLoopTest.java | 7 +++++-- .../org/onap/policy/template/demo/VDNSControlLoopTest.java | 11 +++++++---- .../org/onap/policy/template/demo/VFCControlLoopTest.java | 11 +++++++---- .../org/onap/policy/template/demo/VFWControlLoopTest.java | 7 +++++-- 6 files changed, 27 insertions(+), 15 deletions(-) (limited to 'controlloop/templates/template.demo/src/test/java/org') diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopFailureTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopFailureTest.java index 9b3fbfe72..869a1a6ff 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopFailureTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopFailureTest.java @@ -52,6 +52,7 @@ import org.onap.policy.drools.http.server.HttpServletServer; import org.onap.policy.drools.properties.PolicyProperties; import org.onap.policy.drools.protocol.coders.EventProtocolCoder; import org.onap.policy.drools.protocol.coders.JsonProtocolFilter; +import org.onap.policy.drools.system.PolicyController; import org.onap.policy.drools.system.PolicyEngine; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -120,10 +121,10 @@ public class ControlLoopFailureTest implements TopicListener { */ kieSession.dispose(); + PolicyEngine.manager.stop(); HttpServletServer.factory.destroy(); - PolicyEngine.manager.shutdown(); + PolicyController.factory.shutdown(); TopicEndpoint.manager.shutdown(); - PolicyEngine.manager.stop(); } /** diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/Util.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/Util.java index ab365af77..2149bc779 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/Util.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/Util.java @@ -31,7 +31,6 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.Properties; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java index 8885a23c6..aaa40d1ad 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VCPEControlLoopTest.java @@ -52,7 +52,9 @@ import org.onap.policy.drools.http.server.HttpServletServer; import org.onap.policy.drools.properties.PolicyProperties; import org.onap.policy.drools.protocol.coders.EventProtocolCoder; import org.onap.policy.drools.protocol.coders.JsonProtocolFilter; +import org.onap.policy.drools.system.PolicyController; import org.onap.policy.drools.system.PolicyEngine; +import org.onap.policy.drools.utils.LoggerUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -71,6 +73,7 @@ public class VCPEControlLoopTest implements TopicListener { Util.setAAIProps(); Util.setGuardProps(); Util.setPUProp(); + LoggerUtil.setLevel(LoggerUtil.ROOT_LOGGER, "INFO"); } @BeforeClass @@ -116,10 +119,10 @@ public class VCPEControlLoopTest implements TopicListener { */ kieSession.dispose(); + PolicyEngine.manager.stop(); HttpServletServer.factory.destroy(); - PolicyEngine.manager.shutdown(); + PolicyController.factory.shutdown(); TopicEndpoint.manager.shutdown(); - PolicyEngine.manager.stop(); } @Test diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VDNSControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VDNSControlLoopTest.java index 9b9c2fe7c..3e1785d18 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VDNSControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VDNSControlLoopTest.java @@ -51,7 +51,9 @@ import org.onap.policy.drools.http.server.HttpServletServer; import org.onap.policy.drools.properties.PolicyProperties; import org.onap.policy.drools.protocol.coders.EventProtocolCoder; import org.onap.policy.drools.protocol.coders.JsonProtocolFilter; +import org.onap.policy.drools.system.PolicyController; import org.onap.policy.drools.system.PolicyEngine; +import org.onap.policy.drools.utils.LoggerUtil; import org.onap.policy.so.SORequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -72,6 +74,7 @@ public class VDNSControlLoopTest implements TopicListener { Util.setSOProps(); Util.setGuardProps(); Util.setPUProp(); + LoggerUtil.setLevel(LoggerUtil.ROOT_LOGGER, "INFO"); } @BeforeClass @@ -118,10 +121,10 @@ public class VDNSControlLoopTest implements TopicListener { */ kieSession.dispose(); - HttpServletServer.factory.destroy(); - PolicyEngine.manager.shutdown(); - TopicEndpoint.manager.shutdown(); - PolicyEngine.manager.stop(); + PolicyEngine.manager.stop(); + HttpServletServer.factory.destroy(); + PolicyController.factory.shutdown(); + TopicEndpoint.manager.shutdown(); } @Test diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFCControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFCControlLoopTest.java index 4a2b81399..2581e3d80 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFCControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFCControlLoopTest.java @@ -52,7 +52,9 @@ import org.onap.policy.drools.http.server.HttpServletServer; import org.onap.policy.drools.properties.PolicyProperties; import org.onap.policy.drools.protocol.coders.EventProtocolCoder; import org.onap.policy.drools.protocol.coders.JsonProtocolFilter; +import org.onap.policy.drools.system.PolicyController; import org.onap.policy.drools.system.PolicyEngine; +import org.onap.policy.drools.utils.LoggerUtil; import org.onap.policy.vfc.VFCRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -74,6 +76,7 @@ public class VFCControlLoopTest implements TopicListener { Util.setVFCProps(); Util.setGuardProps(); Util.setPUProp(); + LoggerUtil.setLevel(LoggerUtil.ROOT_LOGGER, "INFO"); } @BeforeClass @@ -120,10 +123,10 @@ public class VFCControlLoopTest implements TopicListener { */ kieSession.dispose(); - HttpServletServer.factory.destroy(); - PolicyEngine.manager.shutdown(); - TopicEndpoint.manager.shutdown(); - PolicyEngine.manager.stop(); + PolicyEngine.manager.stop(); + HttpServletServer.factory.destroy(); + PolicyController.factory.shutdown(); + TopicEndpoint.manager.shutdown(); } @Test diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java index 015798491..601eef0eb 100644 --- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java +++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VFWControlLoopTest.java @@ -54,7 +54,9 @@ import org.onap.policy.drools.http.server.HttpServletServer; import org.onap.policy.drools.properties.PolicyProperties; import org.onap.policy.drools.protocol.coders.EventProtocolCoder; import org.onap.policy.drools.protocol.coders.JsonProtocolFilter; +import org.onap.policy.drools.system.PolicyController; import org.onap.policy.drools.system.PolicyEngine; +import org.onap.policy.drools.utils.LoggerUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -73,6 +75,7 @@ public class VFWControlLoopTest implements TopicListener { Util.setAAIProps(); Util.setGuardProps(); Util.setPUProp(); + LoggerUtil.setLevel(LoggerUtil.ROOT_LOGGER, "INFO"); } @BeforeClass @@ -120,10 +123,10 @@ public class VFWControlLoopTest implements TopicListener { */ kieSession.dispose(); + PolicyEngine.manager.stop(); HttpServletServer.factory.destroy(); - PolicyEngine.manager.shutdown(); + PolicyController.factory.shutdown(); TopicEndpoint.manager.shutdown(); - PolicyEngine.manager.stop(); } @Test -- cgit 1.2.3-korg