[jboss-cvs] JBossAS SVN: r82466 - in projects/ejb3/trunk/testsuite/src/test: java/org/jboss/ejb3/test/ejbthree973/unit and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Dec 22 07:57:20 EST 2008
Author: wolfc
Date: 2008-12-22 07:57:19 -0500 (Mon, 22 Dec 2008)
New Revision: 82466
Modified:
projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/ejbthree973/SpyAllowedBean.java
projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/ejbthree973/unit/AnonymousCallerPrincipalTestCase.java
projects/ejb3/trunk/testsuite/src/test/resources/known-issues.xml
Log:
EJBTHREE-1651: known issue
Modified: projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/ejbthree973/SpyAllowedBean.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/ejbthree973/SpyAllowedBean.java 2008-12-22 12:17:04 UTC (rev 82465)
+++ projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/ejbthree973/SpyAllowedBean.java 2008-12-22 12:57:19 UTC (rev 82466)
@@ -21,9 +21,11 @@
*/
package org.jboss.ejb3.test.ejbthree973;
+import javax.annotation.Resource;
import javax.annotation.security.RolesAllowed;
import javax.ejb.EJB;
import javax.ejb.Remote;
+import javax.ejb.SessionContext;
import javax.ejb.Stateless;
import org.jboss.ejb3.annotation.SecurityDomain;
@@ -40,6 +42,9 @@
@RolesAllowed("Spy")
public class SpyAllowedBean implements SpyMe
{
+ @Resource
+ private SessionContext ctx;
+
@EJB(beanName="WhoAmIBean")
private WhoAmI whoAmIBean;
@@ -51,7 +56,16 @@
@RolesAllowed("nobody")
public void notAllowed()
{
- throw new RuntimeException("should not come here");
+ String me;
+ try
+ {
+ me = ctx.getCallerPrincipal().getName();
+ }
+ catch(Exception e)
+ {
+ me = "<error: " + e.getMessage() + ">";
+ }
+ throw new RuntimeException(me + " should not come here");
}
}
Modified: projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/ejbthree973/unit/AnonymousCallerPrincipalTestCase.java
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/ejbthree973/unit/AnonymousCallerPrincipalTestCase.java 2008-12-22 12:17:04 UTC (rev 82465)
+++ projects/ejb3/trunk/testsuite/src/test/java/org/jboss/ejb3/test/ejbthree973/unit/AnonymousCallerPrincipalTestCase.java 2008-12-22 12:57:19 UTC (rev 82466)
@@ -22,6 +22,7 @@
package org.jboss.ejb3.test.ejbthree973.unit;
import javax.ejb.EJBAccessException;
+import javax.ejb.EJBTransactionRolledbackException;
import javax.jms.DeliveryMode;
import javax.jms.MessageConsumer;
import javax.jms.Queue;
@@ -35,8 +36,6 @@
import org.jboss.ejb3.test.ejbthree973.SpyMe;
import org.jboss.ejb3.test.ejbthree973.WhoAmI;
-import org.jboss.security.SecurityAssociation;
-import org.jboss.security.SimplePrincipal;
import org.jboss.security.client.SecurityClient;
import org.jboss.security.client.SecurityClientFactory;
import org.jboss.test.JBossTestCase;
@@ -86,7 +85,7 @@
}
finally
{
- client.setSimple(null, null);
+ client.logout();
}
}
@@ -133,6 +132,13 @@
{
// this is good
}
+ catch(EJBTransactionRolledbackException e)
+ {
+ Throwable t = e.getCause();
+ if(t != null && t instanceof RuntimeException)
+ fail(t.getMessage());
+ throw e;
+ }
String actual = bean.getCallerPrincipal();
// "anonymous" is defined in the @SecurityDomain on WhoAmIBean
Modified: projects/ejb3/trunk/testsuite/src/test/resources/known-issues.xml
===================================================================
--- projects/ejb3/trunk/testsuite/src/test/resources/known-issues.xml 2008-12-22 12:17:04 UTC (rev 82465)
+++ projects/ejb3/trunk/testsuite/src/test/resources/known-issues.xml 2008-12-22 12:57:19 UTC (rev 82466)
@@ -24,6 +24,8 @@
<entry key="org.jboss.ejb3.test.dd.mdb.unit.MDBUnitTestCase.testDurableTopic">show</entry>
<!-- EJBTHREE-1634 -->
<entry key="org.jboss.ejb3.test.deployer.unit.DeployerUnitTestCase.testDeployEjb3ExtensionOnly">show</entry>
+ <!-- EJBTHREE-1651 -->
+ <entry key="org.jboss.ejb3.test.ejbthree973.unit.AnonymousCallerPrincipalTestCase.testSpy">show</entry>
<!-- EJBTHREE-1222 / EJBTHREE-1621 -->
<entry key="org.jboss.ejb3.test.ejbthree1222.unit.RegularRemoveMethodUnitTestCase.testRemoteNormalMethodNamedRemove">show</entry>
<entry key="org.jboss.ejb3.test.ejbthree1222.unit.RegularRemoveMethodUnitTestCase.testLocalNormalMethodNamedRemove">show</entry>
More information about the jboss-cvs-commits
mailing list