public void testDeployersOrder1() throws Exception
{
DeployerClient main = createMainDeployer();
TestFlowDeployer deployer6 = new TestFlowDeployer( "6" );
deployer6.setInputs( "a11", "a12", "a13", "a14", "a33" );
addDeployer(main, deployer6);
TestFlowDeployer deployer5 = new TestFlowDeployer( "5" );
deployer5.setInputs( "a21", "a33", "a41" );
deployer5.setOutputs( "a33", "a51", "a52" );
addDeployer(main, deployer5);
TestFlowDeployer deployer4 = new TestFlowDeployer( "4" );
deployer4.setInputs( "a14", "a33" );
deployer4.setOutputs( "a14", "a33", "a41" );
addDeployer( main, deployer4 );
TestFlowDeployer deployer3 = new TestFlowDeployer( "3" );
deployer3.setInputs( "a13", "a21" );
deployer3.setOutputs( "a32", "a33" );
addDeployer( main, deployer3 );
TestFlowDeployer deployer2 = new TestFlowDeployer( "2" );
deployer2.setInputs( "a11", "a12" );
deployer2.setOutputs( "a12", "a21", "a22" );
addDeployer( main, deployer2 );
TestFlowDeployer deployer1 = new TestFlowDeployer( "1" );
deployer1.setOutputs( "a11", "a12", "a13", "a14" );
addDeployer( main, deployer1 );
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(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());
assertEquals(17, deployer5.getDeployOrder());
assertEquals(18, 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());