aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliboNet <libo.zhu@intel.com>2019-01-05 13:31:04 +0800
committerPamela Dragosh <pdragosh@research.att.com>2019-01-10 10:46:08 +0000
commit0b0a4d5d728b4e125429e21472bb0396dd1beae4 (patch)
treed6356dacd774d2a8c11175fbbed08dd5b9ad30ab
parent6766ca671937871dcbc56d3c7a7df2385a34dfb4 (diff)
Fix Noncompliant usage sonar issue
remove the Thread.sleep about such noncompliant usage rename the funciton name for codestyle's alignment Change-Id: I71b66143d7d68fa58a1a60de70e1836fde7df8c4 Issue-ID: POLICY-1256 Signed-off-by: liboNet <libo.zhu@intel.com> (cherry picked from commit 2fd83c1b4dc05314d57503c6ba647b88326003d2)
-rw-r--r--main/src/test/java/org/onap/policy/distribution/main/parameters/CommonTestData.java2
-rw-r--r--main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsDistributionRestServer.java3
-rw-r--r--main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsStatisticDistributionRestServer.java5
3 files changed, 4 insertions, 6 deletions
diff --git a/main/src/test/java/org/onap/policy/distribution/main/parameters/CommonTestData.java b/main/src/test/java/org/onap/policy/distribution/main/parameters/CommonTestData.java
index 334aa761..ccd3db6c 100644
--- a/main/src/test/java/org/onap/policy/distribution/main/parameters/CommonTestData.java
+++ b/main/src/test/java/org/onap/policy/distribution/main/parameters/CommonTestData.java
@@ -85,7 +85,7 @@ public class CommonTestData {
restServerParameters = new RestServerParameters(REST_SERVER_HOST, REST_SERVER_PORT, REST_SERVER_USER,
REST_SERVER_PASSWORD, REST_SERVER_HTTPS);
} else {
- restServerParameters = new RestServerParameters(null, 0, null, null, false);
+ restServerParameters = new RestServerParameters(null, 0, null, null, REST_SERVER_HTTPS);
}
return restServerParameters;
}
diff --git a/main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsDistributionRestServer.java b/main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsDistributionRestServer.java
index f093b2ac..6667d7fd 100644
--- a/main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsDistributionRestServer.java
+++ b/main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsDistributionRestServer.java
@@ -118,8 +118,7 @@ public class TestHttpsDistributionRestServer {
try {
response = invocationBuilder.get(HealthCheckReport.class);
} catch (final Exception exp) {
- LOGGER.info("the server is not started yet. We will retry again");
- Thread.sleep(1000);
+ LOGGER.error("the server is not started yet. We will retry again", exp);
}
}
return response;
diff --git a/main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsStatisticDistributionRestServer.java b/main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsStatisticDistributionRestServer.java
index 4d5aa7a8..5aadb6ed 100644
--- a/main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsStatisticDistributionRestServer.java
+++ b/main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsStatisticDistributionRestServer.java
@@ -56,7 +56,7 @@ public class TestHttpsStatisticDistributionRestServer {
private static String KEYSTORE = System.getProperty("user.dir") + "/src/test/resources/ssl/policy-keystore";
@Test
- public void testHealthCheckSuccess()
+ public void testDistributionStatistic()
throws PolicyDistributionException, InterruptedException, KeyManagementException, NoSuchAlgorithmException {
final String reportString = "StatisticsReport [code=200, totalDistributionCount=0, distributionSuccessCount=0, "
+ "distributionFailureCount=0, totalDownloadCount=0, " + "downloadSuccessCount=0, downloadFailureCount=0]";
@@ -115,8 +115,7 @@ public class TestHttpsStatisticDistributionRestServer {
try {
response = invocationBuilder.get(StatisticsReport.class);
} catch (final Exception exp) {
- LOGGER.info("the server is not started yet. We will retry again");
- Thread.sleep(1000);
+ LOGGER.error("the server is not started yet. We will retry again", exp);
}
}
return response;