diff options
author | Magnusen, Drew (dm741q) <dm741q@att.com> | 2017-08-24 11:37:46 -0500 |
---|---|---|
committer | Magnusen, Drew (dm741q) <dm741q@att.com> | 2017-08-28 13:07:09 -0500 |
commit | 11e0afc41aa47b9b5fe36c6c654c5b7493e4ba46 (patch) | |
tree | b05742106ad95c9f47a006f36eb87aabb784ca1e /controlloop/common/model-impl/mso | |
parent | d03507850e293674cc118f76bab0629d457179ae (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/model-impl/mso')
-rw-r--r-- | controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOManager.java | 12 | ||||
-rw-r--r-- | controlloop/common/model-impl/mso/src/test/java/org/onap/policy/mso/TestDemo.java | 12 |
2 files changed, 14 insertions, 10 deletions
diff --git a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOManager.java b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOManager.java index 9f4fe5bbc..c23935586 100644 --- a/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOManager.java +++ b/controlloop/common/model-impl/mso/src/main/java/org/onap/policy/mso/MSOManager.java @@ -60,8 +60,8 @@ public final class MSOManager { MSOResponse response = Serialization.gsonPretty.fromJson(httpDetails.b, MSOResponse.class); String body = Serialization.gsonPretty.toJson(response); - System.out.println("***** Response to post:"); - System.out.println(body); + logger.debug("***** Response to post:"); + logger.debug(body); String requestId = response.requestReferences.requestId; int attemptsLeft = 20; @@ -75,24 +75,26 @@ public final class MSOManager { Pair<Integer, String> httpDetailsGet = RESTManager.get(urlGet, username, password, headers); responseGet = Serialization.gsonPretty.fromJson(httpDetailsGet.b, MSOResponse.class); body = Serialization.gsonPretty.toJson(responseGet); - System.out.println("***** Response to get:"); - System.out.println(body); + logger.debug("***** Response to get:"); + logger.debug(body); if(httpDetailsGet.a == 200){ if(responseGet.request.requestStatus.requestState.equalsIgnoreCase("COMPLETE") || responseGet.request.requestStatus.requestState.equalsIgnoreCase("FAILED")){ - System.out.println("***** ######## VF Module Creation "+responseGet.request.requestStatus.requestState); + logger.debug("***** ######## VF Module Creation "+responseGet.request.requestStatus.requestState); return responseGet; } } Thread.sleep(20000); } + if (responseGet != null && responseGet.request != null && responseGet.request.requestStatus != null && responseGet.request.requestStatus.requestState != null) { logger.warn("***** ######## VF Module Creation timeout. Status: ( {})", responseGet.request.requestStatus.requestState); } + return responseGet; } catch (JsonSyntaxException e) { logger.error("Failed to deserialize into MSOResponse: ", e); diff --git a/controlloop/common/model-impl/mso/src/test/java/org/onap/policy/mso/TestDemo.java b/controlloop/common/model-impl/mso/src/test/java/org/onap/policy/mso/TestDemo.java index c840894e8..2c8253f0b 100644 --- a/controlloop/common/model-impl/mso/src/test/java/org/onap/policy/mso/TestDemo.java +++ b/controlloop/common/model-impl/mso/src/test/java/org/onap/policy/mso/TestDemo.java @@ -33,9 +33,11 @@ import org.onap.policy.mso.MSORequestDetails; import org.onap.policy.mso.MSORequestInfo; import org.onap.policy.mso.MSORequestParameters; import org.onap.policy.mso.util.Serialization; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestDemo { - + private static final Logger logger = LoggerFactory.getLogger(TestDemo.class); @Test public void test() { @@ -102,19 +104,19 @@ public class TestDemo { request.requestDetails.requestParameters.userParams.add(userParam2); String body = Serialization.gsonPretty.toJson(request); - System.out.println(body); + logger.debug(body); //MSOResponse response = MSOManager.createModuleInstance("http://localhost:7780/", "my_username", "my_passwd", request); //body = Serialization.gsonPretty.toJson(response); - //System.out.println(body); + //logger.debug(body); } @Test public void testHack() { - System.out.println("** HACK **"); + logger.debug("** HACK **"); MSORequest request = new MSORequest(); // @@ -166,7 +168,7 @@ public class TestDemo { request.requestDetails.relatedInstanceList.add(relatedInstanceListElement2); String body = Serialization.gsonPretty.toJson(request); - System.out.println(body); + logger.debug(body); } } |