Examples of DeploymentScenario


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

   }

   @Test(expected = IllegalArgumentException.class)
   public void shouldNotAllowMultipleArchiveDeploymentsWithSameName()
   {
      DeploymentScenario scenario = new DeploymentScenario();
      scenario.addDeployment(
            new DeploymentDescription("X", ShrinkWrap.create(JavaArchive.class))
            .setTarget(TargetDescription.DEFAULT));
      scenario.addDeployment(
            new DeploymentDescription("X", ShrinkWrap.create(JavaArchive.class))
            .setTarget(TargetDescription.DEFAULT));
   }
View Full Code Here

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

   }

   @Test(expected = IllegalArgumentException.class)
   public void shouldNotAllowMultipleArchiveDeploymentsWithSameArchiveName()
   {
      DeploymentScenario scenario = new DeploymentScenario();
      scenario.addDeployment(
            new DeploymentDescription(DEFAULT_NAME, ShrinkWrap.create(JavaArchive.class, "test.jar"))
            .setTarget(TargetDescription.DEFAULT));
      scenario.addDeployment(
            new DeploymentDescription("B", ShrinkWrap.create(JavaArchive.class, "test.jar"))
            .setTarget(TargetDescription.DEFAULT));
   }
View Full Code Here

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

   }

   @Test(expected = IllegalArgumentException.class)
   public void shouldNotAllowMultipleDescriptorDeploymentsWithSameName()
   {
      DeploymentScenario scenario = new DeploymentScenario();
      scenario.addDeployment(
            new DeploymentDescription(DEFAULT_NAME, Descriptors.create(BeansDescriptor.class))
            .setTarget(TargetDescription.DEFAULT));
      scenario.addDeployment(
            new DeploymentDescription(DEFAULT_NAME, Descriptors.create(BeansDescriptor.class))
            .setTarget(TargetDescription.DEFAULT));
   }
View Full Code Here

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

   public void generateDeployment(@Observes GenerateDeployment event)
   {
      DeploymentScenarioGenerator generator = serviceLoader.get().onlyOne(
            DeploymentScenarioGenerator.class, AnnotationDeploymentScenarioGenerator.class);
     
      DeploymentScenario scenario = new DeploymentScenario();
     
      for(DeploymentDescription deployment : generator.generate(event.getTestClass()))
      {
         scenario.addDeployment(deployment);
      }

      validate(scenario);
      createTestableDeployments(scenario, event.getTestClass());
View Full Code Here

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

   }

   private Object runInDeploymentContext(ArquillianResource resource, Annotation... qualifiers)
   {
      DeploymentContext context = null;
      DeploymentScenario scenario = null;
      boolean activateContext = containsOperatesOnDeployment(qualifiers);
      boolean contextActivated = false;
      try
      {
         Deployment deployment = null;
         if(activateContext)
         {
            context = deploymentContext.get();
            scenario = deploymentScenario.get();
            if(scenario == null)
            {
               throw new IllegalStateException("No " + DeploymentScenario.class.getSimpleName() + " found. " +
                     "Possible cause, @" + OperateOnDeployment.class.getSimpleName() + " is currently only supported on the client side. (@" + RunAsClient.class.getSimpleName() + ")");
            }
            OperateOnDeployment operatesOn = getOperatesOnDeployment(qualifiers);
            deployment = scenario.deployment(new DeploymentTargetDescription(operatesOn.value()));
            if(deployment == null)
            {
               throw new IllegalArgumentException(
                     "Could not operate on deployment (@" + OperateOnDeployment.class.getSimpleName() + "), " +
                     "no deployment found with name: " + operatesOn.value());
View Full Code Here

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

   private void lookup(Method method, ResultCallback callback)
   {
      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() + ". " +
View Full Code Here

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

   private Instance<DeploymentScenario> deploymentScenario;

   @Override
   public void start(String containerQualifier)
   {
      DeploymentScenario scenario = deploymentScenario.get();
      if(scenario == null)
      {
         throw new IllegalArgumentException("No deployment scenario in context");
      }
     
      ContainerRegistry registry = containerRegistry.get();
      if (registry == null)
      {
         throw new IllegalArgumentException("No container registry in context");
      }

      if (!containerExists(registry.getContainers(), containerQualifier))
      {
         throw new IllegalArgumentException("No container found in registry with name " + containerQualifier);
      }

      if (!isControllableContainer(registry.getContainers(), containerQualifier))
      {
         throw new IllegalArgumentException("Could not start " + containerQualifier + " container. The container life cycle is controlled by Arquillian");
      }
     
      List<Deployment> managedDeployments = scenario.startupDeploymentsFor(new TargetDescription(containerQualifier));
     
      Container container = registry.getContainer(new TargetDescription(containerQualifier));

      log.info("Manual starting of a server instance");
View Full Code Here

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

   }

   @Override
   public void start(String containerQualifier, Map<String, String> config)
   {
      DeploymentScenario scenario = deploymentScenario.get();
      if(scenario == null)
      {
         throw new IllegalArgumentException("No deployment scenario in context");
      }
     
      ContainerRegistry registry = containerRegistry.get();
      if (registry == null)
      {
         throw new IllegalArgumentException("No container registry in context");
      }

      if (!containerExists(registry.getContainers(), containerQualifier))
      {
         throw new IllegalArgumentException("No container with the specified name exists");
      }
     
      if (!isControllableContainer(registry.getContainers(), containerQualifier))
      {
         throw new IllegalArgumentException("Could not start " + containerQualifier + " container. The container life cycle is controlled by Arquillian");
      }

      List<Deployment> managedDeployments = scenario.startupDeploymentsFor(new TargetDescription(containerQualifier));
     
      Container container = registry.getContainer(new TargetDescription(containerQualifier));

      for (String name : config.keySet())
      {
View Full Code Here

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

   }

   @Override
   public void stop(String containerQualifier)
   {
      DeploymentScenario scenario = deploymentScenario.get();
      if(scenario == null)
      {
         throw new IllegalArgumentException("No deployment scenario in context");
      }
     
      ContainerRegistry registry = containerRegistry.get();
      if (registry == null)
      {
         throw new IllegalArgumentException("No container registry in context");
      }

      if (!containerExists(registry.getContainers(), containerQualifier))
      {
         throw new IllegalArgumentException("No container with the specified name exists");
      }
     
      if (!isControllableContainer(registry.getContainers(), containerQualifier))
      {
         throw new IllegalArgumentException("Could not start " + containerQualifier + " container. The container life cycle is controlled by Arquillian");
      }

      Container container = registry.getContainer(new TargetDescription(containerQualifier));

      List<Deployment> managedDeployments = scenario.startupDeploymentsFor(new TargetDescription(containerQualifier));
     
      for (Deployment d : managedDeployments)
      {
         if (d.isDeployed())
         {
View Full Code Here

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

      });
   }
  
   private void forEachManagedDeployment(Operation<Container, Deployment> operation) throws Exception
   {
      DeploymentScenario scenario = this.deploymentScenario.get();
      if(scenario == null)
      {
         return;
      }
      forEachDeployment(scenario.managedDeploymentsInDeployOrder(), operation);
   }
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.