Package org.jboss.deployers.client.spi

Examples of org.jboss.deployers.client.spi.DeployerClient


   public void testRequiredState() throws Exception
   {
      RequiredStageDeployer deployer = new RequiredStageDeployer();
      deployer.setStage(DeploymentStages.POST_PARSE);
      DeployerClient main = createMainDeployer(deployer);
     
      String name = "simple";
     
      Deployment deployment = createSimpleDeployment(name);
      MutableAttachments attachments = (MutableAttachments) deployment.getPredeterminedManagedObjects();
      attachments.addAttachment(DeploymentStage.class, DeploymentStages.DESCRIBE);
      main.deploy(deployment);

      DeploymentUnit unit = getDeploymentUnit(main, name);
     
      assertEquals(DeploymentStages.DESCRIBE, unit.getRequiredStage());
      assertEquals(DeploymentStages.DESCRIBE, main.getDeploymentStage(name));
     
      main.change(name, DeploymentStages.INSTALLED);
      assertEquals(DeploymentStages.INSTALLED, unit.getRequiredStage());
      assertEquals(DeploymentStages.INSTALLED, main.getDeploymentStage(name));
   }
View Full Code Here


      all.addRequiredInput(DeploymentStage.class.getName());
      assertTrue(all.getInputs().contains(DeploymentStage.class.getName()));

      TestSimpleDeployer empty = new TestSimpleDeployer();

      DeployerClient main = createMainDeployer(missing, all, empty);

      String name = "simple";
      Deployment deployment = createSimpleDeployment(name);

      MutableAttachments attachments = (MutableAttachments) deployment.getPredeterminedManagedObjects();
      attachments.addAttachment(DeploymentStage.class, DeploymentStages.DESCRIBE);

      Set<String> singleton;
      main.deploy(deployment);
      try
      {
         DeploymentUnit unit = getDeploymentUnit(main, name);
         singleton = Collections.singleton(unit.getName());

         assertEmpty(missing.getDeployedUnits());
         assertEquals(singleton, all.getDeployedUnits());
         assertEquals(singleton, empty.getDeployedUnits());
      }
      finally
      {
         main.undeploy(deployment);
      }

      assertEmpty(missing.getUndeployedUnits());
      assertEquals(singleton, all.getUndeployedUnits());
      assertEquals(singleton, empty.getUndeployedUnits());       
View Full Code Here

      super(name);
   }

   public void testNoRelativeOrderUsesSimpleName() throws Exception
   {
      DeployerClient main = getMainDeployer();
     
      Deployment parent = createSimpleDeployment("Parent");
      factory.addContext(parent, "C1");
      factory.addContext(parent, "C2");
      main.addDeployment(parent);

      main.process();

      assertEquals(PC1C2, deployer1.deployed);
      assertEquals(NONE, deployer1.undeployed);
     
      main.removeDeployment(parent);
      main.process();

      assertEquals(PC1C2, deployer1.deployed);
      assertEquals(C2C1P, deployer1.undeployed);
   }
View Full Code Here

      assertEquals(C2C1P, deployer1.undeployed);
   }

   public void testRelativeOrder() throws Exception
   {
      DeployerClient main = getMainDeployer();
     
      Deployment parent = createSimpleDeployment("Parent");
      ContextInfo c1 = factory.addContext(parent, "C1");
      c1.setRelativeOrder(2);
      ContextInfo c2 = factory.addContext(parent, "C2");
      c2.setRelativeOrder(1);
      main.addDeployment(parent);

      main.process();

      assertEquals(PC2C1, deployer1.deployed);
      assertEquals(NONE, deployer1.undeployed);
     
      main.removeDeployment(parent);
      main.process();

      assertEquals(PC2C1, deployer1.deployed);
      assertEquals(C1C2P, deployer1.undeployed);
   }
View Full Code Here

      assertEquals(C1C2P, deployer1.undeployed);
   }

   public void testComparator() throws Exception
   {
      DeployerClient main = getMainDeployer();
     
      AbstractDeployment parent = new AbstractDeployment("Parent");
      ContextInfo p = factory.addContext(parent, "");
      // Reverse the default comparison
      p.setComparatorClassName(TestDeploymentContextComparator.class.getName());
      factory.addContext(parent, "C1");
      factory.addContext(parent, "C2");
      main.addDeployment(parent);

      main.process();

      assertEquals(PC2C1, deployer1.deployed);
      assertEquals(NONE, deployer1.undeployed);
     
      main.removeDeployment(parent);
      main.process();

      assertEquals(PC2C1, deployer1.deployed);
      assertEquals(C1C2P, deployer1.undeployed);
   }
