diff options
author | liamfallon <liam.fallon@ericsson.com> | 2018-09-27 16:52:23 +0100 |
---|---|---|
committer | liamfallon <liam.fallon@ericsson.com> | 2018-09-27 16:52:34 +0100 |
commit | afd3a44e210de3c1aed9f6f7278913b2a2f2f6d2 (patch) | |
tree | 3b7c6038ec3d526549e4795032ea1c8baf2fcc0a /core | |
parent | 3595f7c277778a64d1d828b66ed8127d92c010b5 (diff) |
Add JUnit for web service client tool
JUnit, SOnar fixes, and some minor bug fixes.
Issue-ID: POLICY-1034
Change-Id: I72f46e944051f7d65d6b106afe33c759975283af
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'core')
2 files changed, 10 insertions, 4 deletions
diff --git a/core/core-deployment/src/main/java/org/onap/policy/apex/core/deployment/BatchDeployer.java b/core/core-deployment/src/main/java/org/onap/policy/apex/core/deployment/BatchDeployer.java index 321d61583..1748a0663 100644 --- a/core/core-deployment/src/main/java/org/onap/policy/apex/core/deployment/BatchDeployer.java +++ b/core/core-deployment/src/main/java/org/onap/policy/apex/core/deployment/BatchDeployer.java @@ -83,7 +83,7 @@ public class BatchDeployer { * @throws IOException on IO exceptions from the operating system */ public void deployModel(final String modelFileName, final boolean ignoreConflicts, final boolean force) - throws ApexException, IOException { + throws ApexException { engineServiceFacade.deployModel(modelFileName, ignoreConflicts, force); } @@ -144,7 +144,7 @@ public class BatchDeployer { deployer.init(); deployer.deployModel(args[2], false, false); deployer.startEngines(); - } catch (final ApexException | IOException e) { + } catch (final ApexException e) { LOGGER.error("model deployment failed on parameters {}", args, e); } finally { if (deployer != null) { diff --git a/core/core-deployment/src/main/java/org/onap/policy/apex/core/deployment/EngineServiceFacade.java b/core/core-deployment/src/main/java/org/onap/policy/apex/core/deployment/EngineServiceFacade.java index 9b24bcd96..e27bf5d07 100644 --- a/core/core-deployment/src/main/java/org/onap/policy/apex/core/deployment/EngineServiceFacade.java +++ b/core/core-deployment/src/main/java/org/onap/policy/apex/core/deployment/EngineServiceFacade.java @@ -195,7 +195,7 @@ public class EngineServiceFacade { * @throws IOException on IO exceptions from the operating system */ public void deployModel(final String modelFileName, final boolean ignoreConflicts, final boolean force) - throws ApexException, IOException { + throws ApexException { if (engineServiceKey == null || engineKeyArray == null || engineKeyArray.length == 0) { LOGGER.error("cound not deploy apex model, deployer is not initialized"); throw new ApexDeploymentException("cound not deploy apex model, deployer is not initialized"); @@ -212,7 +212,13 @@ public class EngineServiceFacade { } } - deployModel(modelFileName, apexModelUrl.openStream(), ignoreConflicts, force); + try { + deployModel(modelFileName, apexModelUrl.openStream(), ignoreConflicts, force); + } catch (Exception deployException) { + String errorMessage = "could not deploy apex model from " + modelFileName; + LOGGER.error(errorMessage, deployException); + throw new ApexDeploymentException(errorMessage, deployException); + } } /** |