User: starksm Date: 02/03/02 22:43:45 Modified: src/main/org/jboss/test/security/test Tag: Branch_2_4 TestEJBSpec.java Log: Add test of getCallerPrincipal in ejbCreate of a stateless session Revision Changes Path No revision No revision 1.6.2.8 +20 -1 jbosstest/src/main/org/jboss/test/security/test/Attic/TestEJBSpec.java Index: TestEJBSpec.java =================================================================== RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/security/test/Attic/TestEJBSpec.java,v retrieving revision 1.6.2.7 retrieving revision 1.6.2.8 diff -u -r1.6.2.7 -r1.6.2.8 --- TestEJBSpec.java 20 Nov 2001 09:20:38 -0000 1.6.2.7 +++ TestEJBSpec.java 3 Mar 2002 06:43:45 -0000 1.6.2.8 @@ -35,7 +35,7 @@ deployment unit. These test the basic role based access model. @author [EMAIL PROTECTED] - @version $Revision: 1.6.2.7 $ + @version $Revision: 1.6.2.8 $ */ public class TestEJBSpec extends TestCase @@ -331,6 +331,25 @@ bean = (StatelessSession) h.getEJBObject(); System.out.println("Obtained bean from handle: "+bean); System.out.println("Bean.echo('Hello') -> "+bean.echo("Hello")); + logout(); + } + + /** Test the use of getCallerPrincipal from within the ejbCreate + */ + public void testCreateCaller() throws Exception + { + System.out.println("+++ testCreateCaller"); + login(); + InitialContext jndiContext = new InitialContext(); + Object obj = jndiContext.lookup("spec.SecureCreateSession"); + obj = PortableRemoteObject.narrow(obj, StatelessSessionHome.class); + StatelessSessionHome home = (StatelessSessionHome) obj; + System.out.println("Found StatelessSessionHome"); + for(int i = 0; i < 1000; i ++) + { + StatelessSession bean = home.create(); + bean.remove(); + } logout(); }
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development