aboutsummaryrefslogtreecommitdiffstats
path: root/utils-test/src/main/java/org/onap/policy/common/utils/time
diff options
context:
space:
mode:
Diffstat (limited to 'utils-test/src/main/java/org/onap/policy/common/utils/time')
-rw-r--r--utils-test/src/main/java/org/onap/policy/common/utils/time/PseudoScheduledExecutorService.java9
-rw-r--r--utils-test/src/main/java/org/onap/policy/common/utils/time/PseudoScheduledFuture.java8
-rw-r--r--utils-test/src/main/java/org/onap/policy/common/utils/time/TestTime.java12
3 files changed, 8 insertions, 21 deletions
diff --git a/utils-test/src/main/java/org/onap/policy/common/utils/time/PseudoScheduledExecutorService.java b/utils-test/src/main/java/org/onap/policy/common/utils/time/PseudoScheduledExecutorService.java
index 847b058e..71a24528 100644
--- a/utils-test/src/main/java/org/onap/policy/common/utils/time/PseudoScheduledExecutorService.java
+++ b/utils-test/src/main/java/org/onap/policy/common/utils/time/PseudoScheduledExecutorService.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2021 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.
@@ -31,6 +31,7 @@ import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;
+import lombok.Getter;
/**
* Scheduled executor service that uses {@link TestTimeMulti} to execute its tasks. Note:
@@ -48,6 +49,7 @@ public class PseudoScheduledExecutorService implements ScheduledExecutorService
* {@code True} if {@link #shutdown()} or {@link #shutdownNow()} has been called,
* {@code false} otherwise.
*/
+ @Getter
private boolean shutdown = false;
/**
@@ -80,11 +82,6 @@ public class PseudoScheduledExecutorService implements ScheduledExecutorService
}
@Override
- public boolean isShutdown() {
- return shutdown;
- }
-
- @Override
public boolean isTerminated() {
return isShutdown();
}
diff --git a/utils-test/src/main/java/org/onap/policy/common/utils/time/PseudoScheduledFuture.java b/utils-test/src/main/java/org/onap/policy/common/utils/time/PseudoScheduledFuture.java
index 6ce7bc04..34c756bb 100644
--- a/utils-test/src/main/java/org/onap/policy/common/utils/time/PseudoScheduledFuture.java
+++ b/utils-test/src/main/java/org/onap/policy/common/utils/time/PseudoScheduledFuture.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019, 2021 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.
@@ -39,6 +39,7 @@ class PseudoScheduledFuture<T> extends FutureTask<T> implements RunnableSchedule
/**
* {@code True} if this task is periodic, {@code false} otherwise.
*/
+ @Getter
private final boolean periodic;
/**
@@ -82,11 +83,6 @@ class PseudoScheduledFuture<T> extends FutureTask<T> implements RunnableSchedule
}
@Override
- public boolean isPeriodic() {
- return periodic;
- }
-
- @Override
public void run() {
if (isPeriodic()) {
super.runAndReset();
diff --git a/utils-test/src/main/java/org/onap/policy/common/utils/time/TestTime.java b/utils-test/src/main/java/org/onap/policy/common/utils/time/TestTime.java
index 420021f3..ace19160 100644
--- a/utils-test/src/main/java/org/onap/policy/common/utils/time/TestTime.java
+++ b/utils-test/src/main/java/org/onap/policy/common/utils/time/TestTime.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* Common Utils-Test
* ================================================================================
- * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018-2019, 2021 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.
@@ -22,12 +22,14 @@ package org.onap.policy.common.utils.time;
import java.util.Date;
import java.util.concurrent.atomic.AtomicLong;
+import lombok.NoArgsConstructor;
/**
* "Current" time, when running junit tests. This is intended to be injected into classes
* under test, to replace their {@link CurrentTime} objects. When {@link #sleep(long)} is
* invoked, it simply advances the notion of "current" time and returns immediately.
*/
+@NoArgsConstructor
public class TestTime extends CurrentTime {
/**
@@ -35,14 +37,6 @@ public class TestTime extends CurrentTime {
*/
private AtomicLong tcur = new AtomicLong(System.currentTimeMillis());
- /**
- * Constructor.
- *
- */
- public TestTime() {
- super();
- }
-
@Override
public long getMillis() {
return tcur.get();