[jboss-cvs] JBossAS SVN: r66611 - in branches/Branch_4_2/testsuite: imports/sections and 4 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Oct 31 10:18:22 EDT 2007


Author: sguilhen at redhat.com
Date: 2007-10-31 10:18:22 -0400 (Wed, 31 Oct 2007)
New Revision: 66611

Modified:
   branches/Branch_4_2/testsuite/build.xml
   branches/Branch_4_2/testsuite/imports/sections/web.xml
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/web/test/WebProgrammaticLoginTestCase.java
   branches/Branch_4_2/testsuite/src/resources/test-configs/tomcat-sso/deploy/jboss-web.deployer/server.xml
   branches/Branch_4_2/testsuite/src/resources/web/programmatic/WEB-INF/jboss-web.xml
   branches/Branch_4_2/testsuite/src/resources/web/programmatic/application.xml
Log:
JBAS-4424: Enhanced the WebProgrammaticLoginTestCase to test the SSO capabilities that were added to the WebAuthentication class. This included moving the test case to the tomcat-sso-tests group.



Modified: branches/Branch_4_2/testsuite/build.xml
===================================================================
--- branches/Branch_4_2/testsuite/build.xml	2007-10-31 13:35:05 UTC (rev 66610)
+++ branches/Branch_4_2/testsuite/build.xml	2007-10-31 14:18:22 UTC (rev 66611)
@@ -575,7 +575,6 @@
     <include name="**/test/jmx/test/Secure*TestCase.class"/>
     <include name="**/test/perf/test/SecurePerfStressTestCase.class"/>
     <include name="**/test/timer/test/SecureTimerUnitTestCase.class"/>
-    <include name="**/test/web/test/WebProgrammaticLoginTestCase.class"/>
   </patternset>
   <patternset id="security.excludes">
     <exclude name="**/test/naming/test/Security*"/>
@@ -604,9 +603,11 @@
   <!-- Tests needing non-clustered tomcat SSO -->
   <patternset id="tc-sso.includes">
     <include name="org/jboss/test/web/test/SingleSignOnUnitTestCase.class"/>
+    <include name="org/jboss/test/web/test/WebProgrammaticLoginTestCase.class"/>
   </patternset>
   <patternset id="tc-sso.excludes">
     <exclude name="org/jboss/test/web/test/SingleSignOnUnitTestCase.class"/>
+    <exclude name="org/jboss/test/web/test/WebProgrammaticLoginTestCase.class"/>
   </patternset>
   <!-- Tests needing clustered tomcat SSO -->
   <patternset id="tc-sso-clustered.includes">

Modified: branches/Branch_4_2/testsuite/imports/sections/web.xml
===================================================================
--- branches/Branch_4_2/testsuite/imports/sections/web.xml	2007-10-31 13:35:05 UTC (rev 66610)
+++ branches/Branch_4_2/testsuite/imports/sections/web.xml	2007-10-31 14:18:22 UTC (rev 66611)
@@ -560,33 +560,27 @@
             includes="jboss-service.xml"/>
       </zip>
 
-     <!-- JBAS-4077: Programmatic Web Login -->
-    <war destfile="${build.lib}/programmaticweblogin.war"
-       webxml="${build.resources}/web/programmatic/WEB-INF/jbosstest-web.xml">
-         <webinf dir="${build.resources}/web/form-auth">
+      <!-- JBAS-4077: Programmatic Web Login -->
+      <war destfile="${build.lib}/programmaticweblogin.war"
+         webxml="${build.resources}/web/programmatic/WEB-INF/jbosstest-web.xml">
+         <webinf dir="${build.resources}/web/programmatic/WEB-INF">
             <include name="jboss-web.xml"/>
          </webinf>
          <classes dir="${build.classes}">
             <include name="org/jboss/test/web/servlets/Programm*Servlet.class"/>
          </classes>
-    </war>
-    <zip destfile="${build.lib}/programmaticweblogin.ear">
-         <zipfileset dir="${build.resources}/web/form-auth" prefix="META-INF">
-            <include name="jboss-app.xml"/>
-            <include name="security-config.xml"/>
-         </zipfileset>
+      </war>
+      <zip destfile="${build.lib}/programmaticweblogin.ear">
          <zipfileset dir="${build.resources}/web/programmatic" prefix="META-INF">
             <include name="application.xml"/>
          </zipfileset>
-         <zipfileset dir="${build.resources}/web"
-            fullpath="form-auth-users.properties"
-            includes="users.properties"/>
-         <zipfileset dir="${build.resources}/web"
-            fullpath="form-auth-roles.properties"
-            includes="roles.properties"/>
-         <zipfileset dir="${build.lib}" includes="programmatic*.war"/>
-         <zipfileset dir="${build.resources}/web/form-auth"
-            includes="jboss-service.xml"/>
+         <zipfileset dir="${build.resources}/web">
+            <include name="users.properties"/>
+            <include name="roles.properties"/>
+         </zipfileset>
+         <zipfileset dir="${build.lib}" includes="programmaticweblogin.war"/>
+         <zipfileset dir="${build.lib}" includes="sso-form-auth.war"/>
+         <zipfileset dir="${build.lib}" includes="jbosstest-web-ejbs.jar"/>
       </zip>
 
       <!-- JBAS-3162 Root Context Tests -->

