added test case to TestPatternNode.java
[appc.git] / appc-config / appc-config-generator / provider / src / test / java / org / onap / sdnc / config / generator / pattern / TestPatternNode.java
index c1f66f2..848632b 100644 (file)
@@ -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 {