summaryrefslogtreecommitdiffstats
path: root/vnf-sdk-function-test/src/main
diff options
context:
space:
mode:
authorMurali-P <murali.p@huawei.com>2017-02-14 20:40:25 +0530
committerMurali-P <murali.p@huawei.com>2017-02-14 20:40:25 +0530
commitc7c7fab17d0ba086d31036fc4395642c24335c56 (patch)
treed0118c4ba184a7d8f41b3270e8e272d670d2f6a0 /vnf-sdk-function-test/src/main
parent8f2000d6bdc174964714f6538737beacb6354063 (diff)
Add/Update new UT Test cases
Resolved:VNFSDK-21 Function test base code Change-Id: I74f57856a23ec83fbc5716d6507262a9594df666 Signed-off-by: Murali-P <murali.p@huawei.com>
Diffstat (limited to 'vnf-sdk-function-test/src/main')
-rw-r--r--vnf-sdk-function-test/src/main/java/org/openo/vnfsdk/functest/responsehandler/VnfFuncTestResponseHandler.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/vnf-sdk-function-test/src/main/java/org/openo/vnfsdk/functest/responsehandler/VnfFuncTestResponseHandler.java b/vnf-sdk-function-test/src/main/java/org/openo/vnfsdk/functest/responsehandler/VnfFuncTestResponseHandler.java
index 8fbf265..eb3174b 100644
--- a/vnf-sdk-function-test/src/main/java/org/openo/vnfsdk/functest/responsehandler/VnfFuncTestResponseHandler.java
+++ b/vnf-sdk-function-test/src/main/java/org/openo/vnfsdk/functest/responsehandler/VnfFuncTestResponseHandler.java
@@ -34,10 +34,13 @@ import com.fasterxml.jackson.databind.ObjectMapper;
public class VnfFuncTestResponseHandler {
private static int actioninProgress = 21;
+
private static int error = 22;
+
private static String resultpathkey = "DIR_RESULT";
private static Map<String, String> mapConfigValues;
+
private static VnfFuncTestResponseHandler vnfFuncRspHandler;
private static final Logger logger = LoggerFactory.getLogger(VnfFuncTestResponseHandler.class);
@@ -53,10 +56,13 @@ public class VnfFuncTestResponseHandler {
return vnfFuncRspHandler;
}
+ public void setConfigMap(Map<String, String> inMapConfigValues) {
+ mapConfigValues = inMapConfigValues;
+ }
+
public Response getResponseByFuncTestId(String funcTestId) {
- if((null == mapConfigValues) || (null == mapConfigValues.get(resultpathkey)))
- {
+ if((null == mapConfigValues) || (null == mapConfigValues.get(resultpathkey))) {
logger.warn("Result Store path not configfured !!!");
return RestResponseUtil.getErrorResponse(error);
}
@@ -83,30 +89,24 @@ public class VnfFuncTestResponseHandler {
// Delete Result folders present if Success !!!
// ----------------------------------------------
FileUtil.deleteFile(zipFileName);
- FileUtil.deleteDirectory(fileName);
+ // Later will delete this file..FileUtil.deleteDirectory(fileName);
logger.warn("Resquested function Test result Sucess !!!");
return RestResponseUtil.getSuccessResponse(byteArrayFile);
- }
- else
- {
+ } else {
logger.warn("Resquested function Test result Faiuled !!!");
return RestResponseUtil.getErrorResponse(error);
}
}
@SuppressWarnings("unchecked")
- private static void loadConfigurations()
- {
+ private static void loadConfigurations() {
String curDir = System.getProperty("user.dir");
String confDir = curDir + File.separator + "conf" + File.separator + "robot" + File.separator;
ObjectMapper mapper = new ObjectMapper();
- try
- {
+ try {
mapConfigValues = mapper.readValue(new FileInputStream(confDir + "robotMetaData.json"), Map.class);
- }
- catch(IOException e)
- {
+ } catch(IOException e) {
logger.error("Reading Json Meta data file failed or file do not exist" + e.getMessage());
return;
}