User: starksm
Date: 01/10/05 00:23:05
Modified: src/main/org/jboss/test/web/test Tag: Branch_2_4
TestWebIntegration.java
Log:
Remove the ejb interfaces from the web war.
Updated the access failures tests to assert that the error code was
a 401 so that a client browser would attempt a login.
Revision Changes Path
No revision
No revision
1.7.2.5 +32 -3
jbosstest/src/main/org/jboss/test/web/test/Attic/TestWebIntegration.java
Index: TestWebIntegration.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/web/test/Attic/TestWebIntegration.java,v
retrieving revision 1.7.2.4
retrieving revision 1.7.2.5
diff -u -r1.7.2.4 -r1.7.2.5
--- TestWebIntegration.java 2001/09/14 17:56:01 1.7.2.4
+++ TestWebIntegration.java 2001/10/05 07:23:05 1.7.2.5
@@ -25,14 +25,15 @@
The secure access tests require a user named 'jduke' with a password of 'theduke'
with a role of 'AuthorizedUser' in the servlet container.
- @author [EMAIL PROTECTED]
- @version $Revision: 1.7.2.4 $
+ @author [EMAIL PROTECTED]
+ @version $Revision: 1.7.2.5 $
*/
public class TestWebIntegration extends TestCase
{
private static boolean setUp;
private static boolean webServerAvailable;
private static String baseURL;
+ private static Integer port;
public TestWebIntegration(String name)
{
@@ -48,7 +49,7 @@
return;
setUp = true;
- Integer port = Integer.getInteger("web.port", 8080);
+ port = Integer.getInteger("web.port", 8080);
baseURL = "http://jduke:theduke@localhost:" + port + '/';
try
{
@@ -163,6 +164,29 @@
URL url = new URL(baseURL+"jbosstest/restricted/SecureServlet");
accessURL(url);
}
+ /** Access the http://localhost/jbosstest/restricted/SecureServlet
+ */
+ public void testSecureServletWithBadPass() throws Exception
+ {
+ if( webServerAvailable == false )
+ return;
+
+ String baseURL = "http://jduke:badpass@localhost:" + port + '/';
+ URL url = new URL(baseURL+"jbosstest/restricted/SecureServlet");
+ accessURL(url, true);
+ }
+ /** Access the http://localhost/jbosstest/restricted/SecureServlet
+ */
+ public void testSecureServletWithNoLogin() throws Exception
+ {
+ if( webServerAvailable == false )
+ return;
+
+ String baseURL = "http://localhost:" + port + '/';
+ URL url = new URL(baseURL+"jbosstest/restricted/SecureServlet");
+ accessURL(url, true);
+ }
+
/** Access the http://localhost/jbosstest/restricted/SecureEJBAccess
*/
public void testSecureEJBAccess() throws Exception
@@ -213,6 +237,11 @@
System.out.println(content);
if( shouldFail == false )
fail("Access to: "+url+" failed with responseCode="+responseCode);
+ else
+ {
+ // Validate that we are seeing a 401 error
+ assert("Error code 401, actual="+responseCode, responseCode ==
HttpURLConnection.HTTP_UNAUTHORIZED);
+ }
}
}
catch(IOException e)
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development