Package org.jboss.deployers.client.spi

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


      );

      Object bootstrap;
      String duSimpleName = null;
      Deployment deployment = createVFSDeployment(ear);
      DeployerClient mainDeployer = getDeployerClient();
      mainDeployer.addDeployment(deployment);
      mainDeployer.process();
      ControllerContext wbContext = null;
      try
      {
         DeploymentUnit earDU = getMainDeployerStructure().getDeploymentUnit(deployment.getName());
         String bootName = DeployersUtils.getBootstrapBeanName(earDU);
         bootstrap = getBean(bootName, null);
         assertInstanceOf(bootstrap, "org.jboss.test.deployers.support.CheckableBootstrap", earDU.getClassLoader());
         // waiting on ejb
         assertTrue(invoke(bootstrap, "Create"));
         assertFalse(invoke(bootstrap, "Boot")); // not yet booted
         assertFalse(invoke(bootstrap, "Shutdown"));
         // install ejb
         KernelControllerContext ejb = deploy(new AbstractBeanMetaData("EjbContainer#1", Object.class.getName()));
         try
         {
            assertTrue(ejb.getState().equals(ControllerState.INSTALLED));
            /// check boot
            assertTrue(invoke(bootstrap, "Create"));
            assertTrue(invoke(bootstrap, "Boot"));
            assertFalse(invoke(bootstrap, "Shutdown"));

            // test jndi binding
            duSimpleName = earDU.getSimpleName();
            Context context = assertInstanceOf(bmContext.lookup(duSimpleName), Context.class, false);
            assertSame("Bootstrap Dummy", context.lookup("bootstrap"));

            Class<?> wbClass = earDU.getClassLoader().loadClass("org.jboss.test.deployers.support.CheckableBootstrap");
            wbContext = controller.getContextByClass(wbClass);
            assertNotNull(wbContext);
            assertSame(bootstrap, wbContext.getTarget());
         }
         finally
         {
            undeploy(ejb);
         }
      }
      finally
      {
         mainDeployer.removeDeployment(deployment);
         mainDeployer.process();

         // clear binding
         assertNull(bmContext.lookup(duSimpleName));

         // clear context 2 class mapping
View Full Code Here


      createAssembledDirectory(top)
         .addPath("/weld/mcandweld/ear/mconly");
      createMcLib(top, "/weld/mcandweld/mc/simple", SimpleBean.class);
     
      Deployment deployment = createVFSDeployment(top);
      DeployerClient mainDeployer = getDeployerClient();
      mainDeployer.addDeployment(deployment);
      mainDeployer.process();
      try
      {
         Object o = getBean("SimpleBean");
         assertNotNull(o);
      }
      finally
      {
         mainDeployer.removeDeployment(deployment);
         mainDeployer.process();
      }
   }
View Full Code Here

   protected Deployment deploy(VirtualFile ear) throws Exception
   {
      Deployment deployment = createVFSDeployment(ear);
     
      DeployerClient mainDeployer = getDeployerClient();
      mainDeployer.addDeployment(deployment);
      mainDeployer.process();
      return deployment;
   }
View Full Code Here

      return deployment;
   }
  
   protected void undeploy(Deployment deployment) throws Exception
   {
      DeployerClient mainDeployer = getDeployerClient();
      mainDeployer.removeDeployment(deployment);
      mainDeployer.process();
     
   }
View Full Code Here

      return suite(McIntegrationNoBootstrapBeanTestCase.class);
   }
  
   public void testUninstallOfIntermediateBeanIfBeanManagerWasNotInstalled() throws Throwable
   {
      DeployerClient mainDeployer = getDeployerClient();
      VirtualFile ear = VFS.getChild("top-level.ear");
      createAssembledDirectory(ear)
         .addPath("/weld/mcandweld/ear/weldandmc");
      createMcLib(ear, "/weld/mcandweld/mc/nobootstrap", SimpleBeanWithSimpleWebBean.class);
      createWeldLib(ear, "/weld/mcandweld/weld", SimpleWebBean.class);
     
      Deployment deployment = createVFSDeployment(ear);
      String installerName = deployment.getName() + "BootstrapBeanInstaller=SimpleBean";

      mainDeployer.addDeployment(deployment);
      mainDeployer.process();
      try
      {
         DeploymentUnit earDU = getMainDeployerStructure().getDeploymentUnit(deployment.getName());

         //Check that the flat deployment bean has been started
         FlatDeployment flatDeployment = (FlatDeployment)getBean(DeployersUtils.getDeploymentBeanName(earDU));
         assertNotNull(flatDeployment);

         //Check that the simple bean installer has been created
         ControllerContext ctx = getControllerContext(installerName,  null);
         assertNotNull(ctx);
         //Check the simple bean itself has not been created
         assertNoControllerContext("SimpleBean", null);
      }
      finally
      {
         getLog().debug("============== Undeploying everything");
         mainDeployer.removeDeployment(deployment);
         mainDeployer.process();
      }
      assertNoControllerContext(installerName, null);
      assertNoControllerContext("SimpleBean", null);
   }
