aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/templates/template.demo.clc
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/templates/template.demo.clc')
-rw-r--r--controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopCoordinationTest.java14
-rw-r--r--controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopEventCleanupTest.java34
-rw-r--r--controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopParamsCleanupTest.java20
-rw-r--r--controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/SupportUtil.java (renamed from controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/Util.java)4
4 files changed, 36 insertions, 36 deletions
diff --git a/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopCoordinationTest.java b/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopCoordinationTest.java
index 588d00563..d4af9ea4d 100644
--- a/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopCoordinationTest.java
+++ b/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopCoordinationTest.java
@@ -82,9 +82,9 @@ public class ControlLoopCoordinationTest implements TopicListener {
static {
/* Set environment properties */
- Util.setAaiProps();
- Util.setGuardPropsEmbedded();
- Util.setPuProp();
+ SupportUtil.setAaiProps();
+ SupportUtil.setGuardPropsEmbedded();
+ SupportUtil.setPuProp();
}
/**
@@ -124,7 +124,7 @@ public class ControlLoopCoordinationTest implements TopicListener {
.customJacksonCoder(null)
.modelClassLoaderHash(1111));
try {
- Util.buildAaiSim();
+ SupportUtil.buildAaiSim();
} catch (Exception e) {
fail(e.getMessage());
}
@@ -244,7 +244,7 @@ public class ControlLoopCoordinationTest implements TopicListener {
//
// get dump of database entries and log
//
- List<?> entries = Util.dumpDb();
+ List<?> entries = SupportUtil.dumpDb();
assertNotNull(entries);
logger.debug("dumpDB, {} entries", entries.size());
for (Object entry : entries) {
@@ -307,7 +307,7 @@ public class ControlLoopCoordinationTest implements TopicListener {
/*
* Load policies from yaml
*/
- Util.Pair<ControlLoopPolicy, String> pair = Util.loadYaml(yamlFile);
+ SupportUtil.Pair<ControlLoopPolicy, String> pair = SupportUtil.loadYaml(yamlFile);
assertNotNull(pair);
assertNotNull(pair.first);
assertNotNull(pair.first.getControlLoop());
@@ -320,7 +320,7 @@ public class ControlLoopCoordinationTest implements TopicListener {
/*
* Construct a kie session
*/
- final KieSession kieSession = Util.buildContainer(droolsTemplate,
+ final KieSession kieSession = SupportUtil.buildContainer(droolsTemplate,
controlLoopName.toString(),
policyScope,
policyName,
diff --git a/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopEventCleanupTest.java b/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopEventCleanupTest.java
index ef5fac693..e034990fe 100644
--- a/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopEventCleanupTest.java
+++ b/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopEventCleanupTest.java
@@ -52,7 +52,7 @@ 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.logging.LoggerUtil;
-import org.onap.policy.template.demo.clc.Util.Pair;
+import org.onap.policy.template.demo.clc.SupportUtil.Pair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -97,7 +97,7 @@ public class ControlLoopEventCleanupTest {
private static String saveGuardFlag;
private static KieSession kieSession;
- private static Util.RuleSpec[] specifications;
+ private static SupportUtil.RuleSpec[] specifications;
/**
* Setup the simulator.
@@ -109,7 +109,7 @@ public class ControlLoopEventCleanupTest {
saveGuardFlag = PolicyEngine.manager.getEnvironmentProperty(GUARD_DISABLED);
PolicyEngine.manager.getEnvironment().setProperty(GUARD_DISABLED, "true");
- Util.setAaiProps();
+ SupportUtil.setAaiProps();
PolicyEngine.manager.configure(new Properties());
assertTrue(PolicyEngine.manager.start());
@@ -144,7 +144,7 @@ public class ControlLoopEventCleanupTest {
.modelClassLoaderHash(1111));
try {
- Util.buildAaiSim();
+ SupportUtil.buildAaiSim();
} catch (Exception e) {
logger.error("Could not create simulator", e);
@@ -156,15 +156,15 @@ public class ControlLoopEventCleanupTest {
}
try {
- specifications = new Util.RuleSpec[2];
+ specifications = new SupportUtil.RuleSpec[2];
- specifications[0] = new Util.RuleSpec(DROOLS_TEMPLATE, CONTROL_LOOP_NAME, POLICY_SCOPE, POLICY_NAME,
+ specifications[0] = new SupportUtil.RuleSpec(DROOLS_TEMPLATE, CONTROL_LOOP_NAME, POLICY_SCOPE, POLICY_NAME,
POLICY_VERSION, loadYaml(YAML));
- specifications[1] = new Util.RuleSpec(DROOLS_TEMPLATE, CONTROL_LOOP_NAME_B, POLICY_SCOPE, POLICY_NAME_B,
- POLICY_VERSION, loadYaml(YAML_B));
+ specifications[1] = new SupportUtil.RuleSpec(DROOLS_TEMPLATE, CONTROL_LOOP_NAME_B, POLICY_SCOPE,
+ POLICY_NAME_B, POLICY_VERSION, loadYaml(YAML_B));
- kieSession = Util.buildContainer(POLICY_VERSION, specifications);
+ kieSession = SupportUtil.buildContainer(POLICY_VERSION, specifications);
} catch (IOException e) {
logger.error("Could not create kieSession", e);
@@ -269,17 +269,17 @@ public class ControlLoopEventCleanupTest {
* effect, so then we'll update the second rule set, which should trigger a
* clean-up of both.
*/
- Util.RuleSpec[] specs = new Util.RuleSpec[1];
+ SupportUtil.RuleSpec[] specs = new SupportUtil.RuleSpec[1];
specs[0] = specifications[1];
logger.info("UPDATING VERSION TO v5.0 - DELETED RULE SET");
- Util.updateContainer("v5.0", specs);
+ SupportUtil.updateContainer("v5.0", specs);
- specs[0] = new Util.RuleSpec(DROOLS_TEMPLATE, CONTROL_LOOP_NAME_B, POLICY_SCOPE, POLICY_NAME_B, POLICY_VERSION,
- loadYaml(YAML));
+ specs[0] = new SupportUtil.RuleSpec(DROOLS_TEMPLATE, CONTROL_LOOP_NAME_B, POLICY_SCOPE, POLICY_NAME_B,
+ POLICY_VERSION, loadYaml(YAML));
logger.info("UPDATING VERSION TO v6.0 - UPDATED SECOND RULE SET");
- Util.updateContainer("v6.0", specs);
+ SupportUtil.updateContainer("v6.0", specs);
kieSession.fireAllRules();
facts = getSessionObjects();
@@ -298,13 +298,13 @@ public class ControlLoopEventCleanupTest {
*/
private static void updatePolicy(String yamlFile, String policyVersion) throws IOException {
- specifications[0] = new Util.RuleSpec(DROOLS_TEMPLATE, CONTROL_LOOP_NAME, POLICY_SCOPE, POLICY_NAME,
+ specifications[0] = new SupportUtil.RuleSpec(DROOLS_TEMPLATE, CONTROL_LOOP_NAME, POLICY_SCOPE, POLICY_NAME,
policyVersion, loadYaml(yamlFile));
/*
* Update the policy within the container.
*/
- Util.updateContainer(policyVersion, specifications);
+ SupportUtil.updateContainer(policyVersion, specifications);
}
/**
@@ -315,7 +315,7 @@ public class ControlLoopEventCleanupTest {
* @throws UnsupportedEncodingException if an error occurs
*/
private static String loadYaml(String yamlFile) throws UnsupportedEncodingException {
- Pair<ControlLoopPolicy, String> pair = Util.loadYaml(yamlFile);
+ Pair<ControlLoopPolicy, String> pair = SupportUtil.loadYaml(yamlFile);
assertNotNull(pair);
assertNotNull(pair.first);
assertNotNull(pair.first.getControlLoop());
diff --git a/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopParamsCleanupTest.java b/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopParamsCleanupTest.java
index 257aeb350..e0696abff 100644
--- a/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopParamsCleanupTest.java
+++ b/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopParamsCleanupTest.java
@@ -37,7 +37,7 @@ import org.junit.Test;
import org.kie.api.runtime.KieSession;
import org.onap.policy.controlloop.policy.ControlLoopPolicy;
import org.onap.policy.drools.utils.logging.LoggerUtil;
-import org.onap.policy.template.demo.clc.Util.Pair;
+import org.onap.policy.template.demo.clc.SupportUtil.Pair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -73,7 +73,7 @@ public class ControlLoopParamsCleanupTest {
private static final String CONTROL_LOOP_NAME_B = "ControlLoop-Params-Cleanup-Test-B";
private static KieSession kieSession;
- private static Util.RuleSpec[] specifications;
+ private static SupportUtil.RuleSpec[] specifications;
/**
* Setup the simulator.
@@ -83,15 +83,15 @@ public class ControlLoopParamsCleanupTest {
LoggerUtil.setLevel(LoggerUtil.ROOT_LOGGER, "INFO");
try {
- specifications = new Util.RuleSpec[2];
+ specifications = new SupportUtil.RuleSpec[2];
- specifications[0] = new Util.RuleSpec(DROOLS_TEMPLATE, CONTROL_LOOP_NAME, POLICY_SCOPE, POLICY_NAME,
+ specifications[0] = new SupportUtil.RuleSpec(DROOLS_TEMPLATE, CONTROL_LOOP_NAME, POLICY_SCOPE, POLICY_NAME,
POLICY_VERSION, loadYaml(YAML));
- specifications[1] = new Util.RuleSpec(DROOLS_TEMPLATE, CONTROL_LOOP_NAME_B, POLICY_SCOPE, POLICY_NAME_B,
- POLICY_VERSION, loadYaml(YAML_B));
+ specifications[1] = new SupportUtil.RuleSpec(DROOLS_TEMPLATE, CONTROL_LOOP_NAME_B, POLICY_SCOPE,
+ POLICY_NAME_B, POLICY_VERSION, loadYaml(YAML_B));
- kieSession = Util.buildContainer(POLICY_VERSION, specifications);
+ kieSession = SupportUtil.buildContainer(POLICY_VERSION, specifications);
} catch (IOException e) {
logger.error("Could not create kieSession", e);
@@ -189,13 +189,13 @@ public class ControlLoopParamsCleanupTest {
*/
private static void updatePolicy(String yamlFile, String policyVersion) throws IOException {
- specifications[0] = new Util.RuleSpec(DROOLS_TEMPLATE, CONTROL_LOOP_NAME, POLICY_SCOPE, POLICY_NAME,
+ specifications[0] = new SupportUtil.RuleSpec(DROOLS_TEMPLATE, CONTROL_LOOP_NAME, POLICY_SCOPE, POLICY_NAME,
policyVersion, loadYaml(yamlFile));
/*
* Update the policy within the container.
*/
- Util.updateContainer(policyVersion, specifications);
+ SupportUtil.updateContainer(policyVersion, specifications);
}
/**
@@ -206,7 +206,7 @@ public class ControlLoopParamsCleanupTest {
* @throws UnsupportedEncodingException if an error occurs
*/
private static String loadYaml(String yamlFile) throws UnsupportedEncodingException {
- Pair<ControlLoopPolicy, String> pair = Util.loadYaml(yamlFile);
+ Pair<ControlLoopPolicy, String> pair = SupportUtil.loadYaml(yamlFile);
assertNotNull(pair);
assertNotNull(pair.first);
assertNotNull(pair.first.getControlLoop());
diff --git a/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/Util.java b/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/SupportUtil.java
index 1d105911c..bf2038cc2 100644
--- a/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/Util.java
+++ b/controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/SupportUtil.java
@@ -56,10 +56,10 @@ import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;
-public final class Util {
+public final class SupportUtil {
private static final String OPSHISTPUPROP = "OperationsHistoryPU";
- private static final Logger logger = LoggerFactory.getLogger(Util.class);
+ private static final Logger logger = LoggerFactory.getLogger(SupportUtil.class);
// values from the last call to buildContainer()