Package org.jboss.arquillian.impl.domain

Examples of org.jboss.arquillian.impl.domain.ContainerRegistry


   }
  
   private void forEachContainer(Operation<Container> operation) throws Exception
   {
      injector.get().inject(operation);
      ContainerRegistry registry = containerRegistry.get();
      for(Container container : registry.getContainers())
      {
         operation.perform(container);
      }
   }
View Full Code Here


   }
  
   private void forEachManagedDeployment(Operation<Container, DeploymentDescription> operation) throws Exception
   {
      injector.get().inject(operation);
      ContainerRegistry containerRegistry = this.containerRegistry.get();
      DeploymentScenario deploymentScenario = this.deploymentScenario.get();
     
      for(TargetDescription target : deploymentScenario.getTargets())
      {
         List<DeploymentDescription> startUpDeployments = deploymentScenario.getStartupDeploymentsFor(target);
         if(startUpDeployments.size() == 0)
         {
            continue; // nothing to do, move on
         }
        
         // Container should exists, handled by up front validation
         Container container = containerRegistry.getContainer(target);
        
         for(DeploymentDescription deployment : startUpDeployments)
         {
            operation.perform(container, deployment);
         }
View Full Code Here

   @Inject
   private Instance<ServiceLoader> loader;

   public void createRegistry(@Observes ArquillianDescriptor event)
   {
      ContainerRegistry reg = new ContainerRegistry();
      ServiceLoader serviceLoader = loader.get();

      String activeConfiguration = getActivatedConfiguration();
      for(ContainerDef container : event.getContainers())
      {
         if(
               (activeConfiguration != null && activeConfiguration.equals(container.getContainerName())) ||
               (activeConfiguration == null && container.isDefault()))
         {
            reg.create(container, serviceLoader);           
         }
      }
      if(activeConfiguration != null)
      {
         for(GroupDef group : event.getGroups())
         {
            if(activeConfiguration.equals(group.getGroupName()))
            {
               for(ContainerDef container : group.getGroupContainers())
               {
                  reg.create(container, serviceLoader);
               }
            }
         }
      }
      else if(reg.getContainers().size() == 0)
      {
         try
         {
            DeployableContainer<?> deployableContainer = serviceLoader.onlyOne(DeployableContainer.class);
            if(deployableContainer != null)
            {
               reg.create(new ContainerDefImpl("arquillian.xml").setContainerName("default"), serviceLoader);
            }
         }
         catch (Exception e)
         {
            // ignore
View Full Code Here

   private void lookup(Method method, ResultCallback callback)
   {
      DeploymentTargetDescription deploymentTarget = locateDeployment(method);
     
      ContainerRegistry containerRegistry = this.containerRegistry.get();
      DeploymentScenario deploymentScenario = this.deploymentScenario.get();
     
      DeploymentDescription deployment = deploymentScenario.getDeployment(deploymentTarget);
     
      Container container = containerRegistry.getContainer(deployment.getTarget());
     
      callback.call(container, deployment);
   }
View Full Code Here

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

   protected void validate(DeploymentScenario scenario)
   {
      ContainerRegistry conReg = containerRegistry.get();
      for(TargetDescription target : scenario.getTargets())
      {
         Container container = conReg.getContainer(target);
         if(container == null)
         {
            throw new ValidationException(
                  DeploymentScenario.class.getSimpleName() + " contains targets not maching any defined Container in the registry. " + target.getName());
         }
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.impl.domain.ContainerRegistry

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.