Package org.jboss.deployers.client.spi

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


      assertEquals(AB, deployer3.undeployed);
   }

   public void testADependsOnBAtClassLoaderRedeployA() throws Exception
   {
      DeployerClient main = getMainDeployer();
     
      Deployment a = createSimpleDeployment("A");
      TestDependencyMetaData depA = new TestDependencyMetaData("A");
      depA.addDependencyItem("B", DeploymentStages.CLASSLOADER);
      addMetaData(a, depA);
      main.addDeployment(a);

      Deployment b = createSimpleDeployment("B");
      main.addDeployment(b);

      main.process();

      assertEquals(AB, deployer1.deployed);
      assertEquals(NONE, deployer1.undeployed);
      assertEquals(BA, deployer2.deployed);
      assertEquals(NONE, deployer2.undeployed);
      assertEquals(BA, deployer3.deployed);
      assertEquals(NONE, deployer3.undeployed);
     
      main.removeDeployment(a);
      main.process();
     
      main.addDeployment(a);
      main.process();

      assertEquals(ABA, deployer1.deployed);
      assertEquals(A, deployer1.undeployed);
      assertEquals(BAA, deployer2.deployed);
      assertEquals(A, deployer2.undeployed);
View Full Code Here


      // create the real deployer which will then use the visitor to filter out
      // deployment units
      ExactAttachmentDeployerWithVisitor<String> deployer = new ExactAttachmentDeployerWithVisitor<String>(visitor.getVisitorTypeName(), visitor);
      // Create the main deployer which will be responsible for processing the deployment
      // unit through various stages
      DeployerClient mainDeployer = createMainDeployer(deployer);

      // some name to the deployment and create a deployment out of it
      String deploymentName = "test-deployment";
      Deployment deployment = createSimpleDeployment(deploymentName);
      MutableAttachments attachments = (MutableAttachments) deployment.getPredeterminedManagedObjects();
     
      // Jaikiran's deleted comment ;-)
      attachments.addAttachment(String.class.getName(), "IHaveNoClueWhyTheSetInputAPIWorksTheWayItDoes");
     
      // add the attachment so that this unit will be picked up by the visitor
      attachments.addAttachment(attachmentName, "Test123");

      log.debug("Deploying " + deployment);
      // deploy the deployment
      mainDeployer.deploy(deployment);

      // get the processed deployment unit
      DeploymentUnit unit = getDeploymentUnit(mainDeployer, deploymentName);

      // the processed unit is expected to contain the "processed" attachment which
View Full Code Here

      // create the real deployer which will then use the visitor to filter out
      // deployment units
      ExactAttachmentDeployerWithVisitor<String> deployer = new ExactAttachmentDeployerWithVisitor<String>(visitor.getVisitorTypeName(), visitor);
      // Create the main deployer which will be responsible for processing the deployment
      // unit through various stages
      DeployerClient mainDeployer = createMainDeployer(deployer);

      // some name to the deployment and create a deployment out of it
      String deploymentName = "test-deployment";
      Deployment deployment = createSimpleDeployment(deploymentName);
      MutableAttachments attachments = (MutableAttachments) deployment.getPredeterminedManagedObjects();

      // Jaikiran's deleted comment ;-)
      attachments.addAttachment(String.class.getName(), "IHaveNoClueWhyTheSetInputAPIWorksTheWayItDoes");
     
      // add the attachment which the visitor is NOT interested in
      attachments.addAttachment("ADifferentAttachment", "Test123");

      log.debug("Deploying " + deployment);
      // deploy the deployment
      mainDeployer.deploy(deployment);

      // get the processed deployment unit
      DeploymentUnit unit = getDeploymentUnit(mainDeployer, deploymentName);

      // its expected that the visitor will NOT process this unit, since the
View Full Code Here

      assertEquals(A, deployer3.undeployed);
   }

   public void testADependsOnBAtClassLoaderWhichFailsInInstall() throws Exception
   {
      DeployerClient main = getMainDeployer();
     
      Deployment a = createSimpleDeployment("A");
      TestDependencyMetaData depA = new TestDependencyMetaData("A");
      depA.addDependencyItem("B", DeploymentStages.CLASSLOADER);
      addMetaData(a, depA);
      main.addDeployment(a);

      Deployment b = createSimpleDeployment("B");
      makeFail(b, deployer3);
      main.addDeployment(b);

      main.process();

      assertEquals(AB, deployer1.deployed);
      assertEquals(B, deployer1.undeployed);
      assertEquals(B, deployer2.deployed);
      assertEquals(B, deployer2.undeployed);
View Full Code Here

      assertEquals(NONE, deployer3.undeployed);
   }

   public void testADependsOnBAtInstallCorrectOrder() throws Exception
   {
      DeployerClient main = getMainDeployer();
     
      Deployment a = createSimpleDeployment("A");
      TestDependencyMetaData depA = new TestDependencyMetaData("A");
      depA.addDependencyItem("B", DeploymentStages.INSTALLED);
      addMetaData(a, depA);
      main.addDeployment(a);

      Deployment b = createSimpleDeployment("B");
      main.addDeployment(b);

      main.process();

      assertEquals(AB, deployer1.deployed);
      assertEquals(NONE, deployer1.undeployed);
      assertEquals(AB, deployer2.deployed);
      assertEquals(NONE, deployer2.undeployed);
View Full Code Here

      assertEquals(NONE, deployer3.undeployed);
   }

   public void testADependsOnBAtInstallWrongOrder() throws Exception
   {
      DeployerClient main = getMainDeployer();
     
      Deployment a = createSimpleDeployment("A");
      TestDependencyMetaData depA = new TestDependencyMetaData("A");
      depA.addDependencyItem("B", DeploymentStages.INSTALLED);
      addMetaData(a, depA);
      main.addDeployment(a);

      main.process();

      assertEquals(A, deployer1.deployed);
      assertEquals(A, deployer2.deployed);
      assertEquals(NONE, deployer3.deployed);

      Deployment b = createSimpleDeployment("B");
      main.addDeployment(b);

      main.process();

      assertEquals(AB, deployer1.deployed);
      assertEquals(NONE, deployer1.undeployed);
      assertEquals(AB, deployer2.deployed);
      assertEquals(NONE, deployer2.undeployed);
View Full Code Here

      return suite(InMemoryClasesUnitTestCase.class);
   }

   public void testInMemory() throws Exception
   {
      DeployerClient mainDeployer = getMainDeployer();
      MainDeployerStructure main = (MainDeployerStructure) mainDeployer;

      Version v1 = Version.parseVersion("1");

      Deployment ad = createDeployment("A");
      ClassLoadingMetaData clmd = addClassLoadingMetaData(ad, v1, true, A.class);
      clmd.setBlackListable(false);
      assertDeploy(mainDeployer, ad);

      VFSDeploymentUnit unit = (VFSDeploymentUnit) main.getDeploymentUnit("A");
      VirtualFile file = unit.getAttachment(InMemoryClassesDeployer.DYNAMIC_CLASS_KEY, VirtualFile.class);
      assertNotNull(file);
      assertTrue("dynamic classes should be in the classpath", unit.getClassPath().contains(file));

      URL root = unit.getAttachment(InMemoryClassesDeployer.DYNAMIC_CLASS_URL_KEY, URL.class);
      assertNotNull(root);
     
      String aPackage = A.class.getPackage().getName();
      aPackage = aPackage.replace(".", "/");
      String resourceName = aPackage + "/TestInMemory";
      URL testResource = new URL(root, resourceName);
      ClassLoader cl = unit.getClassLoader();
      assertNull(cl.getResource(resourceName));
     
      byte[] bytes = new byte[0];
      MemoryFileFactory.putFile(testResource, bytes);
      URL resource = cl.getResource(resourceName);
      assertNotNull(resource);
      // dunno why direct URL equals fails?
      assertEquals(testResource.toExternalForm(), resource.toExternalForm());
     
      mainDeployer.undeploy(ad);
      mainDeployer.checkComplete();
      assertFalse("dynamic classes should NOT be in the classpath", unit.getClassPath().contains(file));
   }
