X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=common%2Futil%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Futil%2Fconcurrent%2FThreadPoolExecutorTest.java;h=3042e8457d149ed7174a3d6b74536629117125a8;hb=3680e198a70129fafa634eeb3fb49e8401fff010;hp=05c4abd0f0c0862ed4c27f04e398f2cf9edc8dc6;hpb=cb78a57fc8af07c86e02ba3bfcdb39fdf1f57131;p=yangtools.git diff --git a/common/util/src/test/java/org/opendaylight/yangtools/util/concurrent/ThreadPoolExecutorTest.java b/common/util/src/test/java/org/opendaylight/yangtools/util/concurrent/ThreadPoolExecutorTest.java index 05c4abd0f0..3042e8457d 100644 --- a/common/util/src/test/java/org/opendaylight/yangtools/util/concurrent/ThreadPoolExecutorTest.java +++ b/common/util/src/test/java/org/opendaylight/yangtools/util/concurrent/ThreadPoolExecutorTest.java @@ -71,10 +71,10 @@ public class ThreadPoolExecutorTest { @Test(expected = RejectedExecutionException.class) public void testCachedThreadRejectingTask() throws InterruptedException { - ExecutorService executor = SpecialExecutors.newBoundedCachedThreadPool(1, 1, "TestPool"); + ExecutorService localExecutor = SpecialExecutors.newBoundedCachedThreadPool(1, 1, "TestPool"); for (int i = 0; i < 5; i++) { - executor.execute(new Task(null, null, null, null, TimeUnit.MICROSECONDS.convert(5, TimeUnit.SECONDS))); + localExecutor.execute(new Task(null, null, null, null, TimeUnit.MICROSECONDS.convert(5, TimeUnit.SECONDS))); } } @@ -83,12 +83,12 @@ public class ThreadPoolExecutorTest { testThreadPoolExecution(SpecialExecutors.newBlockingBoundedCachedThreadPool(2, 1, "TestPool"), 1000, null, 10); } - void testThreadPoolExecution(final ExecutorService executor, final int numTasksToRun, final String expThreadPrefix, - final long taskDelay) throws InterruptedException { + void testThreadPoolExecution(final ExecutorService executorToTest, final int numTasksToRun, + final String expThreadPrefix, final long taskDelay) throws InterruptedException { - this.executor = executor; + this.executor = executorToTest; - LOG.debug("Testing {} with {} tasks.", executor.getClass().getSimpleName(), numTasksToRun); + LOG.debug("Testing {} with {} tasks.", executorToTest.getClass().getSimpleName(), numTasksToRun); final CountDownLatch tasksRunLatch = new CountDownLatch(numTasksToRun); final ConcurrentMap taskCountPerThread = new ConcurrentHashMap<>(); @@ -104,7 +104,7 @@ public class ThreadPoolExecutorTest { // Uninterruptibles.sleepUninterruptibly(20, TimeUnit.MICROSECONDS); // } - executor.execute(new Task(tasksRunLatch, taskCountPerThread, threadError, expThreadPrefix, + executorToTest.execute(new Task(tasksRunLatch, taskCountPerThread, threadError, expThreadPrefix, taskDelay)); } } @@ -127,7 +127,7 @@ public class ThreadPoolExecutorTest { LOG.debug(" {} - {} tasks", e.getKey().getName(), e.getValue()); } - LOG.debug("{}", executor); + LOG.debug("{}", executorToTest); LOG.debug("Elapsed time: {}", stopWatch); }