Examples of TargetModuleIDImpl


Examples of org.jboss.deployment.spi.TargetModuleIDImpl

      {
         SerializableTargetModuleID id = children[n];
         String moduleID = id.getModuleID();
         boolean isRunning = id.isRunning();
         ModuleType type = ModuleType.getModuleType(id.getModuleType());
         TargetModuleIDImpl child = new TargetModuleIDImpl(this, moduleID, parent, isRunning, type);
         parent.addChildTargetModuleID(child);
         convertChildren(child, id);
      }
   }
View Full Code Here

Examples of org.jboss.deployment.spi.TargetModuleIDImpl

    *
    * @throws Exception
    */
   public void testListStartStopModules() throws Exception
   {
      TargetModuleIDImpl child = null;
      TargetModuleIDImpl parent = null;

      // Get the deployment manager and the distribution targets
      DeploymentManager manager = getDeploymentManager();
      Target[] targets = manager.getTargets();
      assertEquals(1, targets.length);

      TargetModuleID[] modules = manager.getRunningModules(ModuleType.EAR, manager.getTargets());
      assertNull("no modules Available", modules);

      ProgressObject parentProgress = jsr88Deployment("deployment-ear.ear");
      assertServletAccess("custom-context");
      assertEjbEchoAccess();

      modules = manager.getRunningModules(ModuleType.EAR, manager.getTargets());
      assertNotNull(modules);
      assertEquals("one EAR module in the server", modules.length, 1);

      parent = (TargetModuleIDImpl) modules[0];
      assertTrue("wrong state", parent.isRunning());
      assertEquals("wrong type", parent.getModuleType(), ModuleType.EAR);
      assertEquals("EAR module have a jar and a war", parent.getChildTargetModuleID().length, 2);

      child = (TargetModuleIDImpl) parent.getChildTargetModuleID()[0];
      assertTrue("wrong state", child.isRunning());
      assertTrue("wrong type", child.getModuleType().equals(ModuleType.EJB) || child.getModuleType().equals(ModuleType.WAR));
      assertEquals("child have no child", child.getChildTargetModuleID().length, 0);

      child = (TargetModuleIDImpl) parent.getChildTargetModuleID()[1];
      assertTrue("wrong state", child.isRunning());
      assertTrue("wrong type " + child.getModuleType(), child.getModuleType().equals(ModuleType.EJB) || child.getModuleType().equals(ModuleType.WAR));
      assertEquals("child have no child", child.getChildTargetModuleID().length, 0);

      parentProgress = manager.stop(new TargetModuleID[] { parent });
      waitForCompletion(parentProgress.getDeploymentStatus());

      modules = manager.getNonRunningModules(ModuleType.EAR, manager.getTargets());
      assertNotNull(modules);
      assertEquals("one EAR module in the server", modules.length, 1);

      parent = (TargetModuleIDImpl) modules[0];
      assertFalse("wrong state", parent.isRunning());
      assertEquals("wrong type", parent.getModuleType(), ModuleType.EAR);
      assertEquals("EAR module have a jar and a war", parent.getChildTargetModuleID().length, 2);

      parentProgress = manager.start(new TargetModuleID[]{ parent });
      waitForCompletion(parentProgress.getDeploymentStatus());

      modules = manager.getRunningModules(ModuleType.EAR, manager.getTargets());
      assertNotNull(modules);
      assertEquals("one EAR module in the server", modules.length, 1);

      parent = (TargetModuleIDImpl) modules[0];
      assertTrue("wrong state", parent.isRunning());
      assertEquals("wrong type", parent.getModuleType(), ModuleType.EAR);
      assertEquals("EAR module have a jar and a war", parent.getChildTargetModuleID().length, 2);
      parentProgress = manager.undeploy(new TargetModuleID[]{ parent });
      waitForCompletion(parentProgress.getDeploymentStatus());

      modules = manager.getAvailableModules(ModuleType.EAR, manager.getTargets());
      assertNull("EAR must not be available", modules);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.