geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r502731 - /geronimo/server/trunk/modules/geronimo-tomcat6/src/test/java/org/apache/geronimo/tomcat/JAASSecurityTest.java
Date Fri, 02 Feb 2007 20:30:53 GMT
Author: pmcmahan
Date: Fri Feb  2 12:30:52 2007
New Revision: 502731

URL: http://svn.apache.org/viewvc?view=rev&rev=502731
Log:
reenabling a unit test case that was failing intermittently on tomcat 6.0.3.
I cannot recreate the failure on geronimo's current tomcat 6.0.8 driver using
mac or windows.

Modified:
    geronimo/server/trunk/modules/geronimo-tomcat6/src/test/java/org/apache/geronimo/tomcat/JAASSecurityTest.java

Modified: geronimo/server/trunk/modules/geronimo-tomcat6/src/test/java/org/apache/geronimo/tomcat/JAASSecurityTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat6/src/test/java/org/apache/geronimo/tomcat/JAASSecurityTest.java?view=diff&rev=502731&r1=502730&r2=502731
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat6/src/test/java/org/apache/geronimo/tomcat/JAASSecurityTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-tomcat6/src/test/java/org/apache/geronimo/tomcat/JAASSecurityTest.java
Fri Feb  2 12:30:52 2007
@@ -108,47 +108,43 @@
     }
 
     public void testGoodAuthentication() throws Exception {
-	// this test is failing intermittently on tc6.
-	// disabling it for now while investigating if its a bug in the
-	// test case or in tc6.
-	
-//         startWebApp();
-//
-//        //Give the container some time to load the web context
-//        //this is wierd..it only needs to be done on this test
-//        Thread.sleep(5000);
-//
-//        //Begin the test
-//        HttpURLConnection connection = (HttpURLConnection) new URL("http://localhost:8181/test/protected/hello.txt").openConnection();
-//        connection.setInstanceFollowRedirects(false);
-//        assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
-//
-//        //Be sure we have been given the login page
-//        BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
-//        assertEquals("<!-- Login Page -->", reader.readLine());
-//        reader.close();
-//
-//        String cookie = connection.getHeaderField("Set-Cookie");
-//        cookie = cookie.substring(0, cookie.lastIndexOf(';'));
-//        String location = "http://localhost:8181/test/protected/j_security_check?j_username=izumi&j_password=violin";
-//
-//        connection = (HttpURLConnection) new URL(location).openConnection();
-//        connection.setRequestMethod("POST");
-//        connection.setRequestProperty("Referer","http://localhost:8181/test/auth/logon.html?param=test");
-//        connection.setRequestProperty("Cookie", cookie);
-//        connection.setInstanceFollowRedirects(false);
-//        assertEquals(HttpURLConnection.HTTP_MOVED_TEMP, connection.getResponseCode());
-//
-//        connection = (HttpURLConnection) new URL("http://localhost:8181/test/protected/hello.txt").openConnection();
-//        connection.setRequestProperty("Cookie", cookie);
-//        connection.setInstanceFollowRedirects(false);
-//        reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
-//
-//        assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
-//        assertEquals("Hello World", reader.readLine());
-//        connection.disconnect();
-//
-//        stopWebApp();
+         startWebApp();
+
+        //Give the container some time to load the web context
+        //this is wierd..it only needs to be done on this test
+        Thread.sleep(5000);
+
+        //Begin the test
+        HttpURLConnection connection = (HttpURLConnection) new URL("http://localhost:8181/test/protected/hello.txt").openConnection();
+        connection.setInstanceFollowRedirects(false);
+        assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
+
+        //Be sure we have been given the login page
+        BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+        assertEquals("<!-- Login Page -->", reader.readLine());
+        reader.close();
+
+        String cookie = connection.getHeaderField("Set-Cookie");
+        cookie = cookie.substring(0, cookie.lastIndexOf(';'));
+        String location = "http://localhost:8181/test/protected/j_security_check?j_username=izumi&j_password=violin";
+
+        connection = (HttpURLConnection) new URL(location).openConnection();
+        connection.setRequestMethod("POST");
+        connection.setRequestProperty("Referer","http://localhost:8181/test/auth/logon.html?param=test");
+        connection.setRequestProperty("Cookie", cookie);
+        connection.setInstanceFollowRedirects(false);
+        assertEquals(HttpURLConnection.HTTP_MOVED_TEMP, connection.getResponseCode());
+
+        connection = (HttpURLConnection) new URL("http://localhost:8181/test/protected/hello.txt").openConnection();
+        connection.setRequestProperty("Cookie", cookie);
+        connection.setInstanceFollowRedirects(false);
+        reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+
+        assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
+        assertEquals("Hello World", reader.readLine());
+        connection.disconnect();
+
+        stopWebApp();
     }
 
     protected void startWebApp() throws Exception {



Mime
View raw message