[jboss-cvs] JBossAS SVN: r95617 - in projects/jboss-deployers/trunk/deployers-impl/src: test/java/org/jboss/test/deployers/deployer/test and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 27 11:55:50 EDT 2009
Author: alesj
Date: 2009-10-27 11:55:50 -0400 (Tue, 27 Oct 2009)
New Revision: 95617
Modified:
projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java
projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java
Log:
[JBDEPLOY-201]; make name compare for pass-through deployers lazy.
This allows for ordering of overlapping deployers via transitive order.
Modified: projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java 2009-10-27 15:55:46 UTC (rev 95616)
+++ projects/jboss-deployers/trunk/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java 2009-10-27 15:55:50 UTC (rev 95617)
@@ -86,8 +86,7 @@
relation = -1;
else if (oneHead.dimension() > 1 && twoTail.dimension() >= oneHead.dimension() && twoTail.contains(oneHead))
relation = 1;
- else
- relation = COMPARATOR.compare(one, two);
+ // make name compare lazy - might already be fixed with transitive order
}
else
{
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-27 15:55:46 UTC (rev 95616)
+++ projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java 2009-10-27 15:55:50 UTC (rev 95617)
@@ -1024,4 +1024,71 @@
main.removeDeployment(deployment);
main.process();
}
+
+ public void testRemovingOverlapping() 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 );
+
+ 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