summaryrefslogtreecommitdiffstats
path: root/controlloop
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-10-25 14:46:20 -0400
committerJim Hahn <jrh3@att.com>2019-10-25 14:57:39 -0400
commit1be8ef842916c239ab840cf1d22b3c7d017363cd (patch)
treeacd2bd630dde2292d78bdf3bb38b2a62f0b5121c /controlloop
parentac5c19ddbed1ff5905d16a6359ee23b4888c717a (diff)
Reset the custom query flag
Some junits fail, depending on the order. Traced down to VfwControlLoopCdsTest, which sets the custom query flag, but does not reset it when the test is complete. Modified the test superclass to reset it at the start and end of each test class. Issue-ID: POLICY-2088 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I6c9ba7e37074945141ea64dfd130dc99f376a825
Diffstat (limited to 'controlloop')
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopBase.java5
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VcpeControlLoopTest.java1
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopCqTest.java8
3 files changed, 5 insertions, 9 deletions
diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopBase.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopBase.java
index 5817dc930..716452f73 100644
--- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopBase.java
+++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopBase.java
@@ -78,6 +78,8 @@ public class ControlLoopBase {
public static void setUpBeforeClass(String droolsTemplate, String yamlFile, String policyScope,
String policyName, String policyVersion) {
+ SupportUtil.setCustomQuery("false");
+
/* Set environment properties */
SupportUtil.setAaiProps();
SupportUtil.setGuardProps();
@@ -163,6 +165,9 @@ public class ControlLoopBase {
*/
@AfterClass
public static void tearDownAfterClass() {
+
+ SupportUtil.setCustomQuery("false");
+
/*
* Gracefully shut down the kie session
*/
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 25bef2ebb..7d5a4f3a8 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
@@ -58,7 +58,6 @@ public class VcpeControlLoopTest extends ControlLoopBase implements TopicListene
"service=ServiceDemo;resource=Res1Demo;type=operational",
"CL_vCPE",
"org.onap.closed_loop.ServiceDemo:VNFS:1.0.0");
- SupportUtil.setCustomQuery("false");
}
@Test
diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopCqTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopCqTest.java
index da22ac00f..e69e507f4 100644
--- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopCqTest.java
+++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopCqTest.java
@@ -28,8 +28,6 @@ import static org.junit.Assert.fail;
import java.time.Instant;
import java.util.HashMap;
import java.util.UUID;
-
-import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
@@ -57,12 +55,6 @@ public class VdnsControlLoopCqTest extends ControlLoopBase implements TopicListe
SupportUtil.setCustomQuery("true");
}
- @AfterClass
- public static void tearDownAfterClass() {
- SupportUtil.setCustomQuery("false");
- ControlLoopBase.tearDownAfterClass();
- }
-
@Test
public void successTest() {