diff options
author | Jim Hahn <jrh3@att.com> | 2018-11-27 15:15:57 -0500 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2018-11-27 15:17:07 -0500 |
commit | 1ff3457738007037364a103c28836d582098f764 (patch) | |
tree | b8a9b146aee6178079b7bb60fe6d341fda12e5a7 /integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java | |
parent | dc569fec077a6d6acce415925685699d5907cd2d (diff) |
Remove Factory from IntegrityMonitor
Also removed unneeded method override in junit test.
Change-Id: I7186e9f75443f7b8ba8376aa0e00a5cf4c573696
Issue-ID: POLICY-1287
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java')
-rw-r--r-- | integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java | 20 |
1 files changed, 6 insertions, 14 deletions
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); |