tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1173096 - /tomcat/trunk/test/org/apache/catalina/comet/TestCometProcessor.java
Date Tue, 20 Sep 2011 11:54:44 GMT
Author: markt
Date: Tue Sep 20 11:54:44 2011
New Revision: 1173096

URL: http://svn.apache.org/viewvc?rev=1173096&view=rev
Log:
Revert accidental commit

Modified:
    tomcat/trunk/test/org/apache/catalina/comet/TestCometProcessor.java

Modified: tomcat/trunk/test/org/apache/catalina/comet/TestCometProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/comet/TestCometProcessor.java?rev=1173096&r1=1173095&r2=1173096&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/comet/TestCometProcessor.java (original)
+++ tomcat/trunk/test/org/apache/catalina/comet/TestCometProcessor.java Tue Sep 20 11:54:44
2011
@@ -124,7 +124,6 @@ public class TestCometProcessor extends 
 
         // Setup Tomcat instance
         Tomcat tomcat = getTomcatInstance();
-        tomcat.getConnector().setAttribute("connectionTimeout", "200000");
         Context root = tomcat.addContext("", TEMP_DIR);
         Tomcat.addServlet(root, "comet", new SimpleCometServlet());
         root.addServletMapping("/", "comet");
@@ -133,8 +132,7 @@ public class TestCometProcessor extends 
         // Create connection to Comet servlet
         final Socket socket =
             SocketFactory.getDefault().createSocket("localhost", getPort());
-        socket.setSoTimeout(100000);
-        System.out.println(socket.getLocalPort());
+        socket.setSoTimeout(10000);
         
         final OutputStream os = socket.getOutputStream();
         String requestLine = "POST http://localhost:" + getPort() +
@@ -162,12 +160,7 @@ public class TestCometProcessor extends 
             Thread.sleep(100);
             count ++;
         }
-        System.out.println("Writer sent " + writeThread.getPingCount() +
-                " pings");
-        if (writeThread.isAlive()) {
-            System.out.println("Writer not stopped");
-        }
-        
+
         // Wait for the read thread to stop
         count = 0;
         while (readThread.isAlive() && count < 100) {
@@ -235,13 +228,12 @@ public class TestCometProcessor extends 
 
     private static class PingWriterThread extends Thread {
         
-        private int maxPingCount;
-        private volatile int pingCount;
+        private int pingCount;
         private OutputStream os;
         private volatile Exception e = null;
 
-        public PingWriterThread(int maxPingCount, OutputStream os) {
-            this.maxPingCount = maxPingCount;
+        public PingWriterThread(int pingCount, OutputStream os) {
+            this.pingCount = pingCount;
             this.os = os;
         }
 
@@ -249,14 +241,10 @@ public class TestCometProcessor extends 
             return e;
         }
 
-        public int getPingCount() {
-            return pingCount;
-        }
-
         @Override
         public void run() {
             try {
-                for (pingCount = 0; pingCount < maxPingCount; pingCount++) {
+                for (int i = 0; i < pingCount; i++) {
                     os.write("4\r\n".getBytes());
                     os.write("PING\r\n".getBytes());
                     os.flush();



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


Mime
View raw message