Package org.jboss.arquillian.spi.client.deployment

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


{

   @Test
   public void shouldHandleMultipleDeploymentsAllDefault() throws Exception
   {
      DeploymentScenario scenario = new AnnotationDeploymentScenarioGenerator().generate(new TestClass(MultiDeploymentsDefault.class));
     
      Assert.assertNotNull(scenario);
      Assert.assertEquals(
            "Verify all deployments were found",
            2, scenario.getDeployments().size());
     
      for(DeploymentDescription deployment : scenario.getDeployments())
      {
         Assert.assertEquals(
               "Verify deployment has default target",
               TargetDescription.DEFAULT,
               deployment.getTarget());
View Full Code Here


   }
  
   @Test
   public void shouldHandleMultipleDeploymentsAllSet() throws Exception
   {
      DeploymentScenario scenario = new AnnotationDeploymentScenarioGenerator().generate(new TestClass(MultiDeploymentsSet.class));
     
      Assert.assertNotNull(scenario);
      Assert.assertEquals(
            "Verify all deployments were found",
            2, scenario.getDeployments().size());
     
      DeploymentDescription deploymentOne = scenario.getDeployments().get(0);

      Assert.assertEquals(
            "Verify deployment has specified target",
            new TargetDescription("target-first"),
            deploymentOne.getTarget());

      Assert.assertEquals(
            "Verify deployment has specified protocol",
            new ProtocolDescription("protocol-first"),
            deploymentOne.getProtocol());
     
      Assert.assertEquals(1, deploymentOne.getOrder());
      Assert.assertEquals(false, deploymentOne.managed());
      Assert.assertEquals(false, deploymentOne.testable());
      Assert.assertTrue(JavaArchive.class.isInstance(deploymentOne.getArchive()));
      Assert.assertNull(deploymentOne.getExpectedException());
     
      DeploymentDescription deploymentTwo = scenario.getDeployments().get(1);

      Assert.assertEquals(
            "Verify deployment has specified target",
            new TargetDescription("target-second"),
            deploymentTwo.getTarget());
View Full Code Here

   }
  
   @Test
   public void shouldReadExpectedAndOverrideDeployment()
   {
      DeploymentScenario scenario = new AnnotationDeploymentScenarioGenerator().generate(new TestClass(ExpectedDeploymentExceptionSet.class));
     
      Assert.assertNotNull(scenario);
      Assert.assertEquals(
            "Verify all deployments were found",
            1, scenario.getDeployments().size());
     
      DeploymentDescription deploymentOne = scenario.getDeployments().get(0);

      Assert.assertEquals(false, deploymentOne.testable());
      Assert.assertTrue(JavaArchive.class.isInstance(deploymentOne.getArchive()));
      Assert.assertEquals(Exception.class, deploymentOne.getExpectedException());
   }
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
         }
        
View Full Code Here

   public void generateDeployment(@Observes GenerateDeployment event)
   {
      DeploymentScenarioGenerator generator = serviceLoader.get().onlyOne(
            DeploymentScenarioGenerator.class, AnnotationDeploymentScenarioGenerator.class);
     
      DeploymentScenario scenario = generator.generate(event.getTestClass());
      validate(scenario);
      createTestableDeployments(scenario, event.getTestClass());
     
      deployment.set(scenario);
   }
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

   /* (non-Javadoc)
    * @see org.jboss.arquillian.spi.deployment.DeploymentScenarioGenerator#generate(org.jboss.arquillian.spi.TestClass)
    */
   public DeploymentScenario generate(TestClass testClass)
   {
      DeploymentScenario scenario = new DeploymentScenario();
      Method[] deploymentMethods = testClass.getMethods(Deployment.class);
      validate(deploymentMethods);
      for(Method deploymentMethod: deploymentMethods)
      {
         validate(deploymentMethod);
         scenario.addDeployment(generateDeployment(deploymentMethod));
      }
     
      return scenario;
   }
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.spi.client.deployment.DeploymentScenario

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.