Examples of ContainerRegistry


Examples of org.jboss.arquillian.container.spi.ContainerRegistry

   // Validate DeploymentScenario --------------------------------------------------------||
   //-------------------------------------------------------------------------------------||

   protected void validate(DeploymentScenario scenario)
   {
      ContainerRegistry conReg = containerRegistry.get();
      for (TargetDescription target : scenario.targets())
      {
         Container container = conReg.getContainer(target);
         if (container == null)
         {
            throwTargetNotFoundValidationException(conReg, target);
         }
      }

      for(Deployment deployment : scenario.deployments())
      {
         Container container = conReg.getContainer(deployment.getDescription().getTarget());
         if("custom".equalsIgnoreCase(container.getContainerConfiguration().getMode()))
         {
            if(deployment.getDescription().managed())
            {
               throw new ValidationException(
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

   }

   private Object runInContainerContext(TargetDescription targetDescription, ArquillianResource resource, Annotation... qualifiers)
   {
      ContainerContext context = null;
      ContainerRegistry registry = null;
      boolean activateContext = targetDescription != null;
      boolean contextActivated = false;
      try
      {
         if(activateContext)
         {
            context = containerContext.get();
            registry = containerRegistry.get();
            if(registry == null)
            {
               throw new IllegalStateException("No " + ContainerRegistry.class.getSimpleName() + " found. " +
                     "Possible problem is, @" + OperateOnDeployment.class.getSimpleName() + " is currently only supported on the client side.");
            }
            Container container = registry.getContainer(targetDescription);
            if(container == null)
            {
               throw new IllegalArgumentException(
                     "Could not operate on deployment (@" + OperateOnDeployment.class.getSimpleName() + "), " +
                     "no container found with name: " + targetDescription);
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

   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() + ". " +
               "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

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

      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");

      event.fire(new StartContainer(container));
     
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

      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())
      {
         container.getContainerConfiguration().overrideProperty(name, config.get(name));
      }
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

      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)
      {
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

   }

   @Override
   public void kill(String containerQualifier)
   {
      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));

      log.info("Hard killing of a server instance");

      event.fire(new KillContainer(container));
   }
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

   }

   @Override
   public boolean isStarted(String containerQualifier)
   {
      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);
      }

      Container container = registry.getContainer(new TargetDescription(containerQualifier));
      return container.getState() == Container.State.STARTED;
   }
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

   }

   private void forEachDeployment(List<Deployment> deployments, Operation<Container, Deployment> operation) throws Exception
   {
      injector.get().inject(operation);
      ContainerRegistry containerRegistry = this.containerRegistry.get();
      if(containerRegistry == null)
      {
         return;
      }
      for(Deployment deployment: deployments)
      {
         Container container = containerRegistry.getContainer(deployment.getDescription().getTarget());
         operation.perform(container, deployment);
      }
   }
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

   // Validate DeploymentScenario --------------------------------------------------------||
   //-------------------------------------------------------------------------------------||

   protected void validate(DeploymentScenario scenario)
   {
      ContainerRegistry conReg = containerRegistry.get();
      for(TargetDescription target : scenario.targets())
      {
         Container container = conReg.getContainer(target);
         if(container == null)
         {
            throw new ValidationException(
                  DeploymentScenario.class.getSimpleName() + " contains targets not matching any defined Container in the registry. " + target.getName() +
                  ". Possible causes are: No Deployable Container found on Classpath or " +
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.