X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cadi%2Faaf%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faaf%2Fcontent%2FJU_Content.java;h=efa0106b2867449b123b5d86f74513c67d22510e;hb=1296352d8eafee57f982a4342ad79ada4aa56d28;hp=e997378d7535b49b153c8dabaf9fba2032b71b17;hpb=13df7fff629c4fae42de9c619f3bd5aeeeddf04a;p=aaf%2Fauthz.git diff --git a/cadi/aaf/src/test/java/org/onap/aaf/content/JU_Content.java b/cadi/aaf/src/test/java/org/onap/aaf/content/JU_Content.java index e997378d..efa0106b 100644 --- a/cadi/aaf/src/test/java/org/onap/aaf/content/JU_Content.java +++ b/cadi/aaf/src/test/java/org/onap/aaf/content/JU_Content.java @@ -7,9 +7,9 @@ * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * * You may obtain a copy of the License at - * * + * * * * http://www.apache.org/licenses/LICENSE-2.0 - * * + * * * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,6 +19,7 @@ * * * * ******************************************************************************/ + package org.onap.aaf.content; import java.io.StringReader; @@ -34,43 +35,43 @@ import aaf.v2_0.Error; public class JU_Content { - @Test - public void parseErrorJSON() throws Exception { - final String msg = "{\"messageId\":\"SVC2000\",\"text\":\"Select which cred to delete (or 0 to delete all):" + - "1) %1" + - "2) %2" + - "3) %3" + - "4) %4" + - "Run same command again with chosen entry as last parameter\"," + - "\"variables\":[" + - "\"m55555@jr583u.cred.test.com 1 Wed Oct 08 11:48:08 CDT 2014\"," + - "\"m55555@jr583u.cred.test.com 1 Thu Oct 09 12:54:46 CDT 2014\"," + - "\"m55555@jr583u.cred.test.com 1 Tue Jan 06 05:00:00 CST 2015\"," + - "\"m55555@jr583u.cred.test.com 1 Wed Jan 07 05:00:00 CST 2015\"]}"; - - Error err = new Error(); - err.setText("Hello"); - err.getVariables().add("I'm a teapot"); - err.setMessageId("12"); - - -// System.out.println(msg); - RosettaEnv env = new RosettaEnv(); - RosettaDF errDF = env.newDataFactory(aaf.v2_0.Error.class); - errDF.in(RosettaData.TYPE.JSON); - errDF.out(RosettaData.TYPE.JSON); - RosettaData data = errDF.newData(); - data.load(err); - - @SuppressWarnings("unused") - String output = data.asString(); -// System.out.println(output); - - data.load(new StringReader(msg)); - err = data.asObject(); - output = err.getText(); -// System.out.println(output); - } - + @Test + public void parseErrorJSON() throws Exception { + final String msg = "{\"messageId\":\"SVC2000\",\"text\":\"Select which cred to delete (or 0 to delete all):" + + "1) %1" + + "2) %2" + + "3) %3" + + "4) %4" + + "Run same command again with chosen entry as last parameter\"," + + "\"variables\":[" + + "\"m55555@jr583u.cred.test.com 1 Wed Oct 08 11:48:08 CDT 2014\"," + + "\"m55555@jr583u.cred.test.com 1 Thu Oct 09 12:54:46 CDT 2014\"," + + "\"m55555@jr583u.cred.test.com 1 Tue Jan 06 05:00:00 CST 2015\"," + + "\"m55555@jr583u.cred.test.com 1 Wed Jan 07 05:00:00 CST 2015\"]}"; + + Error err = new Error(); + err.setText("Hello"); + err.getVariables().add("I'm a teapot"); + err.setMessageId("12"); + + +// System.out.println(msg); + RosettaEnv env = new RosettaEnv(); + RosettaDF errDF = env.newDataFactory(aaf.v2_0.Error.class); + errDF.in(RosettaData.TYPE.JSON); + errDF.out(RosettaData.TYPE.JSON); + RosettaData data = errDF.newData(); + data.load(err); + + @SuppressWarnings("unused") + String output = data.asString(); +// System.out.println(output); + + data.load(new StringReader(msg)); + err = data.asObject(); + output = err.getText(); +// System.out.println(output); + } + }