[jboss-cvs] JBossAS SVN: r64796 - trunk/ejb3/src/test/org/jboss/ejb3/test/stateless/unit.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 23 01:41:55 EDT 2007


Author: anil.saldhana at jboss.com
Date: 2007-08-23 01:41:55 -0400 (Thu, 23 Aug 2007)
New Revision: 64796

Modified:
   trunk/ejb3/src/test/org/jboss/ejb3/test/stateless/unit/StatelessTestCase.java
Log:
fix the principal that is seen to be the unauthenticatedIdentity at the security domain level rather than the initial caller context, because a run-as annotation does a security context switch and any run-as principal that is configured becomes the caller principal

Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/stateless/unit/StatelessTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/stateless/unit/StatelessTestCase.java	2007-08-23 05:26:30 UTC (rev 64795)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/stateless/unit/StatelessTestCase.java	2007-08-23 05:41:55 UTC (rev 64796)
@@ -62,7 +62,12 @@
       assertEquals("somebody", principal);
       
       principal = runAs.getCheckedCallerPrincipal();
-      assertEquals("somebody", principal);
+      /** Because a run-as annotation would switch the caller context. So unless
+       * a run as principal is configured by the bean provider, an anonymous
+       * caller principal is seen.
+       */
+      //assertEquals("somebody", principal);
+      assertEquals("anonymous", principal);
    }
    
    public void testStatelessLocal() throws Exception




More information about the jboss-cvs-commits mailing list