Fix Eclipse warnings in unit tests
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 8 Sep 2011 15:39:11 +0000 (15:39 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 8 Sep 2011 15:39:11 +0000 (15:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1166757 13f79535-47bb-0310-9956-ffa450edef68

test/org/apache/catalina/comet/TestCometProcessor.java
test/org/apache/catalina/connector/TestMaxConnections.java
test/org/apache/catalina/session/Benchmarks.java

index e369552..c73ceba 100644 (file)
@@ -30,6 +30,7 @@ import javax.servlet.http.HttpSession;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
 import org.junit.Test;
@@ -160,6 +161,7 @@ public class TestCometProcessor extends TomcatBaseTest {
         // Write should trigger an exception once the connector stops since the
         // socket should be closed
         assertNotNull(writeThread.getException());
+        assertNull(readThread.getException());
     }
 
     private boolean isCometSupported() {
index c9b45ca..5723b02 100644 (file)
@@ -60,7 +60,7 @@ public class TestMaxConnections extends TomcatBaseTest {
         }
         
         assertTrue("The number of successful requests should have been 4-5, actual "+passcount,4==passcount || 5==passcount);
-        
+        System.out.println("There were [" + connectfail + "] connection failures");
     }
 
     private static class ConnectThread extends Thread {
index 9376dba..1e6c545 100644 (file)
@@ -152,7 +152,7 @@ public class Benchmarks {
      * 16 threads - ~45,600ms
      */
     @Test
-    public void testManagerBaseCreateSession() throws LifecycleException {
+    public void testManagerBaseCreateSession() {
         doTestManagerBaseCreateSession(1, 1000000);
         doTestManagerBaseCreateSession(2, 1000000);
         doTestManagerBaseCreateSession(4, 1000000);
@@ -163,8 +163,8 @@ public class Benchmarks {
     }
     
     
-    private void doTestManagerBaseCreateSession(int threadCount, int iterCount)
-            throws LifecycleException {
+    private void doTestManagerBaseCreateSession(int threadCount,
+            int iterCount) {
 
         // Create a default session manager
         StandardManager mgr = new StandardManager();