diff options
author | Jim Hahn <jrh3@att.com> | 2019-08-19 17:32:09 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2019-08-21 13:49:01 -0400 |
commit | cf0cd76d63f9eba680a6307dd4a708e7169cb403 (patch) | |
tree | 43e761425a3f3944ef52e07703ed5411388b07da /utils-test/src/test/java/org/onap/policy/common/utils/time/TestTimeTest.java | |
parent | 98a4da643c738a4246cc4cc4aa9c9f21ae47cff8 (diff) |
Enhance TestTimeMulti
Enhance TestTimeMulti to support execution of tasks, whether
submitted via Timers or via Executors.
Change-Id: Ib5f216730b3b69028e9581052645370b827cd446
Issue-ID: POLICY-1968
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'utils-test/src/test/java/org/onap/policy/common/utils/time/TestTimeTest.java')
-rw-r--r-- | utils-test/src/test/java/org/onap/policy/common/utils/time/TestTimeTest.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/utils-test/src/test/java/org/onap/policy/common/utils/time/TestTimeTest.java b/utils-test/src/test/java/org/onap/policy/common/utils/time/TestTimeTest.java index 3e7897e9..d2cf6783 100644 --- a/utils-test/src/test/java/org/onap/policy/common/utils/time/TestTimeTest.java +++ b/utils-test/src/test/java/org/onap/policy/common/utils/time/TestTimeTest.java @@ -2,14 +2,14 @@ * ============LICENSE_START======================================================= * Common Utils-Test * ================================================================================ - * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2018-2019 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. @@ -62,6 +62,11 @@ public class TestTimeTest { // ensure that no real time has elapsed assertTrue(System.currentTimeMillis() < treal + tsleep / 2); + + // negative sleep should not modify the time + tcur = tm.getMillis(); + tm.sleep(-1); + assertEquals(tcur, tm.getMillis()); } } |