assertEquals(4, deployer3.getUndeployOrder());
}
public void testComplicated() throws Exception
{
DeployerClient main = createMainDeployer();
TestFlowDeployer deployer6 = new TestFlowDeployer("6");
deployer6.setInputs("test1", "test3");
addDeployer(main, deployer6);
TestFlowDeployer deployer5 = new TestFlowDeployer("5");
deployer5.setInputs("test3");
deployer5.setOutputs("test3");
addDeployer(main, deployer5);
TestFlowDeployer deployer4 = new TestFlowDeployer("4");
deployer4.setInputs("test2");
deployer4.setOutputs("test3");
addDeployer(main, deployer4);
TestFlowDeployer deployer3 = new TestFlowDeployer("3");
deployer3.setOutputs("test2");
addDeployer(main, deployer3);
TestFlowDeployer deployer2 = new TestFlowDeployer("2");
deployer2.setOutputs("test1");
addDeployer(main, deployer2);
TestFlowDeployer deployer1 = new TestFlowDeployer("1");
deployer1.setOutputs("test1");
addDeployer(main, deployer1);
Deployment deployment = createSimpleDeployment("Complicated");
main.addDeployment(deployment);
main.process();
assertEquals(1, deployer1.getDeployOrder());
assertEquals(2, deployer2.getDeployOrder());
assertEquals(3, deployer3.getDeployOrder());
assertEquals(4, deployer4.getDeployOrder());
assertEquals(5, deployer5.getDeployOrder());
assertEquals(6, deployer6.getDeployOrder());
assertEquals(-1, deployer1.getUndeployOrder());
assertEquals(-1, deployer2.getUndeployOrder());
assertEquals(-1, deployer3.getUndeployOrder());
assertEquals(-1, deployer4.getUndeployOrder());
assertEquals(-1, deployer5.getUndeployOrder());
assertEquals(-1, deployer6.getUndeployOrder());
main.removeDeployment(deployment);
main.process();
assertEquals(1, deployer1.getDeployOrder());
assertEquals(2, deployer2.getDeployOrder());
assertEquals(3, deployer3.getDeployOrder());
assertEquals(4, deployer4.getDeployOrder());
assertEquals(5, deployer5.getDeployOrder());
assertEquals(6, deployer6.getDeployOrder());
assertEquals(12, deployer1.getUndeployOrder());
assertEquals(11, deployer2.getUndeployOrder());
assertEquals(10, deployer3.getUndeployOrder());
assertEquals(9, deployer4.getUndeployOrder());
assertEquals(8, deployer5.getUndeployOrder());
assertEquals(7, deployer6.getUndeployOrder());
main.addDeployment(deployment);
main.process();
assertEquals(13, deployer1.getDeployOrder());
assertEquals(14, deployer2.getDeployOrder());
assertEquals(15, deployer3.getDeployOrder());
assertEquals(16, deployer4.getDeployOrder());