Package org.jboss.arquillian.container.spi.client.deployment

Examples of org.jboss.arquillian.container.spi.client.deployment.Deployment


      if(registry == null)
      {
         throw new IllegalArgumentException("No container registry in context");
      }
     
      Deployment deployment = scenario.deployment(new DeploymentTargetDescription(name));
      if(deployment == null)
      {
         throw new IllegalArgumentException("No deployment in context found with name " + name);
      }
      Container container = registry.getContainer(deployment.getDescription().getTarget());
     
      event.fire(new UnDeployDeployment(container, deployment));
   }
View Full Code Here


      DeploymentScenario scenario = deploymentScenario.get();
      if(scenario == null)
      {
         throw new IllegalArgumentException("No deployment scenario in context");
      }
      Deployment deployment = scenario.deployment(new DeploymentTargetDescription(name));
      if(deployment == null)
      {
         throw new IllegalArgumentException("No deployment in context found with name " + name);
      }

      DeploymentDescription description = deployment.getDescription();
      if(description.isArchiveDeployment())
      {
         Archive<?> archive = description.testable() ? description.getTestableArchive():description.getArchive();
         return archive.as(ZipExporter.class).exportAsInputStream();
      }
View Full Code Here

      DeploymentTargetDescription deploymentTarget = locateDeployment(method);
     
      ContainerRegistry containerRegistry = this.containerRegistry.get();
      DeploymentScenario deploymentScenario = this.deploymentScenario.get();
     
      Deployment deployment = deploymentScenario.deployment(deploymentTarget);
      if(deployment == null && deploymentTarget != DeploymentTargetDescription.DEFAULT)
      {
         // trying to operate on a non existing DeploymentTarget (which is not the DEFAULT)
         throw new IllegalStateException(
               "No deployment found in " + DeploymentScenario.class.getSimpleName() + " for defined target: " + deploymentTarget.getName() + ". " +
               "Please verify that the @" + OperateOnDeployment.class.getSimpleName() + " annotation on method " + method.getName() + " match a defined " +
               "@" + org.jboss.arquillian.container.test.api.Deployment.class.getSimpleName() + ".name");
      }
      if(deployment != null)
      {
         Container container = containerRegistry.getContainer(deployment.getDescription().getTarget());
         callback.call(container, deployment);
      }
   }
View Full Code Here

            .setTarget(TargetDescription.DEFAULT));
      scenario.addDeployment(
            new DeploymentDescription("B", Descriptors.create(BeansDescriptor.class))
            .setTarget(TargetDescription.DEFAULT));
     
      Deployment defaultDeployment = scenario.deployment(DeploymentTargetDescription.DEFAULT);
     
      Assert.assertNull(defaultDeployment);
   }
View Full Code Here

      scenario.addDeployment(
            new DeploymentDescription("B", Descriptors.create(BeansDescriptor.class))
            .setTarget(TargetDescription.DEFAULT));


      Deployment deployment = scenario.deployment(new DeploymentTargetDescription("C"));
     
      Assert.assertNull(deployment);
   }
View Full Code Here

            .setTarget(TargetDescription.DEFAULT));
      scenario.addDeployment(
            new DeploymentDescription("A", Descriptors.create(BeansDescriptor.class))
            .setTarget(TargetDescription.DEFAULT));

      Deployment deployment = scenario.deployment(new DeploymentTargetDescription("A"));

      // will default to Archive
      Assert.assertEquals("A", deployment.getDescription().getName());
      Assert.assertTrue(deployment.getDescription().isArchiveDeployment());
   }
View Full Code Here

            .setTarget(TargetDescription.DEFAULT));
      scenario.addDeployment(
            new DeploymentDescription("A", ShrinkWrap.create(JavaArchive.class))
            .setTarget(TargetDescription.DEFAULT));

      Deployment deployment = scenario.deployment(new DeploymentTargetDescription("A"));

      // will default to Archive
      Assert.assertEquals("A", deployment.getDescription().getName());
      Assert.assertTrue(deployment.getDescription().isArchiveDeployment());
   }
View Full Code Here

            .setTarget(TargetDescription.DEFAULT));
      scenario.addDeployment(
            new DeploymentDescription("B", ShrinkWrap.create(JavaArchive.class))
            .setTarget(TargetDescription.DEFAULT));
     
      Deployment defaultDeployment = scenario.deployment(DeploymentTargetDescription.DEFAULT);
     
      Assert.assertNull(defaultDeployment);
   }
View Full Code Here

            .setTarget(TargetDescription.DEFAULT));
      scenario.addDeployment(
            new DeploymentDescription(DEFAULT_NAME, ShrinkWrap.create(JavaArchive.class))
            .setTarget(TargetDescription.DEFAULT));

      Deployment defaultDeployment = scenario.deployment(DeploymentTargetDescription.DEFAULT);
      Assert.assertNotNull(defaultDeployment);
      Assert.assertEquals(DEFAULT_NAME, defaultDeployment.getDescription().getName());
      Assert.assertTrue(defaultDeployment.getDescription().isArchiveDeployment());
   }
View Full Code Here

    @SuppressWarnings("UnusedDeclaration")
    public void onDeploy(@Observes(precedence = -1) EventContext<DeployDeployment> eventContext, TestClass testClass)
    {
        tempDirectory = ShrinkWrapUtil.createTempDirectory(getTempDirectory());
        final DeployDeployment event = eventContext.getEvent();
        final Deployment deployment = event.getDeployment();
        Archive<?> testableArchive = deployment.getDescription().getTestableArchive();
        Archive<?> archive = deployment.getDescription().getArchive();
        final File explodedDeploymentDirectory = new File(
            tempDirectory + File.separator + testClass.getJavaClass().getCanonicalName() + File.separator + event.getContainer().getName());

        final Archive<?> explodableArchive = getExplodableArchive(testableArchive, archive);

        final File mainArchiveDirectory = new File(explodedDeploymentDirectory, explodableArchive.getName());
        final String mainArchivePath = mainArchiveDirectory.getAbsolutePath();
        File metaDataFile = new File(explodedDeploymentDirectory, explodableArchive.getName() + ".meta");
        boolean alreadyDeployed = metaDataFile.exists();

        if (!alreadyDeployed) {
            processArchiveAndProceedWithDeployment(eventContext, deployment, testableArchive, archive, explodedDeploymentDirectory, mainArchivePath,
                metaDataFile);
        } else {
            SerializableHttpContextData serializableHttpContextData = Serializer.toObject(SerializableHttpContextData.class, metaDataFile);
            explodeIfNeeded(testableArchive, archive, explodedDeploymentDirectory, serializableHttpContextData.isRebelXmlGenerated());
            explodableArchive.as(ExplodedFilterableExporter.class).exportExploded(explodedDeploymentDirectory, new RebelArchiveFilter(archive));
            ProtocolMetaData metaData = new ProtocolMetaData();
            metaData.addContext(serializableHttpContextData.toHTTPContext());
            protocolMetaData.set(metaData);
            deployment.deployed();
            deploymentProducer.set(deployment);
            deploymentDescriptionProducer.set(deployment.getDescription());
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.container.spi.client.deployment.Deployment

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.