Examples of DeploymentPackager


Examples of org.jboss.arquillian.spi.DeploymentPackager

  
   public Archive<?> generate(Context context, TestClass testCase)
   {
      Validate.notNull(testCase, "TestCase must be specified");

      DeploymentPackager packager = serviceLoader.onlyOne(DeploymentPackager.class);

      Archive<?> applicationArchive = serviceLoader.onlyOne(
            ApplicationArchiveGenerator.class,
            DeploymentAnnotationArchiveGenerator.class).generateApplicationArchive(testCase);
     
      applyApplicationProcessors(applicationArchive, testCase);
     
      List<Archive<?>> auxiliaryArchives = loadAuxiliaryArchives();
      applyAuxiliaryProcessors(auxiliaryArchives);

      TestDeployment deployment = new TestDeployment(applicationArchive, auxiliaryArchives);
      context.add(TestDeployment.class, deployment);
      return packager.generateDeployment(deployment);
   }
View Full Code Here

Examples of org.jboss.arquillian.spi.DeploymentPackager

    * @see org.jboss.arquillian.spi.event.suite.EventHandler#callback(org.jboss.arquillian.spi.Context, java.lang.Object)
    */
   public void callback(Context context, ClassEvent event) throws Exception
   {
      ServiceLoader serviceLoader = context.getServiceLoader();
      DeploymentPackager packager = serviceLoader.onlyOne(DeploymentPackager.class);
     
      DeploymentGenerator generator = context.get(DeploymentGenerator.class);
      Validate.stateNotNull(generator, "No " + DeploymentGenerator.class.getName() + " found in context");
     
      TestDeployment deployment = generator.generate(event.getTestClass());
      Archive<?> archive = packager.generateDeployment(context, deployment);
     
      context.add(TestDeployment.class, deployment);
      context.add(Archive.class, archive);
   }
View Full Code Here

Examples of org.jboss.arquillian.spi.DeploymentPackager

   @Override
   public Archive<?> generate(Class<?> testCase)
   {
      Validate.notNull(testCase, "TestCase must be specified");

      DeploymentPackager packager = serviceLoader.onlyOne(DeploymentPackager.class);

      Archive<?> applicationArchive = serviceLoader.onlyOne(ApplicationArchiveGenerator.class).generateApplicationArchive(testCase);
      applyApplicationProcessors(applicationArchive, testCase);
     
      List<Archive<?>> auxiliaryArchives = loadAuxiliaryArchives();
      applyAuxiliaryProcessors(auxiliaryArchives);

      return packager.generateDeployment(applicationArchive, auxiliaryArchives);
   }
View Full Code Here

Examples of org.jboss.arquillian.spi.client.deployment.DeploymentPackager

         {
            protocolDefinition = protoReg.getProtocol(
                  containerRegistry.get().getContainer(deployment.getTarget()).getDeployableContainer().getDefaultProtocol());
         }
         Protocol<?> protocol = protocolDefinition.getProtocol();
         DeploymentPackager packager = protocol.getPackager();

         Archive<?> applicationArchive = deployment.getArchive();
         applyApplicationProcessors(deployment.getArchive(), testCase);
         applyAuxiliaryProcessors(auxiliaryArchives);

         try
         {
            // this should be made more reliable, does not work with e.g. a EnterpriseArchive
            if(ClassContainer.class.isInstance(applicationArchive))
            {
               ClassContainer<?> classContainer = ClassContainer.class.cast(applicationArchive);
               classContainer.addClass(testCase.getJavaClass());
            }
         }
         catch (UnsupportedOperationException e)
         {
            /*
             * Quick Fix: https://jira.jboss.org/jira/browse/ARQ-118
             * Keep in mind when rewriting for https://jira.jboss.org/jira/browse/ARQ-94
             * that a ShrinkWrap archive might not support a Container if even tho the
             * ContianerBase implements it. Check the Archive Interface.. 
             */
         }
         ClassLoader classLoader = containerRegistry.get().getContainer(deployment.getTarget()).getClassLoader();
        
         deployment.setTestableArchive(
               packager.generateDeployment(
                     new TestDeployment(applicationArchive, auxiliaryArchives),
                     serviceLoader.get().all(classLoader, ProtocolArchiveProcessor.class)));
      }
   }
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.