Package org.jboss.ejb3.core.test.ejbthree1646

Examples of org.jboss.ejb3.core.test.ejbthree1646.SecuredLocal.whoAmI()


      SecuredLocal bean = lookup("SecuredBean/local", SecuredLocal.class);
     
      SecurityContext sc = SecurityContextFactory.createSecurityContext("test");
      SecurityContextAssociation.setSecurityContext(sc);
     
      assertEquals("nobody", bean.whoAmI());
     
      try
      {
         bean.onlyAdmin();
         fail("Should have thrown EJBAccessException");
View Full Code Here


   {
      SecuredLocal bean = lookup("SecuredBean/local", SecuredLocal.class);
     
      login("Admin", null);
     
      String me = bean.whoAmI();
      assertEquals("Admin", me);
     
      bean.onlyAdmin();
   }
  
View Full Code Here

     
      SecurityContext sc = login("Invalid", null);
     
      try
      {
         bean.whoAmI();
         fail("Should have thrown EJBAccessException");
      }
      catch(EJBAccessException e)
      {
         // good
View Full Code Here

   @Test
   public void testCallingInterceptorWithNullSecurityContext() throws Exception
   {
      SecuredLocal bean = lookup("SecuredBean/local", SecuredLocal.class);
     
      assertEquals("nobody", bean.whoAmI());

      bean.permitAll();
     
      try
      {
View Full Code Here

     
      SecurityContext sc = login("Invalid", null);
     
      try
      {
         bean.whoAmI();
         fail("Should have thrown EJBAccessException");
      }
      catch(EJBAccessException e)
      {
         // good
View Full Code Here

      SecuredLocal bean = lookup("SecuredBean/local", SecuredLocal.class);
     
      SecurityContext sc = SecurityContextFactory.createSecurityContext("test");
      SecurityContextAssociation.setSecurityContext(sc);
     
      assertEquals("nobody", bean.whoAmI());
     
      try
      {
         bean.onlyAdmin();
         fail("Should have thrown EJBAccessException");
View Full Code Here

   {
      SecuredLocal bean = lookup("SecuredBean/local", SecuredLocal.class);
     
      login("Admin", null);
     
      String me = bean.whoAmI();
      assertEquals("Admin", me);
     
      bean.onlyAdmin();
   }
  
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.