assertEquals(6, deployer3.getUndeployOrder());
}
public void testDoubleCycle() throws Exception
{
DeployerClient main = createMainDeployer();
TestFlowDeployer deployer2 = new TestFlowDeployer("A");
deployer2.setInputs("test2");
addDeployer(main, deployer2);
TestFlowDeployer deployer3 = new TestFlowDeployer("B");
addDeployer(main, deployer3);
TestFlowDeployer deployer6 = new TestFlowDeployer("C");
deployer6.setInputs("2ndcycle");
addDeployer(main, deployer6);
TestFlowDeployer deployer1 = new TestFlowDeployer("D");
deployer1.setOutputs("test1");
addDeployer(main, deployer1);
TestFlowDeployer deployer4 = new TestFlowDeployer("E");
addDeployer(main, deployer4);
TestFlowDeployer deployer5 = new TestFlowDeployer("F");
deployer5.setInputs("test1");
deployer5.setOutputs("test2");
addDeployer(main, deployer5);
TestFlowDeployer deployer7 = new TestFlowDeployer("G");
addDeployer(main, deployer7);
TestFlowDeployer deployer8 = new TestFlowDeployer("H");
deployer8.setOutputs("2ndcycle");
addDeployer(main, deployer8);
Deployment deployment = createSimpleDeployment("DoubleCycle");
main.addDeployment(deployment);
main.process();
assertEquals(1, deployer3.getDeployOrder());
assertEquals(2, deployer8.getDeployOrder());
assertEquals(3, deployer6.getDeployOrder());
assertEquals(4, deployer1.getDeployOrder());
assertEquals(5, deployer4.getDeployOrder());
assertEquals(6, deployer5.getDeployOrder());
assertEquals(7, deployer2.getDeployOrder());
assertEquals(8, deployer7.getDeployOrder());
assertEquals(-1, deployer3.getUndeployOrder());
assertEquals(-1, deployer8.getUndeployOrder());
assertEquals(-1, deployer6.getUndeployOrder());
assertEquals(-1, deployer1.getUndeployOrder());
assertEquals(-1, deployer4.getUndeployOrder());
assertEquals(-1, deployer5.getUndeployOrder());
assertEquals(-1, deployer2.getUndeployOrder());
assertEquals(-1, deployer7.getUndeployOrder());
main.removeDeployment(deployment);
main.process();
assertEquals(1, deployer3.getDeployOrder());
assertEquals(2, deployer8.getDeployOrder());
assertEquals(3, deployer6.getDeployOrder());
assertEquals(4, deployer1.getDeployOrder());
assertEquals(5, deployer4.getDeployOrder());
assertEquals(6, deployer5.getDeployOrder());
assertEquals(7, deployer2.getDeployOrder());
assertEquals(8, deployer7.getDeployOrder());
assertEquals(16, deployer3.getUndeployOrder());
assertEquals(15, deployer8.getUndeployOrder());
assertEquals(14, deployer6.getUndeployOrder());
assertEquals(13, deployer1.getUndeployOrder());
assertEquals(12, deployer4.getUndeployOrder());
assertEquals(11, deployer5.getUndeployOrder());
assertEquals(10, deployer2.getUndeployOrder());
assertEquals(9, deployer7.getUndeployOrder());
main.addDeployment(deployment);
main.process();
assertEquals(17, deployer3.getDeployOrder());
assertEquals(18, deployer8.getDeployOrder());
assertEquals(19, deployer6.getDeployOrder());
assertEquals(20, deployer1.getDeployOrder());