Reset the custom query flag 22/97622/1
authorJim Hahn <jrh3@att.com>
Fri, 25 Oct 2019 18:46:20 +0000 (14:46 -0400)
committerJim Hahn <jrh3@att.com>
Fri, 25 Oct 2019 18:57:39 +0000 (14:57 -0400)
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

controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopBase.java
controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VcpeControlLoopTest.java
controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopCqTest.java

index 5817dc9..716452f 100644 (file)
@@ -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
          */
index 25bef2e..7d5a4f3 100644 (file)
@@ -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
index da22ac0..e69e507 100644 (file)
@@ -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() {