aboutsummaryrefslogtreecommitdiffstats
path: root/integrity-monitor/src/test/java/org/onap/policy/common/im/MonitorTimeTest.java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2018-06-21 15:43:32 -0400
committerJim Hahn <jrh3@att.com>2018-06-21 16:13:19 -0400
commit37b7d29aa5b61127a794d356eaa3db87c9348a69 (patch)
tree115022fbb5c02e99aeaf2a96e0eb8060ab2531d9 /integrity-monitor/src/test/java/org/onap/policy/common/im/MonitorTimeTest.java
parent88116de291b4200b0d4dfbdfce492d009293dad8 (diff)
IntegrityMonitor: 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. Update license date. Remove unneeded dependency from pom. Don't start FpManager thread within its own constructor. toMillis() should handle -1 as an input. Fix comment in test base superclass. Change time units in test base from DAYS to MILLISECONDS. Change-Id: Id6a4edb1747ca1a683e5d37522872b781294532d Issue-ID: POLICY-908 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'integrity-monitor/src/test/java/org/onap/policy/common/im/MonitorTimeTest.java')
-rw-r--r--integrity-monitor/src/test/java/org/onap/policy/common/im/MonitorTimeTest.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/MonitorTimeTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/MonitorTimeTest.java
new file mode 100644
index 00000000..5f20a831
--- /dev/null
+++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/MonitorTimeTest.java
@@ -0,0 +1,40 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Integrity Monitor
+ * ================================================================================
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.common.im;
+
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.onap.policy.common.utils.time.CurrentTime;
+
+/**
+ *
+ */
+public class MonitorTimeTest {
+
+ @Test
+ public void testGetInstance() {
+ CurrentTime inst = MonitorTime.getInstance();
+ assertNotNull(inst);
+
+ assertEquals(inst, MonitorTime.getInstance());
+ }
+
+}