Modified: branches/Branch_4_2/testsuite/src/main/org/jboss/test/web/test/WebProgrammaticLoginTestCase.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/web/test/WebProgrammaticLoginTestCase.java	2007-10-31 13:35:05 UTC (rev 66610)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/web/test/WebProgrammaticLoginTestCase.java	2007-10-31 14:18:22 UTC (rev 66611)
@@ -61,7 +61,8 @@
     */
    public void testUnsuccessfulLogin() throws Exception
    {
-      String path1 = "programmaticweblogin/TestServlet";
+      String path1 = "war1/TestServlet";
+      // try to perform programmatic auth without supplying login information.
       HttpMethod indexGet = null;
       try
       {
@@ -69,13 +70,16 @@
          int responseCode = httpConn.executeMethod(indexGet);
          assertTrue("Get Error("+responseCode+")", 
                responseCode == HttpURLConnection.HTTP_INTERNAL_ERROR);
+         // assert access to the second application is not granted, as no successful login
+         // was performed (and therefore no ssoid has been set).
+         SSOBaseCase.checkAccessDenied(this.httpConn, this.baseURLNoAuth + "war2/index.html");
       }
       finally
       {
          if(indexGet != null)
            indexGet.releaseConnection();
       } 
-      
+      // try to perform programmatic auth with no valid username/password.
       path1 = path1 + "?username=dummy&pass=dummy";
       try
       {
@@ -83,6 +87,7 @@
          int responseCode = httpConn.executeMethod(indexGet);
          assertTrue("Get Error("+responseCode+")", 
                responseCode == HttpURLConnection.HTTP_INTERNAL_ERROR);
+         SSOBaseCase.checkAccessDenied(this.httpConn, this.baseURLNoAuth + "war2/index.html");
       }
       finally
       {
@@ -97,13 +102,17 @@
     */
    public void testSuccessfulLogin() throws Exception
    {
-      String path1 = "programmaticweblogin/TestServlet?username=jduke&pass=theduke"; 
+      String path1 = "war1/TestServlet?username=jduke&pass=theduke"; 
       HttpMethod indexGet = null;
       try
       {
          indexGet = new GetMethod(baseURLNoAuth+path1); 
          int responseCode = httpConn.executeMethod(indexGet);
          assertTrue("Get OK("+responseCode+")", responseCode == HttpURLConnection.HTTP_OK);
+         // check the sso cookie has been created
+         SSOBaseCase.processSSOCookie(this.httpConn.getState(), this.baseURLNoAuth, this.baseURLNoAuth);
+         // check that access to the second application is allowed
+         SSOBaseCase.checkAccessAllowed(this.httpConn, this.baseURLNoAuth + "war2/index.html");
       }
       finally
       {

Modified: branches/Branch_4_2/testsuite/src/resources/test-configs/tomcat-sso/deploy/jboss-web.deployer/server.xml
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/test-configs/tomcat-sso/deploy/jboss-web.deployer/server.xml	2007-10-31 13:35:05 UTC (rev 66610)
+++ branches/Branch_4_2/testsuite/src/resources/test-configs/tomcat-sso/deploy/jboss-web.deployer/server.xml	2007-10-31 14:18:22 UTC (rev 66611)
@@ -114,7 +114,7 @@
                               to span more than one hostname.
              -->
             <!-- -->
-            <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
+            <Valve className="org.jboss.web.tomcat.security.ExtendedSingleSignOn" />
             <!-- -->
 
             <!-- Uncomment to enable single sign-on across web apps

Modified: branches/Branch_4_2/testsuite/src/resources/web/programmatic/WEB-INF/jboss-web.xml
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/web/programmatic/WEB-INF/jboss-web.xml	2007-10-31 13:35:05 UTC (rev 66610)
+++ branches/Branch_4_2/testsuite/src/resources/web/programmatic/WEB-INF/jboss-web.xml	2007-10-31 14:18:22 UTC (rev 66611)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jboss-web
+    PUBLIC "-//JBoss//DTD Web Application 2.4//EN"
+    "http://www.jboss.org/j2ee/dtds/jboss-web_4_0.dtd">
+
+<jboss-web>
+   <security-domain>java:/jaas/jbosstest-web</security-domain>
+</jboss-web>

Modified: branches/Branch_4_2/testsuite/src/resources/web/programmatic/application.xml
===================================================================
--- branches/Branch_4_2/testsuite/src/resources/web/programmatic/application.xml	2007-10-31 13:35:05 UTC (rev 66610)
+++ branches/Branch_4_2/testsuite/src/resources/web/programmatic/application.xml	2007-10-31 14:18:22 UTC (rev 66611)
@@ -6,10 +6,20 @@
 <application>
    <display-name>Programmatic Web Login</display-name>
 
-   <module>
-      <web>
-         <web-uri>programmaticweblogin.war</web-uri>
-      </web>
-   </module>
+      <module>
+         <web>
+            <web-uri>programmaticweblogin.war</web-uri>
+            <context-root>/war1</context-root>
+         </web>
+      </module>
+      <module>
+         <web>
+            <web-uri>sso-form-auth.war</web-uri>
+            <context-root>/war2</context-root>
+         </web>
+      </module>
+      <module>
+         <ejb>jbosstest-web-ejbs.jar</ejb>
+      </module>
 
 </application>




More information about the jboss-cvs-commits mailing list