Checkstyle clean up about 200 trivial violation
[yangtools.git] / common / util / src / test / java / org / opendaylight / yangtools / util / concurrent / ThreadPoolExecutorTest.java
index c9b3dab1886c687d82f892873bbfb5fe99fd29f4..44f90f9884d927df4a20fb939a4ecb4e000334c1 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.yangtools.util.concurrent;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
+import com.google.common.base.Stopwatch;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
@@ -19,12 +20,9 @@ import java.util.concurrent.RejectedExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReference;
-
 import org.junit.After;
 import org.junit.Test;
 
-import com.google.common.base.Stopwatch;
-
 /**
  * Tests various ThreadPoolExecutor implementations.
  *
@@ -49,7 +47,7 @@ public class ThreadPoolExecutorTest {
                 100000, "TestPool", 0 );
     }
 
-    @Test(expected=RejectedExecutionException.class)
+    @Test(expected = RejectedExecutionException.class)
     public void testFastThreadPoolRejectingTask() throws Exception {
 
         executor = SpecialExecutors.newBoundedFastThreadPool( 1, 1, "TestPool" );
@@ -77,7 +75,7 @@ public class ThreadPoolExecutorTest {
                 100000, "TestPool", 0 );
     }
 
-    @Test(expected=RejectedExecutionException.class)
+    @Test(expected = RejectedExecutionException.class)
     public void testCachedThreadRejectingTask() throws Exception {
 
         ExecutorService executor = SpecialExecutors.newBoundedCachedThreadPool( 1, 1, "TestPool" );
@@ -101,8 +99,7 @@ public class ThreadPoolExecutorTest {
 
         this.executor = executor;
 
-        System.out.println( "\nTesting " + executor.getClass().getSimpleName() + " with " +
-                numTasksToRun + " tasks." );
+        System.out.println("\nTesting " + executor.getClass().getSimpleName() + " with " + numTasksToRun + " tasks.");
 
         final CountDownLatch tasksRunLatch = new CountDownLatch( numTasksToRun );
         final ConcurrentMap<Thread, AtomicLong> taskCountPerThread = new ConcurrentHashMap<>();
@@ -129,8 +126,7 @@ public class ThreadPoolExecutorTest {
         stopWatch.stop();
 
         if (!done) {
-            fail( (numTasksToRun - tasksRunLatch.getCount()) + " tasks out of " +
-                   numTasksToRun + " executed" );
+            fail((numTasksToRun - tasksRunLatch.getCount()) + " tasks out of " + numTasksToRun + " executed");
         }
 
         if (threadError.get() != null) {
@@ -183,7 +179,8 @@ public class ThreadPoolExecutorTest {
                     } else if (blockLatch != null) {
                         blockLatch.await();
                     }
-                } catch( InterruptedException e ) {}
+                } catch (InterruptedException e) {
+                }
 
                 if (expThreadPrefix != null) {
                     assertEquals( "Thread name starts with " + expThreadPrefix, true,
@@ -203,7 +200,7 @@ public class ThreadPoolExecutorTest {
                     count.incrementAndGet();
                 }
 
-            } catch( AssertionError e ) {
+            } catch (AssertionError e) {
                 if (threadError != null) {
                     threadError.set( e );
                 }