Package org.jboss.deployers.client.spi

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


      main.process();
   }

   public void testPartialOverlapping() throws Exception
   {
      DeployerClient main = createMainDeployer();

      // "1", "2", are provided by other preceding deployers
      TestFlowDeployer deployer1 = new TestFlowDeployer( "#1_12-2345" );
      deployer1.setInputs( "1", "2" );
      deployer1.setOutputs( "3", "5", "2", "4" );
      addDeployer(main, deployer1);

      TestFlowDeployer deployer2 = new TestFlowDeployer( "#2_125-246" );
      deployer2.setInputs( "1", "5", "2" ); // depends on 5 (output of deployer1)
      deployer2.setOutputs( "6", "2", "4" );
      addDeployer(main, deployer2);

      TestFlowDeployer deployer3 = new TestFlowDeployer( "#3_1256-247" );
      deployer3.setInputs( "6", "1", "5", "2" ); // depends on 6 (output of deployer2) and 5 (output of deployer1)
      deployer3.setOutputs( "7", "2", "4" );
      addDeployer( main, deployer3 );

      TestFlowDeployer deployer4 = new TestFlowDeployer( "#4_124-28" );
      deployer4.setInputs( "1", "2", "4" ); // depends on 4 (output of deployer1, deployer2 and deployer3)
      deployer4.setOutputs( "8", "2" );
      addDeployer( main, deployer4 );

      Deployment deployment = createSimpleDeployment( "deployersOrderTest" );

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

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

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

      assertEquals(1, deployer1.getDeployOrder());
      assertEquals(2, deployer2.getDeployOrder());
      assertEquals(3, deployer3.getDeployOrder());
      assertEquals(4, deployer4.getDeployOrder());
      assertEquals(8, deployer1.getUndeployOrder());
      assertEquals(7, deployer2.getUndeployOrder());
      assertEquals(6, deployer3.getUndeployOrder());
      assertEquals(5, deployer4.getUndeployOrder());

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

      assertEquals(9, deployer1.getDeployOrder());
      assertEquals(10, deployer2.getDeployOrder());
      assertEquals(11, deployer3.getDeployOrder());
      assertEquals(12, deployer4.getDeployOrder());
      assertEquals(8, deployer1.getUndeployOrder());
      assertEquals(7, deployer2.getUndeployOrder());
      assertEquals(6, deployer3.getUndeployOrder());
      assertEquals(5, deployer4.getUndeployOrder());

      main.removeDeployment(deployment);
      main.process();
   }
