From 1ff3457738007037364a103c28836d582098f764 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Tue, 27 Nov 2018 15:15:57 -0500 Subject: Remove Factory from IntegrityMonitor Also removed unneeded method override in junit test. Change-Id: I7186e9f75443f7b8ba8376aa0e00a5cf4c573696 Issue-ID: POLICY-1287 Signed-off-by: Jim Hahn --- .../onap/policy/common/im/IntegrityMonitorTest.java | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java') diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java index 3c4fba23..862552b8 100644 --- a/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java +++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java @@ -21,7 +21,6 @@ package org.onap.policy.common.im; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; import java.util.Date; @@ -37,7 +36,6 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import org.onap.policy.common.im.IntegrityMonitor.Factory; import org.onap.policy.common.im.jpa.ForwardProgressEntity; import org.onap.policy.common.im.jpa.ResourceRegistrationEntity; import org.onap.policy.common.im.jpa.StateManagementEntity; @@ -110,11 +108,6 @@ public class IntegrityMonitorTest extends IntegrityMonitorTestBase { super.tearDownTest(); } - - @Test - public void testFactory() { - assertNotNull(getSavedFactory()); - } /* * The following test verifies the following test cases: New Install New Install - Bad @@ -917,10 +910,11 @@ public class IntegrityMonitorTest extends IntegrityMonitorTestBase { monitorSem = new Semaphore(0); junitSem = new Semaphore(0); - - Factory factory = new TestFactory() { + + IntegrityMonitor im = new IntegrityMonitor(resourceName, myProp) { + @Override - public void runStarted() throws InterruptedException { + protected void runStarted() throws InterruptedException { monitorSem.acquire(); junitSem.release(); @@ -928,15 +922,13 @@ public class IntegrityMonitorTest extends IntegrityMonitorTestBase { } @Override - public void monitorCompleted() throws InterruptedException { + protected void monitorCompleted() throws InterruptedException { junitSem.release(); monitorSem.acquire(); } }; - - Whitebox.setInternalState(IntegrityMonitor.class, FACTORY_FIELD, factory); - IntegrityMonitor im = IntegrityMonitor.getInstance(resourceName, myProp); + Whitebox.setInternalState(IntegrityMonitor.class, IM_INSTANCE_FIELD, im); // wait for the monitor thread to start waitCycles(1); -- cgit 1.2.3-korg