Package org.jboss.deployers.client.spi

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


      assertContexts(deployment, context);
   }
  
   public void testAddContextPathAndMetaDataPathAndAndClassPathErrors()
   {
      DeploymentFactory factory = createDeploymentFactory();
      Deployment deployment = createDeployment();
      List<ClassPathEntry> classPath = factory.createClassPath("ClassPath");
      try
      {
         factory.addContext(null, "path", "metaData", classPath);
         fail("Should not be here");
      }
      catch (Exception e)
      {
         checkThrowable(IllegalArgumentException.class, e);
      }

      try
      {
         factory.addContext(deployment, null, "metaData", classPath);
         fail("Should not be here");
      }
      catch (Exception e)
      {
         checkThrowable(IllegalArgumentException.class, e);
      }

      try
      {
         factory.addContext(deployment, "path", (String)null, classPath);
         fail("Should not be here");
      }
      catch (Exception e)
      {
         checkThrowable(IllegalArgumentException.class, e);
View Full Code Here


      }
   }

   public void testAddContexts()
   {
      DeploymentFactory factory = createDeploymentFactory();
      Deployment deployment = createDeployment();
      ContextInfo context1 = factory.addContext(deployment, "path1");
      assertEquals("path1", context1.getPath());
      assertDefaultNonPath(context1);

      ContextInfo context2 = factory.addContext(deployment, "path2");
      assertEquals("path2", context2.getPath());
      assertDefaultNonPath(context1);

      ContextInfo context3 = factory.addContext(deployment, "path3");
      assertEquals("path3", context3.getPath());
      assertDefaultNonPath(context1);
     
      assertContexts(deployment, context1, context2, context3);
   }
View Full Code Here

      assertContexts(deployment, context1, context2, context3);
   }

   public void testAddContextsToContext()
   {
      DeploymentFactory factory = createDeploymentFactory();
      Deployment deployment = createDeployment();

      ContextInfo parent = factory.addContext(deployment, "parent");
      assertEquals("parent", parent.getPath());
      assertDefaultNonPath(parent);
     
      ContextInfo context1 = factory.addContext(parent, "path1");
      assertEquals("path1", context1.getPath());
      assertDefaultNonPath(context1);

      ContextInfo context2 = factory.addContext(parent, "path2");
      assertEquals("path2", context2.getPath());
      assertDefaultNonPath(context2);

      ContextInfo context3 = factory.addContext(parent, "path3");
      assertEquals("path3", context3.getPath());
      assertDefaultNonPath(context3);
     
      assertContexts(deployment, parent);
      assertContexts(parent, context1, context2, context3);
View Full Code Here

      assertContexts(parent, context1, context2, context3);
   }
  
   public void testSerialization() throws Exception
   {
      DeploymentFactory factory = createDeploymentFactory();
      Deployment deployment = createDeployment();

      List<ClassPathEntry> classPath = factory.createClassPath("ClassPath");
      ContextInfo context1 = factory.addContext(deployment, "path1", "metaDataPath", classPath);
      assertEquals("path1", context1.getPath());
      assertDefaultMetaDataPath(context1.getMetaDataPath());
      assertEquals(classPath, context1.getClassPath());
     
      StructureMetaData structure = assertStructureMetaData(deployment);
      assertContexts(structure, context1);
     
      deployment = serializeDeserialize(deployment, Deployment.class);
      structure = assertStructureMetaData(deployment);
      assertContexts(structure, context1);
     
      ContextInfo context2 = factory.addContext(deployment, "path2");
      assertEquals("path2", context2.getPath());
      assertDefaultNonPath(context2);
      structure = assertStructureMetaData(deployment);
      assertContexts(structure, context1, context2);

      deployment = serializeDeserialize(deployment, Deployment.class);
      structure = assertStructureMetaData(deployment);
      assertContexts(structure, context1, context2);

      ContextInfo testContext = structure.getContext("path2");
     
      ContextInfo child1 = factory.addContext(testContext, "child1");
      assertEquals("child1", child1.getPath());
      assertDefaultNonPath(child1);

      ContextInfo child2 = factory.addContext(testContext, "child2");
      assertEquals("child2", child2.getPath());
      assertDefaultNonPath(child2);
     
      ContextInfo child3 = factory.addContext(testContext, "child3");
      assertEquals("child3", child3.getPath());
      assertDefaultNonPath(child3);

      assertContexts(structure, context1, context2);
      StructureMetaData childStructure = assertStructureMetaData(testContext);
View Full Code Here

   protected VFSDeployment createDeployment(String name) throws Exception
   {
      URL url = getClass().getProtectionDomain().getCodeSource().getLocation();
      VirtualFile file = VFS.getRoot(url);
      VFSDeployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(file);
      DeploymentFactory factory = new DeploymentFactory();
      factory.addContext(deployment, "");
      ((AbstractDeployment) deployment).setName(name);
      return deployment;
   }
View Full Code Here

      super(name);
   }

   public void testNotVFSClassLoaderSmokeTest() throws Exception
   {
      DeploymentFactory factory = new DeploymentFactory();
     
      Deployment deployment = new AbstractDeployment("test");
      factory.addContext(deployment, "");
     
      DeployerClient main = assertBean("MainDeployer", DeployerClient.class);
      main.deploy(deployment);
      try
      {
View Full Code Here

      }
   }

   public void testVFSClassLoaderDependsOnVFS() throws Exception
   {
      DeploymentFactory factory = new DeploymentFactory();

      VFSDeploymentUnit unit5 = assertDeploy("/classloader", "deployment5");
      try
      {
         ClassLoader cl5 = getClassLoader(unit5);
         assertGetResource("a/b/c/test-resource-deployment5", cl5);
        
         Deployment deployment = new AbstractDeployment("test");
         factory.addContext(deployment, "");
         ClassLoadingMetaDataFactory clmdf = ClassLoadingMetaDataFactory.getInstance();
         ClassLoadingMetaData clmd = new ClassLoadingMetaData();
         clmd.getRequirements().addRequirement(clmdf.createRequireModule("test5"));
         ((MutableAttachments) deployment.getPredeterminedManagedObjects()).addAttachment(ClassLoadingMetaData.class, clmd);
        
View Full Code Here

      return new AbstractDeployment(getDeploymentName());
   }

   protected DeploymentFactory getDeploymentFactory()
   {
      return new DeploymentFactory();
   }
View Full Code Here

      Deployment deployment = createDeployment();
      StructureMetaData structure = StructureMetaDataFactory.createStructureMetaData();
      MutableAttachments attachments = (MutableAttachments) deployment.getPredeterminedManagedObjects();
      attachments.addAttachment(StructureMetaData.class, structure);

      DeploymentFactory factory = getDeploymentFactory();
      factory.addContext(deployment, "");
      return deployment;
   }
View Full Code Here

      StructureMetaData structure = StructureMetaDataFactory.createStructureMetaData();
      MutableAttachments attachments = (MutableAttachments) deployment.getPredeterminedManagedObjects();
      attachments.addAttachment(StructureMetaData.class, structure);
      attachments.addAttachment("test", "hello");

      DeploymentFactory factory = getDeploymentFactory();
      factory.addContext(deployment, "");
      return deployment;
   }
View Full Code Here

TOP

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

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.