Package org.jboss.ejb3.core.test.common

Examples of org.jboss.ejb3.core.test.common.MockEjb3Deployment


         public void removeClassLoader(org.jboss.deployers.structure.spi.DeploymentUnit unit) throws Exception
         {
         }
      });
      DeploymentUnit unit = new MockDeploymentUnit(deploymentUnit);
      Ejb3Deployment deployment = new MockEjb3Deployment(unit, deploymentUnit);

      deployment.setEJBReferenceResolver(new ScopedEJBReferenceResolver());
     
      Class<?> beanImplementationClasses[] = { TXNotSupportedMDB.class };
      JBossMetaData jbossMetaData = MetaDataHelper.getMetaDataFromBeanImplClasses(beanImplementationClasses);
      unit.addAttachment(AttachmentNames.PROCESSED_METADATA, jbossMetaData);
     
View Full Code Here


      sessionBeanMetaData.setEjbClass(DummyEJB.class.getName());
      sessionBeanMetaData.setEjbName(DummyEJB.class.getSimpleName());
     
      enterpriseBeans.add(sessionBeanMetaData);

      MockEjb3Deployment deployment = new MockEjb3Deployment(new MockDeploymentUnit());
      ClassPool pool = ClassPool.getDefault();
      CtClass ctClass = pool.get(DummyEJB.class.getName());
      ClassFile classFile = ctClass.getClassFile();

      Ejb3DescriptorHandler handler = new Ejb3DescriptorHandler(deployment, classFile, metaData);
View Full Code Here

      sessionBeanMetaData.setEnterpriseBeansMetaData(enterpriseBeans);
      sessionBeanMetaData.setEjbClass(UnSpecifiedSessionTypeBean.class.getName());
      sessionBeanMetaData.setEjbName(UnSpecifiedSessionTypeBean.class.getSimpleName());
      enterpriseBeans.add(sessionBeanMetaData);

      MockEjb3Deployment deployment = new MockEjb3Deployment(new MockDeploymentUnit());
      Ejb3DescriptorHandler handler = new Ejb3DescriptorHandler(deployment, metaData);
      // get containers
      List<Container> containers = handler.getContainers(deployment, new HashMap<String, Container>());

      assertTrue("Unexpectedly found a container from metadata", containers.isEmpty());
View Full Code Here

      Domain domain = new Domain(new AspectManager(), "Test", false);
      Map<String, Class<? extends PersistenceManagerFactory>> factories = new HashMap<String, Class<? extends PersistenceManagerFactory>>();
      factories.put("MyStatefulSessionFilePersistenceManager", MyStatefulSessionFilePersistenceManagerFactory.class);
      PersistenceManagerFactoryRegistry persistenceManagerFactoryRegistry = new PersistenceManagerFactoryRegistry();
      persistenceManagerFactoryRegistry.setFactories(factories);
      Ejb3Deployment deployment = new MockEjb3Deployment(new MockDeploymentUnit());
      deployment.setPersistenceManagerFactoryRegistry(persistenceManagerFactoryRegistry);
      MockStatefulContainer container = new MockStatefulContainer(cl, beanClassName, ejbName, domain, ctxProperties,
            deployment);
      container.instantiated();
      container.processMetadata();
      System.out.println("injectors = " + container.getInjectors());
View Full Code Here

      System.out.println(cl.getResource("jndi.properties"));
      String beanClassname = MyStatefulBean.class.getName();
      String ejbName = MyStatefulBean.class.getSimpleName();
      Domain domain = getDomain("Stateful Bean");
      Hashtable<?,?> ctxProperties = null;
      Ejb3Deployment deployment = new MockEjb3Deployment(new MockDeploymentUnit());
      deployment.setPersistenceManagerFactoryRegistry(getBootstrap().lookup("EJB3PersistenceManagerFactoryRegistry", PersistenceManagerFactoryRegistry.class));
      JBossSessionBeanMetaData beanMetaData = MetaDataHelper.getMetadataFromBeanImplClass(MyStatefulBean.class);
      StatefulContainer container = new StatefulContainer(cl, beanClassname, ejbName, domain, ctxProperties, deployment, beanMetaData);
     
      // TODO: wickedness
      container.instantiated();
View Full Code Here

      Class<?> beanClass = AnnotatedWebServiceContextInjectedBean.class;
      String beanClassname = beanClass.getName();
      String ejbName = beanClass.getSimpleName();
      Domain domain = getDomain("Stateless Bean");
      Hashtable<?,?> ctxProperties = null;
      Ejb3Deployment deployment = new MockEjb3Deployment(new MockDeploymentUnit());
      JBossSessionBeanMetaData beanMetaData = MetaDataHelper.getMetadataFromBeanImplClass(beanClass);
      StatelessContainer container = new StatelessContainer(cl, beanClassname, ejbName, domain, ctxProperties, deployment, beanMetaData);
     
      // TODO: wickedness
      container.instantiated();
View Full Code Here

      Class<?> beanClass = OverrideWebServiceContextInjectedBean.class;
      String beanClassname = beanClass.getName();
      String ejbName = beanClass.getSimpleName();
      Domain domain = getDomain("Stateless Bean");
      Hashtable<?,?> ctxProperties = null;
      Ejb3Deployment deployment = new MockEjb3Deployment(new MockDeploymentUnit());
      JBossSessionBeanMetaData beanMetaData = MetaDataHelper.getMetadataFromBeanImplClass(beanClass);
     
      // add an override
     
      ResourceInjectionTargetMetaData injectionTarget = new ResourceInjectionTargetMetaData();
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.common.MockEjb3Deployment

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.