diff options
author | 2018-07-29 16:13:45 +0300 | |
---|---|---|
committer | 2018-07-29 16:20:34 +0300 | |
commit | 5b593496b8f1b8e8be8d7d2dbcc223332e65a49b (patch) | |
tree | 2f9dfc45191e723da69cf74be7829784e9741b94 /catalog-be/src/test/java/org/openecomp/sdc/be/distribution/TestQueue.java | |
parent | 9200382f2ce7b4bb729aa287d0878004b2d2b4f9 (diff) |
re base code
Change-Id: I12a5ca14a6d8a87e9316b9ff362eb131105f98a5
Issue-ID: SDC-1566
Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-be/src/test/java/org/openecomp/sdc/be/distribution/TestQueue.java')
-rw-r--r-- | catalog-be/src/test/java/org/openecomp/sdc/be/distribution/TestQueue.java | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/TestQueue.java b/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/TestQueue.java index 64f66ea232..47e4574e1a 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/TestQueue.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/distribution/TestQueue.java @@ -20,27 +20,18 @@ package org.openecomp.sdc.be.distribution; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import org.openecomp.sdc.be.components.distribution.engine.CambriaHandler; +import org.openecomp.sdc.be.components.distribution.engine.INotificationData; +import org.openecomp.sdc.be.components.distribution.engine.NotificationDataImpl; + import java.util.ArrayList; import java.util.List; import java.util.Timer; import java.util.TimerTask; -import java.util.concurrent.ArrayBlockingQueue; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.SynchronousQueue; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; +import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicBoolean; -import org.openecomp.sdc.be.components.distribution.engine.CambriaHandler; -import org.openecomp.sdc.be.components.distribution.engine.INotificationData; -import org.openecomp.sdc.be.components.distribution.engine.NotificationDataImpl; - -import com.google.common.util.concurrent.ThreadFactoryBuilder; - public class TestQueue { public static void main(String[] args) { @@ -49,7 +40,7 @@ public class TestQueue { ThreadFactory threadFactory = threadFactoryBuilder.build(); // TODO: add the package of google to the pom - ExecutorService executorService = new ThreadPoolExecutor(0, 10, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), threadFactory); + ExecutorService executorService = new ThreadPoolExecutor(0, 10, 60L, TimeUnit.SECONDS, new SynchronousQueue<>(), threadFactory); // ExecutorService executorService = new ThreadPoolExecutor(0, 2, 60L, // TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(20)); @@ -122,7 +113,7 @@ public class TestQueue { @Override public void run() { System.out.println("In running of Timer task"); - if (state.get() == false) { + if (!state.get()) { System.out.println("In running of Timer task. Going to interrupt thread"); // thread.interrupt(); } else { |