aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/policy-yaml
diff options
context:
space:
mode:
authorMagnusen, Drew (dm741q) <dm741q@att.com>2017-08-24 11:37:46 -0500
committerMagnusen, Drew (dm741q) <dm741q@att.com>2017-08-28 13:07:09 -0500
commit11e0afc41aa47b9b5fe36c6c654c5b7493e4ba46 (patch)
treeb05742106ad95c9f47a006f36eb87aabb784ca1e /controlloop/common/policy-yaml
parentd03507850e293674cc118f76bab0629d457179ae (diff)
Removal of sys.out/err with logger messages
Removed any use of System.out.println or System.err.println and replaced with relevant logger statements. Issue-ID: POLICY-176 Change-Id: I91513267635bfb2a34f2a9650c48f367d53fc842 Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
Diffstat (limited to 'controlloop/common/policy-yaml')
-rw-r--r--controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyTest.java10
-rw-r--r--controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java6
-rw-r--r--controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardTest.java10
3 files changed, 16 insertions, 10 deletions
diff --git a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyTest.java b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyTest.java
index b0d15463d..b847009cc 100644
--- a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyTest.java
+++ b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyTest.java
@@ -29,6 +29,8 @@ import java.io.IOException;
import java.io.InputStream;
import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.DumperOptions.FlowStyle;
import org.yaml.snakeyaml.Yaml;
@@ -36,7 +38,7 @@ import org.yaml.snakeyaml.constructor.Constructor;
public class ControlLoopPolicyTest {
-
+ private static final Logger logger = LoggerFactory.getLogger(ControlLoopPolicyTest.class);
@Test
public void test() {
this.test("src/test/resources/v1.0.0/policy_Test.yaml");
@@ -91,7 +93,7 @@ public class ControlLoopPolicyTest {
options.setPrettyFlow(true);
yaml = new Yaml(options);
String dumpedYaml = yaml.dump(obj);
- System.out.println(dumpedYaml);
+ logger.debug(dumpedYaml);
//
// Read that string back into our java object
//
@@ -112,7 +114,7 @@ public class ControlLoopPolicyTest {
}
public void dump(Object obj) {
- System.out.println("Dumping " + obj.getClass().getCanonicalName());
- System.out.println(obj.toString());
+ logger.debug("Dumping ", obj.getClass().getCanonicalName());
+ logger.debug("{}", obj);
}
}
diff --git a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java
index da81db394..36cf34e5f 100644
--- a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java
+++ b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java
@@ -40,11 +40,13 @@ import org.onap.policy.controlloop.policy.builder.Message;
import org.onap.policy.controlloop.policy.builder.MessageLevel;
import org.onap.policy.controlloop.policy.builder.Results;
import org.onap.policy.controlloop.policy.guard.builder.ControlLoopGuardBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;
public class ControlLoopGuardBuilderTest {
-
+ private static final Logger logger = LoggerFactory.getLogger(ControlLoopGuardBuilderTest.class);
@Test
public void testControlLoopGuard() {
try {
@@ -190,7 +192,7 @@ public class ControlLoopGuardBuilderTest {
//
// Print out the specification
//
- System.out.println(results.getSpecification());
+ logger.debug(results.getSpecification());
//
} catch (FileNotFoundException e) {
fail(e.getLocalizedMessage());
diff --git a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardTest.java b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardTest.java
index 61ad4dfbf..d1a35413e 100644
--- a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardTest.java
+++ b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardTest.java
@@ -29,6 +29,8 @@ import java.io.IOException;
import java.io.InputStream;
import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.DumperOptions.FlowStyle;
import org.yaml.snakeyaml.Yaml;
@@ -36,7 +38,7 @@ import org.yaml.snakeyaml.constructor.Constructor;
public class ControlLoopGuardTest {
-
+ private static final Logger logger = LoggerFactory.getLogger(ControlLoopGuardTest.class);
@Test
public void testGuardvDNS() {
this.test("src/test/resources/v2.0.0-guard/policy_guard_ONAP_demo_vDNS.yaml");
@@ -66,7 +68,7 @@ public class ControlLoopGuardTest {
options.setPrettyFlow(true);
yaml = new Yaml(options);
String dumpedYaml = yaml.dump(obj);
- System.out.println(dumpedYaml);
+ logger.debug(dumpedYaml);
//
// Read that string back into our java object
//
@@ -87,7 +89,7 @@ public class ControlLoopGuardTest {
}
public void dump(Object obj) {
- System.out.println("Dumping " + obj.getClass().getCanonicalName());
- System.out.println(obj.toString());
+ logger.debug("Dumping {}", obj.getClass().getCanonicalName());
+ logger.debug("{}", obj);
}
}