[jboss-cvs] JBossAS SVN: r95299 - projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Oct 21 10:06:49 EDT 2009
Author: richard.opalka at jboss.com
Date: 2009-10-21 10:06:49 -0400 (Wed, 21 Oct 2009)
New Revision: 95299
Modified:
projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java
Log:
[JBDEPLOY-201] providing test case
Modified: projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java 2009-10-21 14:02:22 UTC (rev 95298)
+++ projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java 2009-10-21 14:06:49 UTC (rev 95299)
@@ -939,4 +939,157 @@
main.removeDeployment(deployment);
main.process();
}
+
+ 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());
+
+ main.removeDeployment(deployment);
+ main.process();
+ }
+
+ public void testDeployersOrderTest2() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+
+ // "1", "2", "3", "4" and "6" are provided by deployers in different stage
+ TestFlowDeployer deployer1 = new TestFlowDeployer( "WSEJBAdapterDeployer" );
+ deployer1.setInputs( "1", "2", "3", "4" );
+ deployer1.setOutputs( "5" );
+ addDeployer(main, deployer1);
+
+ TestFlowDeployer deployer2 = new TestFlowDeployer( "WSTypeDeployer" );
+ deployer2.setInputs( "5", "4", "6" ); // note 6 is both input and output
+ deployer2.setOutputs( "6", "7" );
+ addDeployer(main, deployer2);
+
+ TestFlowDeployer deployer3 = new TestFlowDeployer( "WSDeploymentDeployer" );
+ deployer3.setInputs( "6", "7" ); // note 6 is both input and output
+ deployer3.setOutputs( "8", "6" );
+ addDeployer( main, deployer3 );
+
+ TestFlowDeployer deployer4 = new TestFlowDeployer( "WSDeploymentAspectDeployer" );
+ deployer4.setInputs( "8", "6" ); // note 6 is both input and output
+ deployer4.setOutputs( "9", "6", "0" );
+ addDeployer( main, deployer4 ); // why are we getting cycle detected exception here?
+
+ 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(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+ assertEquals(-1, deployer4.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(4, deployer4.getDeployOrder());
+ assertEquals(8, deployer1.getUndeployOrder());
+ assertEquals(7, deployer2.getUndeployOrder());
+ assertEquals(6, deployer3.getUndeployOrder());
+ assertEquals(5, deployer4.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(9, deployer1.getDeployOrder());
+ assertEquals(10, deployer2.getDeployOrder());
+ assertEquals(11, deployer3.getDeployOrder());
+ assertEquals(12, deployer4.getDeployOrder());
+ assertEquals(8, deployer1.getUndeployOrder());
+ assertEquals(7, deployer2.getUndeployOrder());
+ assertEquals(6, deployer3.getUndeployOrder());
+ assertEquals(5, deployer4.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+ }
+
}
More information about the jboss-cvs-commits
mailing list