tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1141935 - /tomcat/trunk/test/org/apache/catalina/core/TestStandardWrapper.java
Date Fri, 01 Jul 2011 13:41:26 GMT
Author: markt
Date: Fri Jul  1 13:41:25 2011
New Revision: 1141935

URL: http://svn.apache.org/viewvc?rev=1141935&view=rev
Log:
Fix faulty test

Modified:
    tomcat/trunk/test/org/apache/catalina/core/TestStandardWrapper.java

Modified: tomcat/trunk/test/org/apache/catalina/core/TestStandardWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestStandardWrapper.java?rev=1141935&r1=1141934&r2=1141935&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestStandardWrapper.java (original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestStandardWrapper.java Fri Jul  1 13:41:25
2011
@@ -332,8 +332,13 @@ public class TestStandardWrapper extends
 
 
     public static final int BUG51445_THREAD_COUNT = 5;
+    
+    public static CountDownLatch latch = null;
 
     public void testBug51445AddServlet() throws Exception {
+
+        latch = new CountDownLatch(BUG51445_THREAD_COUNT);
+
         Tomcat tomcat = getTomcatInstance();
 
         // Must have a real docBase - just use temp
@@ -358,19 +363,25 @@ public class TestStandardWrapper extends
         }
 
         Set<String> servlets = new HashSet<String>();
+        // Output the result
+        for (int i = 0; i < BUG51445_THREAD_COUNT; i ++) {
+            System.out.println(threads[i].getResult());
+        }
+        
         // Check the result
         for (int i = 0; i < BUG51445_THREAD_COUNT; i ++) {
             String[] results = threads[i].getResult().split(",");
             assertEquals(2, results.length);
             assertEquals("10", results[0]);
-            System.out.println(results[1]);
             assertFalse(servlets.contains(results[1]));
             servlets.add(results[1]);
         }
-
     }
 
     public void testBug51445AddChild() throws Exception {
+        
+        latch = new CountDownLatch(BUG51445_THREAD_COUNT);
+
         Tomcat tomcat = getTomcatInstance();
 
         // Must have a real docBase - just use temp
@@ -398,16 +409,18 @@ public class TestStandardWrapper extends
         }
 
         Set<String> servlets = new HashSet<String>();
+        // Output the result
+        for (int i = 0; i < BUG51445_THREAD_COUNT; i ++) {
+            System.out.println(threads[i].getResult());
+        }
         // Check the result
         for (int i = 0; i < BUG51445_THREAD_COUNT; i ++) {
             String[] results = threads[i].getResult().split(",");
             assertEquals(2, results.length);
             assertEquals("10", results[0]);
-            System.out.println(results[1]);
             assertFalse(servlets.contains(results[1]));
             servlets.add(results[1]);
         }
-
     }
 
     private static class Bug51445Thread extends Thread {
@@ -443,9 +456,6 @@ public class TestStandardWrapper extends
 
         private static final long serialVersionUID = 1L;
 
-        private static final CountDownLatch latch =
-            new CountDownLatch(BUG51445_THREAD_COUNT);
-
         private int data = 0;
 
         @Override



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message