View Full Code Here

      super(name);
   }

   public void testDeployParentNoErrors() throws Exception
   {
      DeployerClient main = getMainDeployer();
     
      Deployment deployment = createSimpleDeployment(parentName);
      main.addDeployment(deployment);
      main.process();

      assertEquals(expectedParent, deployer1.getDeployedUnits());
      assertEquals(expectedNothing, deployer1.getUndeployedUnits());
      assertEquals(expectedParent, deployer2.getDeployedUnits());
      assertEquals(expectedNothing, deployer2.getUndeployedUnits());
      assertEquals(DeploymentState.DEPLOYED, main.getDeploymentState(deployment.getName()));
     
      main.removeDeployment(deployment);
      main.process();
      main.checkComplete();
   }
View Full Code Here

      main.checkComplete();
   }

   public void testDeployParentFailInParentDeployer1() throws Exception
   {
      DeployerClient main = getMainDeployer();
     
      Deployment deployment = createSimpleDeployment(parentName);
      makeFail(deployment, deployer1);
      main.addDeployment(deployment);
      main.process();

      assertEquals(expectedParent, deployer1.getDeployedUnits());
      assertEquals(expectedNothing, deployer1.getUndeployedUnits());
      assertEquals(expectedNothing, deployer2.getDeployedUnits());
      assertEquals(expectedNothing, deployer2.getUndeployedUnits());
      assertEquals(DeploymentState.ERROR, main.getDeploymentState(deployment.getName()));
     
      main.removeDeployment(deployment);
      main.process();
      main.checkComplete();
   }
View Full Code Here

      main.checkComplete();
   }

   public void testDeployParentFailInParentDeployer2() throws Exception
   {
      DeployerClient main = getMainDeployer();
     
      Deployment deployment = createSimpleDeployment(parentName);
      makeFail(deployment, deployer2);
      main.addDeployment(deployment);
      main.process();

      Set<String> expected = new HashSet<String>();
      expected.add(deployment.getName());
      assertEquals(expectedParent, deployer1.getDeployedUnits());
      assertEquals(expectedParent, deployer1.getUndeployedUnits());
      assertEquals(expectedParent, deployer2.getDeployedUnits());
      assertEquals(expectedNothing, deployer2.getUndeployedUnits());
      assertEquals(DeploymentState.ERROR, main.getDeploymentState(deployment.getName()));
     
      main.removeDeployment(deployment);
      main.process();
      main.checkComplete();
   }
View Full Code Here

      main.checkComplete();
   }

   public void testDeployParentOneChildNoErrors() throws Exception
   {
      DeployerClient main = getMainDeployer();
     
      Deployment deployment = createSimpleDeployment(parentName);
      addChild(deployment, childPath);
      main.addDeployment(deployment);
      main.process();

      assertEquals(expectedParentChild, deployer1.getDeployedUnits());
      assertEquals(expectedNothing, deployer1.getUndeployedUnits());
      assertEquals(expectedParentChild, deployer2.getDeployedUnits());
      assertEquals(expectedNothing, deployer2.getUndeployedUnits());
      assertEquals(DeploymentState.DEPLOYED, main.getDeploymentState(deployment.getName()));
      assertEquals(DeploymentState.DEPLOYED, main.getDeploymentState(childName));
     
      main.removeDeployment(deployment);
      main.process();
      main.checkComplete();
   }
View Full Code Here

      main.checkComplete();
   }
  
   public void testDeployParentOneChildFailInParentDeployer1() throws Exception
   {
      DeployerClient main = getMainDeployer();
     
      Deployment deployment = createSimpleDeployment(parentName);
      makeFail(deployment, deployer1);
      addChild(deployment, childPath);
      main.addDeployment(deployment);
      main.process();

      assertEquals(expectedParent, deployer1.getDeployedUnits());
      assertEquals(expectedNothing, deployer1.getUndeployedUnits());
      assertEquals(expectedNothing, deployer2.getDeployedUnits());
      assertEquals(expectedNothing, deployer2.getUndeployedUnits());
      assertEquals(DeploymentState.ERROR, main.getDeploymentState(deployment.getName()));
      assertEquals(DeploymentState.UNDEPLOYED, main.getDeploymentState(childName));
     
      main.removeDeployment(deployment);
      main.process();
      main.checkComplete();
   }
View Full Code Here

TOP

Related Classes of org.jboss.deployers.client.spi.DeployerClient

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.