View Full Code Here

      assertFalse("dynamic classes should NOT be in the classpath", unit.getClassPath().contains(file));
   }

   public void testHostNameCreator() throws Exception
   {
      DeployerClient mainDeployer = getMainDeployer();
      MainDeployerStructure main = (MainDeployerStructure) mainDeployer;

      Deployment ad = createDeployment("A");
      Version v1 = Version.parseVersion("1");
      ClassLoadingMetaData clmd = addClassLoadingMetaData(ad, v1, true, A.class);
View Full Code Here

      assertEquals(NONE, deployer3.undeployed);
   }

   public void testADependsOnBAtInstallUndeployANoB() throws Exception
   {
      DeployerClient main = getMainDeployer();
     
      Deployment a = createSimpleDeployment("A");
      TestDependencyMetaData depA = new TestDependencyMetaData("A");
      depA.addDependencyItem("B", DeploymentStages.INSTALLED);
      addMetaData(a, depA);
      main.addDeployment(a);

      main.process();

      assertEquals(A, deployer1.deployed);
      assertEquals(NONE, deployer1.undeployed);
      assertEquals(A, deployer2.deployed);
      assertEquals(NONE, deployer2.undeployed);
      assertEquals(NONE, deployer3.deployed);
      assertEquals(NONE, deployer3.undeployed);
     
      main.removeDeployment(a);
      main.process();

      assertEquals(A, deployer1.deployed);
      assertEquals(A, deployer1.undeployed);
      assertEquals(A, deployer2.deployed);
      assertEquals(A, deployer2.undeployed);
View Full Code Here

      assertEquals(NONE, deployer3.undeployed);
   }

   public void testADependsOnBAtInstallUndeployB() throws Exception
   {
      DeployerClient main = getMainDeployer();
     
      Deployment a = createSimpleDeployment("A");
      TestDependencyMetaData depA = new TestDependencyMetaData("A");
      depA.addDependencyItem("B", DeploymentStages.INSTALLED);
      addMetaData(a, depA);
      main.addDeployment(a);

      Deployment b = createSimpleDeployment("B");
      main.addDeployment(b);

      main.process();

      assertEquals(AB, deployer1.deployed);
      assertEquals(NONE, deployer1.undeployed);
      assertEquals(AB, deployer2.deployed);
      assertEquals(NONE, deployer2.undeployed);
      assertEquals(BA, deployer3.deployed);
      assertEquals(NONE, deployer3.undeployed);
     
      main.removeDeployment(b);
      main.process();

      assertEquals(AB, deployer1.deployed);
      assertEquals(B, deployer1.undeployed);
      assertEquals(AB, deployer2.deployed);
      assertEquals(B, deployer2.undeployed);
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.