aboutsummaryrefslogtreecommitdiffstats
path: root/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditDesignationTest.java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2018-06-21 16:23:19 -0400
committerJim Hahn <jrh3@att.com>2018-06-21 17:17:10 -0400
commit9afa523e5147c971a0d8d0405361f3c3e8faa6ce (patch)
tree05566af1d59b8da6338435384a0fed481c76b179 /integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditDesignationTest.java
parentec62d8d34ae4724b81d29f6314951c277f423ba4 (diff)
IntegrityAuditor: remove sleep from junit tests
Modified the code to use a CurrentTime object for its "time" operations (e.g., sleep(), currentTimeInMillis()). Modified junit tests to replace the CurrentTime object with TestTime objects so they don't actually do any sleeping. Reformat "commit" message. Remove TODO from junit test. Init testTime in junit setUp(). Add AuditorTime and test classes. Change "latch" to "semaphore" in comments. Change time units in junit test from SECONDS to MILLISECONDS. Add sleep() method to auditor test class. Reorder field qualifiers. Change utils scope to "compile" in pom. Change-Id: I8aa8b642b315156c00422192e4aa8e47b4503c2f Issue-ID: POLICY-908 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditDesignationTest.java')
-rw-r--r--integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditDesignationTest.java14
1 files changed, 2 insertions, 12 deletions
diff --git a/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditDesignationTest.java b/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditDesignationTest.java
index 69f37da5..bd3baf49 100644
--- a/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditDesignationTest.java
+++ b/integrity-audit/src/test/java/org/onap/policy/common/ia/IntegrityAuditDesignationTest.java
@@ -53,7 +53,7 @@ public class IntegrityAuditDesignationTest extends IntegrityAuditTestBase {
* </code>
* </pre>
*/
- private static final String START_AUDIT_RE_PREFIX = "Starting audit simulation for resourceName=(";
+ private static final String START_AUDIT_RE_PREFIX = "Running audit for persistenceUnit=\\w+ on resourceName=(";
@BeforeClass
public static void setUpBeforeClass() throws Exception {
@@ -152,17 +152,7 @@ public class IntegrityAuditDesignationTest extends IntegrityAuditTestBase {
* Tests designation logic when two functioning resources are in play. Designation should
* alternate between resources.
*
- * Note: console.log must be examined to ascertain whether or not this test was successful. A
- * quick way of examining the log is to search for the string "audit simulation":
- *
- * As you can see from the "dbAuditSimulate" method, when it executes, it logs the
- * "Starting audit simulation..." message and when it finishes, it logs the
- * "Finished audit simulation..." message. By looking for these messages, you can verify that
- * the audits are run by the proper resource. For example, when testFourResourcesOneDead is run,
- * you should see a Starting.../Finished... sequence for "pdp1", followed by a
- * Starting.../Finished... sequence for pdp2, followed by a Starting.../Finished... sequence for
- * pdp4 (pdp3 is skipped as it's dead/hung), followed by a Starting.../Finished... sequence for
- * "pdp1", etc.
+ * Note: console.log must be examined to ascertain whether or not this test was successful.
*/
@Test
public void testTwoResources() throws Exception {