summaryrefslogtreecommitdiffstats
path: root/appc-config
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-11-27 16:57:28 +0530
committerTakamune Cho <takamune.cho@att.com>2018-11-28 01:44:12 +0000
commit392d09b471ad297dfa1222d10a95f33e6aeb6af9 (patch)
tree14127052750e8f4da429008965d5931f1a5fb264 /appc-config
parent7a63f7756894e17b00e6adfa751ca90564d02ade (diff)
added test case to TestPatternNode.java
to increase code coverage Issue-ID: APPC-1086 Change-Id: I4b0ac6e586245c532a2a698b2907d518ce4d6adb Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'appc-config')
-rw-r--r--appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/pattern/TestPatternNode.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/pattern/TestPatternNode.java b/appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/pattern/TestPatternNode.java
index c1f66f2fb..848632b31 100644
--- a/appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/pattern/TestPatternNode.java
+++ b/appc-config/appc-config-generator/provider/src/test/java/org/onap/sdnc/config/generator/pattern/TestPatternNode.java
@@ -6,7 +6,7 @@
* ================================================================================
* Copyright (C) 2017 Amdocs
* =============================================================================
- * Modification Copyright (C) 2018 IBM.
+ * Modifications Copyright (C) 2018 IBM.
* =============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,6 +31,7 @@ import java.util.Map;
import org.apache.commons.io.IOUtils;
import org.junit.Test;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
+import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.sdnc.config.generator.ConfigGeneratorConstant;
public class TestPatternNode {
@@ -50,6 +51,20 @@ public class TestPatternNode {
ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS);
}
+
+ @Test(expected= SvcLogicException.class)
+ public void testParseErrorLogForEmptyLogData() throws Exception {
+ PatternNode patternNode = new PatternNode();
+ Map<String, String> inParams = new HashMap<String, String>();
+ inParams.put(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX, "test");
+ String logData = IOUtils.toString(
+ TestPatternNode.class.getClassLoader().getResourceAsStream("pattern/errorlog.txt"),
+ ConfigGeneratorConstant.STRING_ENCODING);
+ SvcLogicContext ctx = new SvcLogicContext();
+ patternNode.parseErrorLog(inParams, ctx);
+
+ }
+
// @Test(expected=Exception.class)
public void checkXMLData() throws Exception {