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

Examples of org.jboss.ejb3.core.test.ejbthree1646.unit.AuthenticationInterceptorTestCase


   @Override
   public void undeploy(VFSDeploymentUnit unit, JBossClientMetaData metaData)
   {
      log.debug("undeploy " + unit.getName());

      ClientENCInjectionContainer container = unit.getAttachment(ClientENCInjectionContainer.class);
      if(container != null)
         getKernelAbstraction().uninstall(container.getObjectName().getCanonicalName());

      String appClientName = getJndiName(metaData);
      String deploymentClientName = null;
      if(appClientName == null)
         appClientName = getDeploymentJndiName(unit);
View Full Code Here


     
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new RunAsMetaDataBridge());
      //Add a security domain bridge
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new SecurityDomainMetaDataBridge());
      // Ensure that an @Clustered annotation is visible to AOP if the XML says the bean is  clustered.
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new ClusteredMetaDataBridge());
   }
View Full Code Here

         Kernel sanders = this.kernel;
         assert sanders != null : Kernel.class.getSimpleName() + " must be provided in order to bind "
               + Ejb3Registrar.class.getSimpleName();

         // Create an EJB3 Registrar
         Ejb3Registrar registrar = new Ejb3McRegistrar(sanders);

         // Bind Registrar to the Locator
         Ejb3RegistrarLocator.bindRegistrar(registrar);
        
         // Log
View Full Code Here

      {
         SessionProxyInvocationHandler handler = (SessionProxyInvocationHandler) Proxy.getInvocationHandler(reference);
         id = (Serializable) handler.getTarget();
      }

      @Deprecated
      Ejb3Registrar registrar = Ejb3RegistrarLocator.locateRegistrar();

      // Get the resolver
      EndpointResolver resolver = registrar.lookup(MC_BIND_NAME_ENDPOINT_RESOLVER, EndpointResolver.class);
      this.ejbClassName = descriptor.getBeanClass().getSimpleName();
      endpointMcBindName = resolver.resolve(deploymentUnit, ejbClassName);
      this.stateful = descriptor.isStateful();
   }
View Full Code Here

      }
   }

   private Endpoint getEndpoint()
   {
      @Deprecated
      Ejb3Registrar registrar = Ejb3RegistrarLocator.locateRegistrar();
      return registrar.lookup(endpointMcBindName, Endpoint.class);
   }
View Full Code Here

         Kernel sanders = this.kernel;
         assert sanders != null : Kernel.class.getSimpleName() + " must be provided in order to bind "
               + Ejb3Registrar.class.getSimpleName();

         // Create an EJB3 Registrar
         Ejb3Registrar registrar = new Ejb3McRegistrar(sanders);

         // Bind Registrar to the Locator
         Ejb3RegistrarLocator.bindRegistrar(registrar);
        
         // Log
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

   }
  
   @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

TOP

Related Classes of org.jboss.ejb3.core.test.ejbthree1646.unit.AuthenticationInterceptorTestCase

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.