aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorParshad Patel <pars.patel@samsung.com>2020-02-04 17:19:14 +0900
committerParshad Patel <pars.patel@samsung.com>2020-02-04 17:23:57 +0900
commitb5dd0fc4de9fc2d6d01392b90c5232664ae0293c (patch)
tree1c3a2816db9f9e8bb09fedda4e1f3438cd53333b
parente9c0b88ed9b0e9a538ee87f25f3ea4c99f853702 (diff)
Fix logging issue in so-simulator
Use a logger to log this exception Either log or rethrow this exception Issue-ID: SO-1841 Change-Id: I5a9802fcf11d610cd60b61c0760781add7cdc91d Signed-off-by: Parshad Patel <pars.patel@samsung.com>
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java6
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java2
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateAAInventory.java6
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/ProcessSDNCAssignService.java7
4 files changed, 15 insertions, 6 deletions
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java
index 075a5b7a6b..7b6fb36fab 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java
@@ -5,6 +5,8 @@ import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.AAIResourcesClient;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.consol.citrus.actions.AbstractTestAction;
import com.consol.citrus.context.TestContext;
@@ -13,7 +15,7 @@ public class ProcessNetwork extends AbstractTestAction {
@Override
public void doExecute(TestContext context) {
-
+ final Logger logger = LoggerFactory.getLogger(ProcessNetwork.class);
try {
int random = (int) (Math.random() * 50 + 1);
@@ -35,7 +37,7 @@ public class ProcessNetwork extends AbstractTestAction {
aaiResourceClient.delete(networkURI);
}
} catch (Exception e) {
- e.printStackTrace();
+ logger.debug("Exception in ProcessNetwork.doExecute", e);
}
}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
index e061d2b79d..76ad823f18 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
@@ -58,7 +58,7 @@ public class ProcessVnfc extends AbstractTestAction {
aaiResourceClient.connect(vfModuleURI, vnfcURI);
}
} catch (Exception e) {
- logger.debug(e.getMessage());
+ logger.debug("Exception in ProcessVnfc.doExecute", e);
}
}
}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateAAInventory.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateAAInventory.java
index eae5ef2135..c8fddcf19c 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateAAInventory.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateAAInventory.java
@@ -7,6 +7,8 @@ import org.onap.so.client.aai.AAIObjectType;
import org.onap.so.client.aai.AAIResourcesClient;
import org.onap.so.client.aai.entities.uri.AAIResourceUri;
import org.onap.so.client.aai.entities.uri.AAIUriFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource;
import com.consol.citrus.actions.AbstractTestAction;
import com.consol.citrus.context.TestContext;
@@ -15,6 +17,8 @@ public class CreateAAInventory extends AbstractTestAction {
@Override
public void doExecute(TestContext context) {
+ final Logger logger = LoggerFactory.getLogger(CreateAAInventory.class);
+
try {
String stackName = context.getVariable("stackName");
@@ -30,7 +34,7 @@ public class CreateAAInventory extends AbstractTestAction {
aaiResourceClient.create(vserverURI, vserver);
}
} catch (Exception e) {
- e.printStackTrace();
+ logger.debug("Exception in CreateAAInventory.doExecute", e);
}
}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/ProcessSDNCAssignService.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/ProcessSDNCAssignService.java
index c1ba812513..d3e9fc045d 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/ProcessSDNCAssignService.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/ProcessSDNCAssignService.java
@@ -1,13 +1,16 @@
package org.onap.so.simulator.scenarios.sdnc.grapi;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.consol.citrus.actions.AbstractTestAction;
import com.consol.citrus.context.TestContext;
public class ProcessSDNCAssignService extends AbstractTestAction {
-
@Override
public void doExecute(TestContext context) {
+ final Logger logger = LoggerFactory.getLogger(ProcessSDNCAssignService.class);
+
try {
String serviceName = context.getVariable("serviceName");
String action = context.getVariable("action");
@@ -21,7 +24,7 @@ public class ProcessSDNCAssignService extends AbstractTestAction {
}
} catch (Exception e) {
- e.printStackTrace();
+ logger.debug("Exception in ProcessSDNCAssignService.doExecute", e);
}
}