diff options
author | mojahidi <mojahidul.islam@amdocs.com> | 2017-09-26 17:39:23 +0530 |
---|---|---|
committer | Patrick Brady <pb071s@att.com> | 2017-09-27 22:05:22 +0000 |
commit | 5c0ab1dfa4aab9cd83d5baac17710963a11b22d9 (patch) | |
tree | f24a2e74e59afae15c49d4970573e0ec72120045 /appc-client/client-simulator/src/main | |
parent | f2e77cc8209018f6955fba400ab4d0ff609448b1 (diff) |
Increased test coverage for appc-java-client
Added Junit test cases to increase test coverage for appc-java-client
Change-Id: I31154acea348f50da5df47262611bfb108a4ed3a
Issue-ID:APPC-223
Signed-off-by: mojahidi <mojahidul.islam@amdocs.com>
Diffstat (limited to 'appc-client/client-simulator/src/main')
3 files changed, 10 insertions, 5 deletions
diff --git a/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonRequestHandler.java b/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonRequestHandler.java index 3180e7849..e3a86e01a 100644 --- a/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonRequestHandler.java +++ b/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonRequestHandler.java @@ -50,7 +50,7 @@ import java.util.Properties; public class JsonRequestHandler implements RequestHandler { - private enum modeT { + private enum modeT { SYNCH, ASYNCH } @@ -79,6 +79,10 @@ public class JsonRequestHandler implements RequestHandler { exceptRpcMap = prepareExceptionsMap(); } + public JsonRequestHandler(){ + + } + private HashMap<String,String> prepareExceptionsMap() { exceptRpcMap = new HashMap<>(); diff --git a/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonResponseHandler.java b/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonResponseHandler.java index aef034f53..5f14bb849 100644 --- a/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonResponseHandler.java +++ b/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/impl/JsonResponseHandler.java @@ -65,7 +65,7 @@ public class JsonResponseHandler implements ResponseHandler<Object> { int errorCode = 0; boolean isFinal = true; try { - JsonNode code = OBJECT_MAPPER.readTree(output).findValue("status").findValue("code"); + JsonNode code= OBJECT_MAPPER.readTree(output).findValue("status").findValue("code"); if (code == null) { LOG.error("Status code doesn't exist. Malformed response : " + output); @@ -130,7 +130,7 @@ public class JsonResponseHandler implements ResponseHandler<Object> { this.flushToFile(output, ".error", isFinal); } - private void flushToFile(String output, String suffix, boolean isFinal) { + private void flushToFile(String output, String suffix, boolean isFinal) { try (FileWriter fileWriter = new FileWriter(fileName + suffix);){ LOG.info("Output file : " + fileName + suffix); diff --git a/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/main/ClientRunner.java b/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/main/ClientRunner.java index d28927302..704fbee80 100644 --- a/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/main/ClientRunner.java +++ b/appc-client/client-simulator/src/main/java/org/openecomp/appc/simulator/client/main/ClientRunner.java @@ -37,6 +37,7 @@ import java.util.List; import java.util.Properties; public class ClientRunner { + public static void main(String ... args) throws Exception { String folder = args[0]; if (folder == null) { @@ -66,7 +67,7 @@ public class ClientRunner { // System.exit(0); } - private static Properties getProperties(String folder) { + private static Properties getProperties(String folder) { Properties prop = new Properties(); InputStream conf = null; @@ -91,7 +92,7 @@ public class ClientRunner { return prop; } - private static List<File> getJsonFiles(String folder) throws FileNotFoundException { + private static List<File> getJsonFiles(String folder) throws FileNotFoundException { Path dir = Paths.get(folder); FileFilter fileFilter = new WildcardFileFilter("*.json"); return new ArrayList<File>(Arrays.asList(dir.toFile().listFiles(fileFilter))); |