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

Examples of org.jboss.ejb3.core.test.ejbthree1646.SecuredLocal


   }
  
   @Test
   public void testSecurityContextAssociation() throws Exception
   {
      SecuredLocal bean = lookup("SecuredBean/local", SecuredLocal.class);
     
      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
      {
         bean.onlyAdmin();
         fail("Should have thrown EJBAccessException");
      }
      catch(EJBAccessException e)
      {
         // good
View Full Code Here

   }
  
   @Test
   public void testEquals() throws Exception
   {
      SecuredLocal bean = lookup("SecuredBean/local", SecuredLocal.class);
     
      login("Admin", null);
     
      Principal p1 = bean.getCallerPrincipal();
      Principal p2 = bean.getCallerPrincipal();
     
      assertEquals(p1, p2);
   }
View Full Code Here

   }
  
   @Test
   public void testSame() throws Exception
   {
      SecuredLocal bean = lookup("SecuredBean/local", SecuredLocal.class);
     
      login("Admin", null);
     
      Principal p1 = bean.getCallerPrincipal();
      Principal p2 = bean.getCallerPrincipal();
     
      assertSame(p1, p2);
   }
View Full Code Here

   }
  
   @Test
   public void testSecurityContextAssociation() throws Exception
   {
      SecuredLocal bean = lookup("SecuredBean/local", SecuredLocal.class);
     
      SecurityContext sc = login("Invalid", null);
     
      try
      {
         bean.whoAmI();
         fail("Should have thrown EJBAccessException");
      }
      catch(EJBAccessException e)
      {
         // good
View Full Code Here

   }
  
   @Test
   public void test1() throws Exception
   {
      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");
      }
      catch(EJBAccessException e)
      {
         // good
View Full Code Here

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

      //DeploymentScope scope = null;
      if (unit.getParent() != null)
      {
         boolean isEar = unit != unit.getTopLevel();
         this.deploymentScope = new JBoss5DeploymentScope(unit.getParent(), isEar);
      }

      ejbResolver = new ClientEjbResolver(deploymentScope, unit.getSimpleName());
      messageDestinationResolver = new MessageDestinationResolver(deploymentScope, xml.getMessageDestinations());
View Full Code Here

         throw new NullPointerException("applicationClientName is mandatory");
      if (classLoader == null)
         throw new NullPointerException("classLoader is mandatory");

      this.deploymentUnit = unit;
      this.ejb3Unit = new JBoss5DeploymentUnit(unit);
      this.clientMetaData = xml;
      this.mainClass = mainClass;
      this.applicationClientName = applicationClientName;
      this.classLoader = classLoader;
View Full Code Here

    * @param shortName
    */
   public JBoss5DeploymentScope(VFSDeploymentUnit parent, boolean isEar, String shortName)
   {
      this(parent, isEar);
      ejbRefResolver = new EjbModuleEjbResolver(this, shortName);
   }
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.core.test.ejbthree1646.SecuredLocal

Copyright © 2018 www.massapicom. 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.