}
public void testCorrectOrder() throws Exception
{
DeployerClient main = createMainDeployer();
TestSimpleDeployer deployer1 = new TestSimpleDeployer(1);
addDeployer(main, deployer1);
TestSimpleDeployer deployer2 = new TestSimpleDeployer(2);
addDeployer(main, deployer2);
Deployment deployment = createSimpleDeployment("correctOrder");
main.addDeployment(deployment);
main.process();
assertEquals(1, deployer1.getDeployOrder());
assertEquals(2, deployer2.getDeployOrder());
assertEquals(-1, deployer1.getUndeployOrder());
assertEquals(-1, deployer2.getUndeployOrder());
main.removeDeployment(deployment);
main.process();
assertEquals(1, deployer1.getDeployOrder());
assertEquals(2, deployer2.getDeployOrder());
assertEquals(4, deployer1.getUndeployOrder());
assertEquals(3, deployer2.getUndeployOrder());
main.addDeployment(deployment);
main.process();
assertEquals(5, deployer1.getDeployOrder());
assertEquals(6, deployer2.getDeployOrder());
assertEquals(4, deployer1.getUndeployOrder());
assertEquals(3, deployer2.getUndeployOrder());
}