diff options
author | Patrick Brady <pb071s@att.com> | 2018-01-03 13:41:05 -0800 |
---|---|---|
committer | Skip Wonnell <skip@att.com> | 2018-01-04 21:14:05 +0000 |
commit | 169da8c70bdfdf63456e8fb1efe5a14b4e1c20d0 (patch) | |
tree | 7cf981d9b40ab3b0b85749e19cae21673258494f /appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main | |
parent | 13b9505921e2cbbd4b155a78bfdaa5caa3375ec0 (diff) |
New iaas unit tests
Adding new unit tests for the
org.onap.appc.adapter.iaas.provider.operation.impl package.
Change-Id: I4a2da6ff04b63a88e47d39080cfd8a58703364e0
Signed-off-by: Patrick Brady <pb071s@att.com>
Issue-ID: APPC-369
Diffstat (limited to 'appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main')
-rw-r--r-- | appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/RebuildServer.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/RebuildServer.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/RebuildServer.java index bbb4e2c5d..c87dc7e85 100644 --- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/RebuildServer.java +++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/RebuildServer.java @@ -69,6 +69,8 @@ public class RebuildServer extends ProviderServerOperation { private static final EELFLogger logger = EELFManager.getInstance().getLogger(RebuildServer.class); private static EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger(); private static final Configuration configuration = ConfigurationFactory.getConfiguration(); + //the sleep time used by thread.sleep to give "some time for OpenStack to start processing the request" + private long rebuildSleepTime = 10L * 1000L; /** * Rebuild the indicated server with the indicated image. This method assumes the server has been determined to be @@ -113,7 +115,7 @@ public class RebuildServer extends ProviderServerOperation { * We need to provide some time for OpenStack to start processing the request. */ try { - Thread.sleep(10L * 1000L); + Thread.sleep(rebuildSleepTime); } catch (InterruptedException e) { logger.trace("Sleep threw interrupted exception, should never occur"); metricsLogger.trace("Sleep threw interrupted exception, should never occur"); @@ -431,4 +433,14 @@ public class RebuildServer extends ProviderServerOperation { MDC.put("TargetServiceName", "rebuild server"); MDC.put("ClassName", "org.onap.appc.adapter.iaas.provider.operation.impl.RebuildServer"); } + + /** + * Sets the sleep time used by thread.sleep to give + * "some time for OpenStack to start processing the request". + * + * @param millis Time to sleep in milliseconds + */ + public void setRebuildSleepTime(long millis){ + this.rebuildSleepTime = millis; + } } |