summaryrefslogtreecommitdiffstats
path: root/integrity-audit/src/test/java
diff options
context:
space:
mode:
authorRalph Straubs <rs8887@att.com>2017-04-20 05:26:49 -0500
committerRalph Straubs <rs8887@att.com>2017-04-20 05:34:06 -0500
commitd5d7dd40f8b29a7a4921829bd6ccf9b670613af2 (patch)
treec93b970c711255a5468d82426ca1eb90ecdc8811 /integrity-audit/src/test/java
parentc2aad6527c903cc3359ef9673d0706f37d4b89ec (diff)
Batch submit
[ECOMPD2TD-1073 1707] Removal of extra flush statements and addition of rollbacks in catch blocks instead of commits. [ECOMPD2TD-1073 1707] Adding some needed synchronized statements to IntegrityMonitor. [ECOMPD2TD-1159] - Loggers should be Serializable By making loggers Serializable, they can be included in Drools persistent data. 'EelfLogger' and 'SystemOutLogger' can do this trivially, but 'Logger4J' needed some additional work, because it has a non-serializable field 'log'. [ECOMPD2TD-000] Fix versioning of org.openecomp.policy.* dependencies [US866186 1707] First cut of stateCheck mod and non-working JUnit [US866186 1707] Completed the coding for the task TA1998344 which adds a check of forward progress for dependencies. [US866186 1707] Completed updates to IntegrityMonitor.stateCheck and IntegrityMonitorTest which includes addition of a JUnit for stateCheck and control of the order of JUnit execution. [US865296] ECOMP Policy Logging Compliance, add TargetEntity and TargetServiceName, remove unit from ElapsedTime [US865296] ECOMP Policy Logging Compliance, set audit log statuscode to 'COMPLETE' instead of N/A [US865296] ECOMP Policy Logging Compliance, remove time unit (seconds and milliseconds) from ElapsedTime for logging compliance [US866186 1707] Cleaned up IntegrityAudit JUnit tests. [US866186 1707] IntegrityMonitor JUnit clean up [US866186 1707] Re-added missing classes that were erroneously deleted. [US865296] - add get/setters and inits for required log fields Change-Id: I76ef4606ed6832ed48eaca68e72839a05c8bc3a8 Signed-off-by: Ralph Straubs <rs8887@att.com>
Diffstat (limited to 'integrity-audit/src/test/java')
-rw-r--r--integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/AuditPeriodTest.java5
-rw-r--r--integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditCompareEntriesTest.java5
-rw-r--r--integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditTest.java5
-rw-r--r--integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbDAOTest.java10
-rw-r--r--integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/IntegrityAuditDesignationTest.java22
5 files changed, 40 insertions, 7 deletions
diff --git a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/AuditPeriodTest.java b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/AuditPeriodTest.java
index 649b71f2..d0c64065 100644
--- a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/AuditPeriodTest.java
+++ b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/AuditPeriodTest.java
@@ -49,6 +49,11 @@ import org.openecomp.policy.common.ia.IntegrityAuditProperties;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
+/*
+ * All JUnits are designed to run in the local development environment
+ * where they have write privileges and can execute time-sensitive
+ * tasks.
+ */
public class AuditPeriodTest {
private static Logger logger = FlexLogger.getLogger(AuditPeriodTest.class);
diff --git a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditCompareEntriesTest.java b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditCompareEntriesTest.java
index f109689d..5b3c7550 100644
--- a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditCompareEntriesTest.java
+++ b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditCompareEntriesTest.java
@@ -51,6 +51,11 @@ import org.openecomp.policy.common.ia.test.jpa.PersonTest;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
+/*
+ * All JUnits are designed to run in the local development environment
+ * where they have write privileges and can execute time-sensitive
+ * tasks.
+ */
public class DbAuditCompareEntriesTest {
private static Logger logger = FlexLogger.getLogger(DbAuditCompareEntriesTest.class);
diff --git a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditTest.java b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditTest.java
index a84281dd..21e3bfab 100644
--- a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditTest.java
+++ b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbAuditTest.java
@@ -55,6 +55,11 @@ import org.openecomp.policy.common.ia.jpa.IntegrityAuditEntity;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
+/*
+ * All JUnits are designed to run in the local development environment
+ * where they have write privileges and can execute time-sensitive
+ * tasks.
+ */
public class DbAuditTest {
private static Logger logger = FlexLogger.getLogger(DbAuditTest.class);
diff --git a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbDAOTest.java b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbDAOTest.java
index 31fd0be6..351fe5f8 100644
--- a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbDAOTest.java
+++ b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/DbDAOTest.java
@@ -22,6 +22,11 @@ package org.openecomp.policy.common.ia.test;
import static org.junit.Assert.*;
+/*
+ * All JUnits are designed to run in the local development environment
+ * where they have write privileges and can execute time-sensitive
+ * tasks.
+ */
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
@@ -49,6 +54,11 @@ import org.openecomp.policy.common.ia.DbDaoTransactionException;
import org.openecomp.policy.common.ia.IntegrityAuditProperties;
import org.openecomp.policy.common.ia.jpa.IntegrityAuditEntity;
+/*
+ * All JUnits are designed to run in the local development environment
+ * where they have write privileges and can execute time-sensitive
+ * tasks.
+ */
public class DbDAOTest {
private static String persistenceUnit;
private static Properties properties;
diff --git a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/IntegrityAuditDesignationTest.java b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/IntegrityAuditDesignationTest.java
index 6eb5fa4e..69936bfe 100644
--- a/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/IntegrityAuditDesignationTest.java
+++ b/integrity-audit/src/test/java/org/openecomp/policy/common/ia/test/IntegrityAuditDesignationTest.java
@@ -51,6 +51,11 @@ import org.openecomp.policy.common.ia.IntegrityAuditProperties;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
+/*
+ * All JUnits are designed to run in the local development environment
+ * where they have write privileges and can execute time-sensitive
+ * tasks.
+ */
public class IntegrityAuditDesignationTest {
private static Logger logger = FlexLogger.getLogger(IntegrityAuditDesignationTest.class);
@@ -58,7 +63,7 @@ public class IntegrityAuditDesignationTest {
/*
* Provides a little cushion for timing events.
*/
- private static int FUDGE_FACTOR = 5000;
+ private static int FUDGE_FACTOR = 15000;
private static String persistenceUnit;
private static Properties properties;
@@ -1028,29 +1033,31 @@ public class IntegrityAuditDesignationTest {
IntegrityAudit integrityAudit3 = new IntegrityAudit(resourceName3, persistenceUnit3, properties3);
// Start audit on pdp1
+ logger.info("testDesignatedNodeDead: Start audit on pdp1");
integrityAudit.startAuditThread();
- // Sleep long enough for pdp1 figure out that it should be auditing and start the audit.
- Thread.sleep(500);
-
// Start the auditing threads on other nodes.
+ logger.info("testDesignatedNodeDead: Start audit on pdp2");
integrityAudit2.startAuditThread();
+ logger.info("testDesignatedNodeDead: Start audit on pdp3");
integrityAudit3.startAuditThread();
- // Sleep long enough to ensure the other two audits have registered.
- Thread.sleep(500);
-
+
// Kill audit on pdp1
+ logger.info("testDesignatedNodeDead: Kill audit on pdp1");
integrityAudit.stopAuditThread();
// Sleep long enough for pdp1 to get stale and pdp2 to take over
+ logger.info("testDesignatedNodeDead: Sleep long enough for pdp1 to get stale and pdp2 to take over");
Thread.sleep(AuditThread.AUDIT_COMPLETION_INTERVAL + FUDGE_FACTOR);
// Start audit thread on pdp1 again.
+ logger.info("testDesignatedNodeDead: Start audit thread on pdp1 again.");
integrityAudit.startAuditThread();
// Sleep long enough for pdp2 to complete its audit and get stale, at
// which point pdp3 should take over
+ logger.info("testDesignatedNodeDead: Sleep long enough for pdp2 to complete its audit and get stale, at which point pdp3 should take over");
Thread.sleep((AuditThread.AUDIT_SIMULATION_SLEEP_INTERVAL * AuditThread.AUDIT_SIMULATION_ITERATIONS)
+ AuditThread.AUDIT_COMPLETION_INTERVAL + FUDGE_FACTOR);
@@ -1059,6 +1066,7 @@ public class IntegrityAuditDesignationTest {
integrityAudit3.stopAuditThread();
// Sleep long enough for pdp3 to get stale and pdp1 to take over
+ logger.info("testDesignatedNodeDead: Sleep long enough for pdp3 to get stale and pdp1 to take over");
Thread.sleep(AuditThread.AUDIT_COMPLETION_INTERVAL + FUDGE_FACTOR);
FileInputStream fstream = new FileInputStream(TEST_LOG);