larryi 01/07/10 14:13:24 Modified: src/tests/webpages/WEB-INF test-tomcat.xml web.xml Added: src/tests/webpages/aaa login.jsp loginerr.jsp src/tests/webpages/aaa/protected index.jsp Log: Add a test that catches my recent breakage of authorization in the patch for avoiding recursive status errors. Patch for fixing authorization to follow. Also some minor cleanup. Revision Changes Path 1.32 +15 -5 jakarta-tomcat/src/tests/webpages/WEB-INF/test-tomcat.xml Index: test-tomcat.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/tests/webpages/WEB-INF/test-tomcat.xml,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- test-tomcat.xml 2001/05/23 03:28:13 1.31 +++ test-tomcat.xml 2001/07/10 21:13:02 1.32 @@ -16,7 +16,7 @@ early tests. --> - <property name="revision" value="$Revision: 1.31 $" /> + <property name="revision" value="$Revision: 1.32 $" /> <property name="host" value="127.0.0.1" /> <property name="port" value="8080" /> <property name="outputType" value="text" /> @@ -1113,7 +1113,7 @@ </target> - <target name="security_chk"> + <target name="security_chk" depends="init"> <gtest description="This URL should return 404 Not Found" request="GET /test/jsp/HelloWorld.jsp. HTTP/1.0" returnCode="${http.protocol} 404" @@ -1210,7 +1210,7 @@ /> </target> - <target name="writer"> + <target name="writer" depends="init"> <httpClient> <comment>Writer test, closing writer at end</comment> <httpRequest path="/test/servlet/CloseWriter" /> @@ -1219,7 +1219,7 @@ <goldenMatch file="${gdir}/CloseWriter.txt"/> </httpClient> <httpClient> - <comment>Writer test,trying to catch reciclying issues</comment> + <comment>Writer test,trying to catch recycling issues</comment> <httpRequest path="/test/servlet/CloseWriter" /> <httpStatusMatch match="200" /> <headerMatch name="Content-Type" value="text/plain" /> @@ -1227,8 +1227,18 @@ </httpClient> </target> + <target name="aaa" depends="init"> + <httpClient> + <comment>Test for required authorization redirection response</comment> + <httpRequest path="/test/aaa/protected/index.jsp" /> + <httpStatusMatch match="302" /> + <headerMatch name="Location" value="http://${host}:${port}/test/aaa/login.jsp" /> + <responseMatch match="This document has moved" /> + </httpClient> + </target> + <!-- ==================== All targets ==================== --> - <target name="client" depends="file,params,writer,dispatch,get,requestMap,post,wrong_request,restricted,jsp,unavailable,headers,security_chk"> + <target name="client" depends="file,params,writer,dispatch,get,requestMap,post,wrong_request,restricted,jsp,unavailable,headers,security_chk,aaa"> </target> <!-- ==================== Aux targets ==================== --> 1.11 +16 -0 jakarta-tomcat/src/tests/webpages/WEB-INF/web.xml Index: web.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/tests/webpages/WEB-INF/web.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- web.xml 2001/03/11 22:25:46 1.10 +++ web.xml 2001/07/10 21:13:07 1.11 @@ -203,4 +203,20 @@ <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint> + <security-constraint> + <web-resource-collection> + <web-resource-name>Access-Authentication-Authorization Test Area</web-resource-name> + <url-pattern>/aaa/protected/*</url-pattern> + </web-resource-collection> + <auth-constraint> + <role-name>role1</role-name> + </auth-constraint> + </security-constraint> + <login-config> + <auth-method>FORM</auth-method> + <form-login-config> + <form-login-page>/aaa/login.jsp</form-login-page> + <form-error-page>/aaa/loginerr.jsp</form-error-page> + </form-login-config> + </login-config> </web-app> 1.1 jakarta-tomcat/src/tests/webpages/aaa/login.jsp Index: login.jsp =================================================================== <html><body> <form method="POST" action="j_security_check" > Username: <input type="text" name="j_username"><br> Password: <input type="password" name="j_password"><br><br> <input type="submit" value="login" name="j_security_check"> </form> </body></html> 1.1 jakarta-tomcat/src/tests/webpages/aaa/loginerr.jsp Index: loginerr.jsp =================================================================== <html><body> <p>Login failed</p> </body></html> 1.1 jakarta-tomcat/src/tests/webpages/aaa/protected/index.jsp Index: index.jsp =================================================================== <html><body> <p>This page is protected</p> </body></html>