Package org.jboss.arquillian.container.spi

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


      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

        waitForStart(domain, managementClient);

        // Register all ServerGroups
        for (ServerGroup serverGroup: domain.getServerGroups()) {
            Container serverContainer = createServerGroupContainer(registry, archiveDeployer, domain, serverGroup,
                    containerConfig.getServerGroupOperationTimeoutInSeconds());
            String mode = mapMode(modeMap, serverContainer.getName());
            if(mode != null) {
                serverContainer.getContainerConfiguration().setMode(mode);
            }
            setupEvent.fire(new SetupContainer(serverContainer));
            serverContainer.setState(Container.State.STARTED);
        }

        // Register all Servers
        for (Server server : domain.getServers()) {
            Container serverContainer = createServerContainer(registry, server, containerConfig.getServerOperationTimeoutInSeconds());
            String mode = mapMode(modeMap, serverContainer.getName());
            if(mode != null) {
                serverContainer.getContainerConfiguration().setMode(mode);
            }
            String serverStatus = managementClient.getServerState(server);

            setupEvent.fire(new SetupContainer(serverContainer));
            if (serverStatus.equals("STARTED")) {
                serverContainer.setState(Container.State.STARTED);
            } else {
                serverContainer.setState(Container.State.STOPPED);
            }
        }
    }
View Full Code Here

      {
         return;
      }
      for(Deployment deployment: deployments)
      {
         Container container = containerRegistry.getContainer(deployment.getDescription().getTarget());
         operation.perform(container, deployment);
      }
   }
View Full Code Here

   }

   private Container selectContainer(Manager manager)
   {
      // TODO: Add support for multi configuration
      Container container = createRegistry(manager).getContainer(TargetDescription.DEFAULT);
      getLog().info("to container: " + container.getName());
      return container;
   }
View Full Code Here

      if (deployment.getDescription().managed())
      {
         throw new IllegalArgumentException("Could not deploy " + name + " deployment. The deployment is controlled by Arquillian");
      }
     
      Container container = registry.getContainer(deployment.getDescription().getTarget());
     
      if (!container.getState().equals(State.STARTED))
      {
         throw new IllegalArgumentException("Deployment with name " + name + " could not be deployed. Container " +
            container.getName() + " must be started first.");
      }
     
      event.fire(new DeployDeployment(container, deployment));
   }
View Full Code Here

      if (deployment.getDescription().managed())
      {
         throw new IllegalArgumentException("Could not deploy " + name + " deployment. The deployment is controlled by Arquillian");
      }
     
      Container container = registry.getContainer(deployment.getDescription().getTarget());
     
      if (!container.getState().equals(State.STARTED))
      {
         throw new IllegalArgumentException("Deployment with name " + name + " could not be undeployed. Container " +
            container.getName() + " must be still running.");
      }
     
      event.fire(new UnDeployDeployment(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)
         {
            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

   {
      injector.get().inject(operation);
      ContainerRegistry containerRegistry = this.containerRegistry.get();
      for(Deployment deployment: deployments)
      {
         Container container = containerRegistry.getContainer(deployment.getDescription().getTarget());
         operation.perform(container, deployment);
      }
   }
View Full Code Here

   }

   @Test
   public void shouldBeAbleToCheckTheStateOfAServer() throws Exception
   {
      Container contianer = registry.getContainer(CUSTOM_SERVER_NAME);
      contianer.setState(Container.State.STOPPED);
      Assert.assertFalse(controller.get().isStarted(CUSTOM_SERVER_NAME));

      contianer.setState(Container.State.STARTED);
      Assert.assertTrue(controller.get().isStarted(CUSTOM_SERVER_NAME));
   }
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.