View Full Code Here


    * All dependencies are specified using inputs/outputs.
    */
   public void testAlgorithmPerformance() throws Exception
   {

      DeployerClient main = createMainDeployer();
      TestFlowDeployer deployer;
      final int COUNT_OF_DEPLOYERS = 500;

      List<TestFlowDeployer> deployers = new LinkedList<TestFlowDeployer>();

      for (int i = 0; i < COUNT_OF_DEPLOYERS; i++)
      {
         deployer = new TestFlowDeployer( String.valueOf(i) );
         deployer.setOutputs( String.valueOf(i) );
         for (int j = 0; j < i; j++) deployer.addInput( String.valueOf(j) );
         deployers.add(deployer);
      }

      long start = System.currentTimeMillis();
      for (TestFlowDeployer d : deployers)
      {
         addDeployer(main, d);
      }
      long end = System.currentTimeMillis();

      System.out.println("------------------------------------------------------------------------");
      System.out.println("Exhaustive deployer sorting 1 (" + getClass().getSimpleName() ") took: " + (end - start) + " milliseconds");
      System.out.println("------------------------------------------------------------------------");

      // test proper deployers order
      Deployment deployment = createSimpleDeployment( "exhaustiveDeployersOrderTest" );

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

      for (int i = 0; i < COUNT_OF_DEPLOYERS; i++)
      {
         deployer = deployers.get(i);
         assertEquals(i + 1, deployer.getDeployOrder());
         assertEquals(-1, deployer.getUndeployOrder());
      }

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

      for (int i = 0; i < COUNT_OF_DEPLOYERS; i++)
      {
         deployer = deployers.get(i);
         assertEquals(i + 1, deployer.getDeployOrder());
View Full Code Here

    * where vertex in this graph is represented as set of deployers.
    * Deployers that are in specific vertex are ordered using deployer ordering feature.
    */
   public void testAlgorithmPerformance2() throws Exception
   {
      DeployerClient main = createMainDeployer();
      TestFlowDeployer deployer;
      final int COUNT_OF_DEPLOYERS = 1000;
      final int MODULO = 50; // count of deployers in particular vertex

      List<TestFlowDeployer> deployers = new LinkedList<TestFlowDeployer>();

      for (int i = 0; i < COUNT_OF_DEPLOYERS; i++)
      {
         deployer = new TestFlowDeployer( String.valueOf(i) );
         deployer.setOutputs( String.valueOf(i / MODULO) );
         deployer.setRelativeOrder(i % MODULO);
         for (int j = 0; j < i/MODULO; j++)
            deployer.addInput( String.valueOf(j) );

         deployers.add(deployer);
      }

      long start = System.currentTimeMillis();
      for (TestFlowDeployer d : deployers)
      {
         addDeployer(main, d);
      }
      long end = System.currentTimeMillis();

      System.out.println("------------------------------------------------------------------------");
      System.out.println("Exhaustive deployer sorting 2 (" + getClass().getSimpleName() ") took: " + (end - start) + " milliseconds");
      System.out.println("------------------------------------------------------------------------");

      // test proper deployers order
      Deployment deployment = createSimpleDeployment( "exhaustiveDeployersOrderTest" );

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

      int deployerDeployOrder;
      int deployerUndeployOrder;
      int deployerDeployOrderInModulo;
      int deployerUndeployOrderInModulo;
      int level;
      for (int i = 0; i < COUNT_OF_DEPLOYERS; i++)
      {
         level = i / MODULO;
         deployer = deployers.get(i);
         deployerDeployOrder = deployer.getDeployOrder();
         deployerDeployOrderInModulo = (deployerDeployOrder - 1) / MODULO;
         deployerUndeployOrder = deployer.getUndeployOrder();
         assertTrue("Wrong deployer(" + i + ") deploy order: " + deployerDeployOrder, level <= deployerDeployOrderInModulo && deployerDeployOrderInModulo < (level + 1));
         assertEquals(i + 1, deployerDeployOrder); // remove if [JBDEPLOY-233] will be fixed
         assertEquals(-1, deployerUndeployOrder);
      }

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

      for (int i = 0; i < COUNT_OF_DEPLOYERS; i++)
      {
         level = i / MODULO;
         deployer = deployers.get(i);
View Full Code Here

   }

   public void testRealWorldAS6DeployersScenario() throws Exception
   {
      // THIS IS REAL WORLD SCENARIO - AS deployers with their dependencies
      DeployerClient main = createMainDeployer();
      AbstractDeployer deployer;
      long start = System.currentTimeMillis();

      // PARSE
View Full Code Here

      return suite(CycleCheckCompleteTestCase.class);
   }

   public void testOtherAsCause() throws Exception
   {
      DeployerClient main = getMainDeployer();

      Deployment dA = createSimpleDeployment("A");
      addAttachment(dA, "xB", true);
      addAttachment(dA, "xC", false);

      Deployment dB = createSimpleDeployment("B");
      addAttachment(dB, "xA", true);
      addAttachment(dB, "xC", false);
      addAttachment(dB, "xD", false);

      Deployment dC = createSimpleDeployment("C");
      addAttachment(dC, null, true);

      Deployment dD = createSimpleDeployment("D");
      addAttachment(dD, null, true);

      try
      {
         main.deploy(dA, dB, dC, dD);
         fail("Should not be here.");
      }
      catch (DeploymentException e)
      {
         IncompleteDeploymentException ide = assertInstanceOf(e, IncompleteDeploymentException.class);
View Full Code Here

      deployer.clear();
   }

   public void testFailedDeployOnStructure() throws Throwable
   {
      DeployerClient main = getMainDeployer();
      checkFailedDeployOnStructure(main, 0, 3);
      checkFailedDeployOnStructure(main, 1, 3);
      checkFailedDeployOnStructure(main, 2, 3);
   }
View Full Code Here

      deployer.clear();
   }

   public void testFailedDeploy() throws Throwable
   {
      DeployerClient main = getMainDeployer();
      checkFailedDeploy(main, 0, 3);
      checkFailedDeploy(main, 1, 3);
      checkFailedDeploy(main, 2, 3);
   }
View Full Code Here

      checkFailedDeploy(main, 2, 3);
   }

   public void testRedeploy() throws Throwable
   {
      DeployerClient main = getMainDeployer();

      Deployment context = createSimpleDeployment("redeploy");
      main.deploy(context);
      List<String> expected = new ArrayList<String>();
      expected.add(context.getName());
      assertEquals(expected, deployer.getDeployedUnits());

      main.undeploy(context);
      assertEquals(expected, deployer.getUndeployedUnits());

      deployer.clear();
      main.deploy(context);
      expected.clear();
      expected.add(context.getName());
      assertEquals(expected, deployer.getDeployedUnits());
   }
View Full Code Here

      assertEquals(expected, deployer.getDeployedUnits());
   }

   public void testDeployRemoveProcess() throws Throwable
   {
      DeployerClient main = getMainDeployer();

      Deployment context = createSimpleDeployment("drp");
      main.deploy(context);
      List<String> expected = new ArrayList<String>();
      expected.add(context.getName());
      assertEquals(expected, deployer.getDeployedUnits());

      main.removeDeployment(context);
      main.process();
      assertEquals(expected, deployer.getUndeployedUnits());
   }
View Full Code Here

      assertEquals(expected, deployer.getUndeployedUnits());
   }

   public void testAddProcessUndeploy() throws Throwable
   {
      DeployerClient main = getMainDeployer();

      Deployment context = createSimpleDeployment("apu");
      main.addDeployment(context);
      main.process();
      List<String> expected = new ArrayList<String>();
      expected.add(context.getName());
      assertEquals(expected, deployer.getDeployedUnits());

      main.undeploy(context);
      assertEquals(expected, deployer.getUndeployedUnits());
   }
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.