addDeployer(main, postWMD);
}
public void testWebServicesDeployersOrder() throws Exception
{
DeployerClient main = createMainDeployer();
TestFlowDeployer deployer1 = new TestFlowDeployer("FakeDeployer");
deployer1.setOutputs("WebServicesMetaData", "WebServiceDeployment", "JBossWebMetaData" );
addDeployer(main, deployer1);
TestFlowDeployer deployer2 = new TestFlowDeployer("WebServicesDeploymentTypeDeployer");
deployer2.setInputs("WebServicesMetaData", "WebServiceDeployment", "JBossWebMetaData" );
deployer2.setOutputs("DeploymentType", "JBossWebMetaData");
addDeployer(main, deployer2);
TestFlowDeployer deployer4 = new TestFlowDeployer("WebServiceDeployerPreJSE");
deployer4.setInputs("JBossWebMetaData", "DeploymentType");
deployer4.setOutputs("JBossWebMetaData");
addDeployer(main, deployer4);
TestFlowDeployer deployer5 = new TestFlowDeployer("AbstractWarDeployer");
deployer5.setInputs("JBossWebMetaData");
deployer5.setOutputs("WarDeployment");
addDeployer(main, deployer5);
TestFlowDeployer deployer6 = new TestFlowDeployer("ServiceCL");
deployer6.setInputs("DeploymentType", "WarDeployment");
addDeployer(main, deployer6);
// #2 duplicate
TestFlowDeployer deployer3 = new TestFlowDeployer("WebServicesDeploymentTypeDeployer2");
deployer3.setInputs("WebServicesMetaData", "WebServiceDeployment", "JBossWebMetaData" );
deployer3.setOutputs("DeploymentType", "JBossWebMetaData");
addDeployer(main, deployer3);
// #4 duplicate
TestFlowDeployer deployer7 = new TestFlowDeployer("WebServiceDeployerEJB");
deployer7.setInputs("JBossWebMetaData", "DeploymentType");
deployer7.setOutputs("JBossWebMetaData");
addDeployer(main, deployer7);
Deployment deployment = createSimpleDeployment("testWSDeploymentOrder");
main.addDeployment(deployment);
main.process();
assertEquals(1, deployer1.getDeployOrder());
assertEquals(2, deployer2.getDeployOrder());
assertEquals(3, deployer3.getDeployOrder());
// assertEquals(4, deployer7.getDeployOrder());
assertDeployBefore(deployer2, deployer1);
assertDeployBefore(deployer3, deployer1);
assertDeployBefore(deployer7, deployer2);
assertDeployBefore(deployer7, deployer3);
assertDeployBefore(deployer4, deployer2);
assertDeployBefore(deployer4, deployer3);
assertDeployBefore(deployer5, deployer4);
assertDeployBefore(deployer5, deployer7);
assertDeployBefore(deployer6, deployer5);
assertDeployBefore(deployer6, deployer2);
assertDeployBefore(deployer6, deployer3);
// assertEquals(5, deployer4.getDeployOrder());
// assertEquals(6, deployer5.getDeployOrder());
// assertEquals(7, 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, deployer7.getDeployOrder());
assertDeployBefore(deployer2, deployer1);
assertDeployBefore(deployer3, deployer1);
assertDeployBefore(deployer7, deployer2);
assertDeployBefore(deployer7, deployer3);
assertDeployBefore(deployer4, deployer2);
assertDeployBefore(deployer4, deployer3);
assertDeployBefore(deployer5, deployer4);
assertDeployBefore(deployer5, deployer7);
assertDeployBefore(deployer6, deployer5);
assertDeployBefore(deployer6, deployer2);
assertDeployBefore(deployer6, deployer3);
// assertEquals(5, deployer4.getDeployOrder());
// assertEquals(6, deployer5.getDeployOrder());
// assertEquals(7, deployer6.getDeployOrder());
assertEquals(14, deployer1.getUndeployOrder());
assertEquals(13, deployer2.getUndeployOrder());
assertEquals(12, deployer3.getUndeployOrder());
// assertEquals(11, deployer7.getUndeployOrder());
// assertEquals(10, deployer4.getUndeployOrder());
// assertEquals(9, deployer5.getUndeployOrder());
// assertEquals(8, deployer6.getUndeployOrder());
assertUndeployAfter(deployer2, deployer1);
assertUndeployAfter(deployer3, deployer1);
assertUndeployAfter(deployer7, deployer2);
assertUndeployAfter(deployer7, deployer3);
assertUndeployAfter(deployer4, deployer2);
assertUndeployAfter(deployer4, deployer3);
assertUndeployAfter(deployer5, deployer4);
assertUndeployAfter(deployer5, deployer7);
assertUndeployAfter(deployer6, deployer5);
assertUndeployAfter(deployer6, deployer2);
assertUndeployAfter(deployer6, deployer3);
main.addDeployment(deployment);
main.process();
assertEquals(15, deployer1.getDeployOrder());
assertEquals(16, deployer2.getDeployOrder());
assertEquals(17, deployer3.getDeployOrder());
// assertEquals(18, deployer7.getDeployOrder());
assertDeployBefore(deployer2, deployer1);
assertDeployBefore(deployer3, deployer1);
assertDeployBefore(deployer7, deployer2);
assertDeployBefore(deployer7, deployer3);
assertDeployBefore(deployer4, deployer2);
assertDeployBefore(deployer4, deployer3);
assertDeployBefore(deployer5, deployer4);
assertDeployBefore(deployer5, deployer7);
assertDeployBefore(deployer6, deployer5);
assertDeployBefore(deployer6, deployer2);
assertDeployBefore(deployer6, deployer3);
// assertEquals(19, deployer4.getDeployOrder());
// assertEquals(20, deployer5.getDeployOrder());
// assertEquals(21, deployer6.getDeployOrder());
assertEquals(14, deployer1.getUndeployOrder());
assertEquals(13, deployer2.getUndeployOrder());
assertEquals(12, deployer3.getUndeployOrder());
// assertEquals(11, deployer7.getUndeployOrder());
// assertEquals(10, deployer4.getUndeployOrder());
// assertEquals(9, deployer5.getUndeployOrder());
// assertEquals(8, deployer6.getUndeployOrder());
assertUndeployAfter(deployer2, deployer1);
assertUndeployAfter(deployer3, deployer1);
assertUndeployAfter(deployer7, deployer2);
assertUndeployAfter(deployer7, deployer3);
assertUndeployAfter(deployer4, deployer2);
assertUndeployAfter(deployer4, deployer3);
assertUndeployAfter(deployer5, deployer4);
assertUndeployAfter(deployer5, deployer7);
assertUndeployAfter(deployer6, deployer5);
assertUndeployAfter(deployer6, deployer2);
assertUndeployAfter(deployer6, deployer3);
main.removeDeployment(deployment);
main.process();
}