[jboss-cvs] JBossAS SVN: r63278 - in branches/JBoss_4_0_4_GA_CP/testsuite/src: resources/security/META-INF and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu May 31 12:20:31 EDT 2007


Author: scott.stark at jboss.org
Date: 2007-05-31 12:20:31 -0400 (Thu, 31 May 2007)
New Revision: 63278

Modified:
   branches/JBoss_4_0_4_GA_CP/testsuite/src/main/org/jboss/test/security/test/CustomPrincipalPropagationUnitTestCase.java
   branches/JBoss_4_0_4_GA_CP/testsuite/src/resources/security/META-INF/ejb-jar.xml
   branches/JBoss_4_0_4_GA_CP/testsuite/src/resources/security/META-INF/jboss.xml
   branches/JBoss_4_0_4_GA_CP/testsuite/src/resources/security/service-inf/jaas-test-config.xml
Log:
ASPATCH-156, add CustomPrincipalPropagationUnitTestCase

Modified: branches/JBoss_4_0_4_GA_CP/testsuite/src/main/org/jboss/test/security/test/CustomPrincipalPropagationUnitTestCase.java
===================================================================
--- branches/JBoss_4_0_4_GA_CP/testsuite/src/main/org/jboss/test/security/test/CustomPrincipalPropagationUnitTestCase.java	2007-05-31 16:06:01 UTC (rev 63277)
+++ branches/JBoss_4_0_4_GA_CP/testsuite/src/main/org/jboss/test/security/test/CustomPrincipalPropagationUnitTestCase.java	2007-05-31 16:20:31 UTC (rev 63278)
@@ -126,7 +126,7 @@
 
       String response = formPost.getStatusText();
       log.debug("responseCode="+responseCode+", response="+response);
-      assertTrue("Saw HTTP_MOVED_TEMP", responseCode == HttpURLConnection.HTTP_MOVED_TEMP);
+      assertEquals("Saw HTTP_MOVED_TEMP", HttpURLConnection.HTTP_MOVED_TEMP, responseCode);
 
       //  Follow the redirect to the index.jsp
       Header location = formPost.getResponseHeader("Location");
@@ -136,7 +136,7 @@
             war1Index, state);
       response = war1Index.getStatusText();
       log.debug("responseCode="+responseCode+", response="+response);
-      assertTrue("Get OK", responseCode == HttpURLConnection.HTTP_OK);
+      assertEquals("Get OK", HttpURLConnection.HTTP_OK, responseCode);
       body = war1Index.getResponseBodyAsString();
       log.debug("Final result obtained:"+body);
       if( body.indexOf("j_security_check") > 0 )

Modified: branches/JBoss_4_0_4_GA_CP/testsuite/src/resources/security/META-INF/ejb-jar.xml
===================================================================
--- branches/JBoss_4_0_4_GA_CP/testsuite/src/resources/security/META-INF/ejb-jar.xml	2007-05-31 16:06:01 UTC (rev 63277)
+++ branches/JBoss_4_0_4_GA_CP/testsuite/src/resources/security/META-INF/ejb-jar.xml	2007-05-31 16:20:31 UTC (rev 63278)
@@ -25,6 +25,16 @@
          <session-type>Stateless</session-type>
          <transaction-type>Container</transaction-type>
       </session>
+
+      <session>
+         <description>A secured project repository stateful session bean</description>
+         <ejb-name>CustomPrincipalPropagation</ejb-name>
+         <home>org.jboss.test.security.interfaces.CustomPrincipalHome</home>
+         <remote>org.jboss.test.security.interfaces.CustomPrincipal</remote>
+         <ejb-class>org.jboss.test.security.ejb.CustomPrincipalBean</ejb-class>
+         <session-type>Stateless</session-type>
+         <transaction-type>Container</transaction-type>
+      </session>
    </enterprise-beans>
 
    <assembly-descriptor>
@@ -45,6 +55,10 @@
             <ejb-name>CustomPrincipal2</ejb-name>
             <method-name>*</method-name>
          </method>
+         <method>
+            <ejb-name>CustomPrincipalPropagation</ejb-name>
+            <method-name>*</method-name>
+         </method>
       </method-permission>
    </assembly-descriptor>
 

Modified: branches/JBoss_4_0_4_GA_CP/testsuite/src/resources/security/META-INF/jboss.xml
===================================================================
--- branches/JBoss_4_0_4_GA_CP/testsuite/src/resources/security/META-INF/jboss.xml	2007-05-31 16:06:01 UTC (rev 63277)
+++ branches/JBoss_4_0_4_GA_CP/testsuite/src/resources/security/META-INF/jboss.xml	2007-05-31 16:20:31 UTC (rev 63278)
@@ -18,6 +18,12 @@
          <jndi-name>jaas.CustomPrincipal2Home</jndi-name>
          <configuration-name>CustomLoginModule Session</configuration-name>
       </session>
+
+      <session>
+         <ejb-name>CustomPrincipalPropagation</ejb-name>
+         <jndi-name>jaas.CustomPrincipalPropagation</jndi-name>
+         <configuration-name>CustomLoginModulePropagation Session</configuration-name>
+      </session>
    </enterprise-beans>
 
    <container-configurations>
@@ -25,5 +31,9 @@
          <container-name>CustomLoginModule Session</container-name>
          <security-domain>java:/jaas/jaas-test2</security-domain>
       </container-configuration>
+      <container-configuration extends="Standard Stateless SessionBean">
+         <container-name>CustomLoginModulePropagation Session</container-name>
+         <security-domain>java:/jaas/jaas-testpropagation</security-domain>
+      </container-configuration>
    </container-configurations>
 </jboss>

Modified: branches/JBoss_4_0_4_GA_CP/testsuite/src/resources/security/service-inf/jaas-test-config.xml
===================================================================
--- branches/JBoss_4_0_4_GA_CP/testsuite/src/resources/security/service-inf/jaas-test-config.xml	2007-05-31 16:06:01 UTC (rev 63277)
+++ branches/JBoss_4_0_4_GA_CP/testsuite/src/resources/security/service-inf/jaas-test-config.xml	2007-05-31 16:20:31 UTC (rev 63278)
@@ -31,4 +31,18 @@
       </authentication>
    </application-policy>
 
+   <application-policy name = "jaas-testpropagation">
+      <authentication>
+         <login-module code = "org.jboss.test.security.ejb.CustomPrincipalLoginModule"
+            flag = "required">
+            <module-option name = "unauthenticatedIdentity">anonymous</module-option>
+            <module-option name="usersProperties">security/users.properties</module-option>
+            <module-option name="rolesProperties">security/roles.properties</module-option>
+            <module-option name="password-stacking">useFirstPass</module-option>
+         </login-module>
+         <login-module code = "org.jboss.security.ClientLoginModule" flag="required">
+            <module-option name="password-stacking">useFirstPass</module-option>
+         </login-module>
+      </authentication>
+   </application-policy>
 </policy>




More information about the jboss-cvs-commits mailing list