summaryrefslogtreecommitdiffstats
path: root/feature-state-management/src/test
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2017-11-29 17:01:15 -0500
committerJim Hahn <jrh3@att.com>2017-12-01 15:30:53 -0500
commit0fe7bd5eb21ca5a8daef531ade9156bb5c2e0207 (patch)
treee98a0f230e86be54e123a7c555e52a5349d01e7a /feature-state-management/src/test
parent49e60f1b0c95f63ce48fde526cc5c1ec1f046d74 (diff)
Modified state mgmt to fix some sonar issues
Reordered modifiers. Reordered variables, methods, and constructors. Removed useless parentheses. Removed unneeded "catch" clauses. Extracted nested try blocks into their own method. Replaced a string with a constant. Removed extra thrown exceptions when they are unnecessary (i.e., they're subclasses of RuntimeException, or the method is already declared to throw an Exception). Replaced a large anonymous class with a named, nested class. Separated variable declarations onto individual lines. Changed "String args[]" to "String[] args". Replaced if-then-else by single return statement. Invoked super() inside empty, default constructor. Removed Thread.sleep() calls from junit test per comments on 11/29. Commented out Thread.sleep() in junit tests, as they don't appear to be necessary. If that turns out to be untrue, then CountdownLatch.await() can be used instead. Sonar complained about useless assignments to "phase", but those did not appear to be useless. Did not remove commented-out lines, as they may be needed when debugging. Change-Id: I90ba6f7317a18a10ce1b881cfc6d21a602171ff5 Issue-ID: POLICY-469 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'feature-state-management/src/test')
-rw-r--r--feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/StateManagementTest.java14
1 files changed, 1 insertions, 13 deletions
diff --git a/feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/StateManagementTest.java b/feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/StateManagementTest.java
index 6f2a0e25..85e0ed85 100644
--- a/feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/StateManagementTest.java
+++ b/feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/StateManagementTest.java
@@ -53,12 +53,6 @@ public class StateManagementTest {
// get an instance of logger
private static Logger logger = LoggerFactory.getLogger(StateManagementTest.class);
- /*
- * Sleep after each test to allow interrupt (shutdown) recovery.
- */
-
- private long interruptRecoveryTime = 1500L;
-
StateManagementFeatureAPI stateManagementFeature;
/*
@@ -134,8 +128,6 @@ public class StateManagementTest {
logger.debug(msg);
}
- Thread.sleep(interruptRecoveryTime);
-
String admin = stateManagementFeature.getAdminState();
String oper = stateManagementFeature.getOpState();
String avail = stateManagementFeature.getAvailStatus();
@@ -155,9 +147,7 @@ public class StateManagementTest {
logger.error(e.getMessage());
assertTrue(e.getMessage(), false);
}
-
- Thread.sleep(interruptRecoveryTime);
-
+
admin = stateManagementFeature.getAdminState();
oper = stateManagementFeature.getOpState();
avail = stateManagementFeature.getAvailStatus();
@@ -179,8 +169,6 @@ public class StateManagementTest {
logger.debug(e.getMessage());
}
- Thread.sleep(interruptRecoveryTime);
-
admin = stateManagementFeature.getAdminState();
oper = stateManagementFeature.getOpState();
avail = stateManagementFeature.getAvailStatus();