Package org.jboss.arquillian.container.spi

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


               "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


   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

         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));
     
      for (Deployment d : managedDeployments)
      {
         if (!d.isDeployed())
         {
            log.info("Automatic deploying of the managed deployment with name " + d.getDescription().getName() +
               " for the container with name " + container.getName());
            event.fire(new DeployDeployment(container, d));
         }
      }
   }
View Full Code Here

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

      log.info("Manual starting of a server instance with overridden configuration. New configuration: " +
         container.getContainerConfiguration().getContainerProperties());

      event.fire(new SetupContainer(container));
      event.fire(new StartContainer(container));
     
      for (Deployment d : managedDeployments)
      {
         if (!d.isDeployed())
         {
            log.info("Automatic deploying of the managed deployment with name " + d.getDescription().getName() +
               " for the container with name " + container.getName());
            event.fire(new DeployDeployment(container, d));
         }
      }
   }
View Full Code Here

      if (!isManualContainer(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())
         {
            log.info("Automatic undeploying of the managed deployment with name " + d.getDescription().getName() +
               " from the container with name " + container.getName());
            event.fire(new UnDeployDeployment(container, d));
         }
      }
     
      log.info("Manual stopping of a server instance");
View Full Code Here

      if (!isManualContainer(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

   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 "
                        + "your have defined a @" + org.jboss.arquillian.container.test.api.Deployment.class.getName()
                        + " with a @" + TargetsContainer.class.getName()
                        + " value that does not match any found/configured Containers (see arquillian.xml container@qualifier) ");
         }
      }

      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(
                     "Deployment " + deployment.getDescription().getName() + " is targeted against container " +
                     container.getName() + ". This container is set to mode custom which can not handle managed deployments. " +
                     "Please verify the @" + TargetsContainer.class.getName() + " annotation or container@mode in arquillian.xml");
            }
         }
      }
View Full Code Here

   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(
                     "Deployment " + deployment.getDescription().getName() + " is targeted against container " +
                     container.getName() + ". This container is set to mode custom which can not handle managed deployments. " +
                     "Please verify the @" + TargetsContainer.class.getName() + " annotation or container@mode in arquillian.xml");
            }
         }
      }
View Full Code Here

            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);
            }
            context.activate(container.getName());
            contextActivated = true;
         }
         return doLookup(resource, qualifiers);
      }
      finally
View Full Code Here

   private Instance<TestContext> testContextInst;


   public void execute(@Observes RemoteExecutionEvent event) throws Exception
   {
      Container container = this.container.get();
      DeploymentDescription deployment = this.deployment.get();
     
      ProtocolRegistry protoReg = protocolRegistry.get();

      // if no default marked or specific protocol defined in the registry, use the DeployableContainers defaultProtocol.
      ProtocolDefinition protocol = protoReg.getProtocol(deployment.getProtocol());
      if(protocol == null)
      {
         protocol = protoReg.getProtocol(container.getDeployableContainer().getDefaultProtocol());
      }
   
      ProtocolConfiguration protocolConfiguration;
     
      if(container.hasProtocolConfiguration(protocol.getProtocolDescription()))
      {
         protocolConfiguration = protocol.createProtocolConfiguration(
               container.getProtocolConfiguration(protocol.getProtocolDescription()).getProtocolProperties());
      }
      else
      {
         protocolConfiguration = protocol.createProtocolConfiguration();
      }
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.container.spi.Container

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.