View Full Code Here

   protected void testDeployment(VirtualFile app) throws Exception
   {
      Deployment deployment = createVFSDeployment(app);

      DeployerClient mainDeployer = getDeployerClient();
      mainDeployer.addDeployment(deployment);
      mainDeployer.process();
      try
      {
         DeploymentUnit du = getMainDeployerStructure().getDeploymentUnit(deployment.getName());
         ControllerContext context = du.getAttachment(ControllerContext.class);
         assertNotNull(context);
         assertEquals(ControllerState.INSTALLED, context.getState());

         // There should be no WB bootstrap bean
         assertNoBean(DeployersUtils.getBootstrapBeanName(du), null);
      }
      finally
      {
         mainDeployer.removeDeployment(deployment);
         mainDeployer.process();
      }
   }
View Full Code Here

   protected void testIsolation(VirtualFile fst, String inFst, VirtualFile snd, String inSnd) throws Exception
   {
      Deployment deployment1 = createVFSDeployment(fst);
      Deployment deployment2 = createVFSDeployment(snd);

      DeployerClient mainDeployer = getDeployerClient();
      mainDeployer.addDeployment(deployment1);
      mainDeployer.addDeployment(deployment2);
      mainDeployer.process();
      try
      {
         DeploymentUnit du1 = getMainDeployerStructure().getDeploymentUnit(deployment1.getName());
         assertLoadClass(inFst, du1.getClassLoader());
         assertClassNotFound(inSnd, du1);

         DeploymentUnit du2 = getMainDeployerStructure().getDeploymentUnit(deployment2.getName());
         assertLoadClass(inSnd, du2.getClassLoader());
         assertClassNotFound(inFst, du2);
      }
      finally
      {
         mainDeployer.removeDeployment(deployment2);
         mainDeployer.removeDeployment(deployment1);
         mainDeployer.process();
      }
   }
View Full Code Here

      TestFlowDeployer.reset();
   }

   public void testSimpleInputOutputCorrectOrder() throws Exception
   {
      DeployerClient main = createMainDeployer();
      TestFlowDeployer deployer1 = new TestFlowDeployer("1");
      deployer1.setOutputs("test");
      addDeployer(main, deployer1);
      TestFlowDeployer deployer2 = new TestFlowDeployer("2");
      deployer2.setInputs("test");
      addDeployer(main, deployer2);

      Deployment deployment = createSimpleDeployment("correctOrder");
      main.addDeployment(deployment);
      main.process();

      assertEquals(1, deployer1.getDeployOrder());
      assertEquals(2, deployer2.getDeployOrder());
      assertEquals(-1, deployer1.getUndeployOrder());
      assertEquals(-1, deployer2.getUndeployOrder());

      main.removeDeployment(deployment);
      main.process();

      assertEquals(1, deployer1.getDeployOrder());
      assertEquals(2, deployer2.getDeployOrder());
      assertEquals(4, deployer1.getUndeployOrder());
      assertEquals(3, deployer2.getUndeployOrder());

      main.addDeployment(deployment);
      main.process();

      assertEquals(5, deployer1.getDeployOrder());
      assertEquals(6, deployer2.getDeployOrder());
      assertEquals(4, deployer1.getUndeployOrder());
      assertEquals(3, deployer2.getUndeployOrder());
View Full Code Here

      assertEquals(3, deployer2.getUndeployOrder());
   }

   public void testSimpleInputOutputWrongOrder() throws Exception
   {
      DeployerClient main = createMainDeployer();
      TestFlowDeployer deployer2 = new TestFlowDeployer("2");
      deployer2.setInputs("test");
      addDeployer(main, deployer2);
      TestFlowDeployer deployer1 = new TestFlowDeployer("1");
      deployer1.setOutputs("test");
      addDeployer(main, deployer1);

      Deployment deployment = createSimpleDeployment("wrongOrder");
      main.addDeployment(deployment);
      main.process();

      assertEquals(1, deployer1.getDeployOrder());
      assertEquals(2, deployer2.getDeployOrder());
      assertEquals(-1, deployer1.getUndeployOrder());
      assertEquals(-1, deployer2.getUndeployOrder());

      main.removeDeployment(deployment);
      main.process();

      assertEquals(1, deployer1.getDeployOrder());
      assertEquals(2, deployer2.getDeployOrder());
      assertEquals(4, deployer1.getUndeployOrder());
      assertEquals(3, deployer2.getUndeployOrder());

      main.addDeployment(deployment);
      main.process();

      assertEquals(5, deployer1.getDeployOrder());
      assertEquals(6, deployer2.getDeployOrder());
      assertEquals(4, deployer1.getUndeployOrder());
      assertEquals(3, deployer2.getUndeployOrder());
View Full Code Here

      assertEquals(3, deployer2.getUndeployOrder());
   }

   public void testInputOutputLoop() throws Exception
   {
      DeployerClient main = createMainDeployer();
      TestFlowDeployer deployer1 = new TestFlowDeployer("1");
      deployer1.setInputs("input1");
      deployer1.setOutputs("output1");
      addDeployer(main, deployer1);
      TestFlowDeployer deployer2 = new TestFlowDeployer("2");
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.