[jboss-cvs] JBossAS SVN: r104931 - in projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src: main/java/org/jboss/deployers/plugins/sort and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue May 18 09:53:33 EDT 2010
Author: alesj
Date: 2010-05-18 09:53:32 -0400 (Tue, 18 May 2010)
New Revision: 104931
Added:
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DependenciesTopologicalDeployerSorter.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/InOutTopologicalDeployerSorter.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/KahnDeployerSorter.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/NewStagedSortedDeployers.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/OldStagedSortedDeployers.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/SortedDeployers.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/StagedSortedDeployers.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/support/TestDeployerAdapter.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/AbstractDeployerFlowUnitTest.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/AbstractSorterOrderingUnitTest.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DependenciesTopologicalOrderingUnitTestCase.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DominoOrderingUnitTestCase.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/InOutTopologicalOrderingUnitTestCase.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/IndexingOrderingUnitTestCase.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/KahnOrderingUnitTestCase.java
Modified:
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/deployers/DeployersImpl.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerSorterFactory.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/DeployersDeployerTestSuite.java
projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java
Log:
Port deployers sorting.
Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/deployers/DeployersImpl.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/deployers/DeployersImpl.java 2010-05-18 13:34:14 UTC (rev 104930)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/deployers/DeployersImpl.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -51,6 +51,8 @@
import org.jboss.deployers.client.spi.MissingDependency;
import org.jboss.deployers.plugins.sort.DeployerSorter;
import org.jboss.deployers.plugins.sort.DeployerSorterFactory;
+import org.jboss.deployers.plugins.sort.NewStagedSortedDeployers;
+import org.jboss.deployers.plugins.sort.StagedSortedDeployers;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.DeploymentState;
import org.jboss.deployers.spi.deployer.Deployer;
@@ -122,7 +124,7 @@
/**
* The deployers by stage and type
*/
- private Map<String, List<Deployer>> deployersByStage = new HashMap<String, List<Deployer>>();
+ private StagedSortedDeployers deployersByStage = new NewStagedSortedDeployers();
/**
* The scope builder
@@ -265,24 +267,22 @@
return;
String stageName = stage.getName();
- List<Deployer> deployers = deployersByStage.get(stageName);
- if (deployers == null)
- deployers = Collections.emptyList();
- deployers = insert(deployers, wrapper);
- deployersByStage.put(stageName, deployers);
-
+ deployersByStage.addDeployer(stageName, wrapper);
this.deployers.add(wrapper);
- StringBuilder builder = new StringBuilder();
- builder.append("Added deployer ").append(deployer).append(" for stage ").append(stageName).append('\n');
- for (Deployer temp : getDeployersList(stageName))
+ if (log.isTraceEnabled())
{
- builder.append(temp);
- builder.append("{inputs=").append(temp.getInputs());
- builder.append(" outputs=").append(temp.getOutputs());
- builder.append("}\n");
+ StringBuilder builder = new StringBuilder();
+ builder.append("Added deployer ").append(deployer).append(" for stage ").append(stageName).append('\n');
+ for (Deployer temp : getDeployersList(stageName))
+ {
+ builder.append(temp);
+ builder.append("{inputs=").append(temp.getInputs());
+ builder.append(" outputs=").append(temp.getOutputs());
+ builder.append("}\n");
+ }
+ log.trace(builder);
}
- log.debug(builder);
}
/**
@@ -294,8 +294,10 @@
{
if (deployer == null)
throw new IllegalArgumentException("Null deployer");
- deployers.remove(new DeployerWrapper(deployer));
+ DeployerWrapper wrapper = new DeployerWrapper(deployer);
+ deployers.remove(wrapper);
+
DeploymentStage stage = deployer.getStage();
if (stage == null)
{
@@ -304,15 +306,9 @@
}
String stageName = stage.getName();
- List<Deployer> deployers = deployersByStage.get(stageName);
- if (deployers == null)
- return;
-
- deployers.remove(deployer);
- if (deployers.isEmpty())
- deployersByStage.remove(stageName);
-
- log.debug("Removed deployer " + deployer + " from stage " + stageName);
+ deployersByStage.removeDeployer(stageName, wrapper);
+ if (log.isTraceEnabled())
+ log.trace("Removed deployer " + deployer + " from stage " + stageName);
}
/**
@@ -431,6 +427,16 @@
this.registerMBeans = registerMBeans;
}
+ /**
+ * Set staged sorted deployers.
+ *
+ * @param deployersByStage the stage sorted deployers
+ */
+ public void setDeployersByStage(StagedSortedDeployers deployersByStage)
+ {
+ this.deployersByStage = deployersByStage;
+ }
+
public void start()
{
// Bootstrap the repository
@@ -1486,7 +1492,7 @@
*/
protected synchronized List<Deployer> getDeployersList(String stageName)
{
- List<Deployer> deployers = deployersByStage.get(stageName);
+ List<Deployer> deployers = deployersByStage.getDeployerList(stageName);
if (deployers == null || deployers.isEmpty())
return Collections.emptyList();
Added: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DependenciesTopologicalDeployerSorter.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DependenciesTopologicalDeployerSorter.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DependenciesTopologicalDeployerSorter.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -0,0 +1,316 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.deployers.plugins.sort;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.jboss.deployers.spi.Ordered;
+import org.jboss.deployers.spi.deployer.Deployer;
+
+/**
+ * Implements <a href="http://en.wikipedia.org/wiki/Topological_sorting">topological sorting</a> for acyclic graphs.
+ * The algorithm complexity is <b>O(m+n)</b>, where <b>m</b> is count of vertices and <b>n</b> is count of edges.
+ * However this complexity isn't true for this algorithm implementation because there's backward compatibility
+ * requirement that deployers have to be ordered by their relative number or name if they're on the same processing level.
+ * <b>IOW this backward compatible sorting requirement violates algorithm linear complexity</b>, see:
+ * <a href="https://jira.jboss.org/jira/browse/JBDEPLOY-233">JBDEPLOY-233</a>.
+ *
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+public class DependenciesTopologicalDeployerSorter implements DeployerSorter
+{
+
+ public List<Deployer> sortDeployers(List<Deployer> registeredDeployers, Deployer newDeployer)
+ {
+ return this.createOrientedGraph(registeredDeployers, newDeployer).sort();
+ }
+
+ private Graph createOrientedGraph(final List<Deployer> deployers, final Deployer newDeployer)
+ {
+ final Graph graph = new Graph();
+
+ for (final Deployer deployer : deployers)
+ graph.addVertex(deployer);
+
+ graph.addVertex(newDeployer);
+ graph.createEdges();
+
+ return graph;
+ }
+
+ private static class Graph
+ {
+ private Map<String, Dependency> dependencies = new HashMap<String, Dependency>();
+ private Set<Vertex> vertices = new HashSet<Vertex>();
+
+ public void addVertex(final Deployer deployer)
+ {
+ // create disjunct sets
+ final Set<String> inputs = new HashSet<String>();
+ inputs.addAll(deployer.getInputs());
+ final Set<String> outputs = new HashSet<String>();
+ outputs.addAll(deployer.getOutputs());
+ final Set<String> intersection = this.getIntersection(inputs, outputs);
+
+ // register vertex
+ final Vertex vertex = new Vertex(deployer);
+ this.vertices.add(vertex);
+
+ // register dependencies
+ Dependency dependency;
+ for (final String in : inputs)
+ {
+ dependency = this.getDependency(in);
+ dependency.consumers.add(vertex);
+ }
+
+ for (final String inOut : intersection)
+ {
+ dependency = this.getDependency(inOut);
+ dependency.modifiers.add(vertex);
+ }
+
+ for (final String out : outputs)
+ {
+ dependency = this.getDependency(out);
+ dependency.producers.add(vertex);
+ }
+ }
+
+ public List<Deployer> sort()
+ {
+ // L ? Empty list that will contain the sorted elements
+ List<Deployer> retVal = new LinkedList<Deployer>();
+ // S ? Set of all nodes with no incoming edges
+ List<Vertex> roots = this.getRoots();
+ // ensure backward compatibility
+ Collections.sort(roots, Ordered.COMPARATOR);
+
+ // while S is non-empty do
+ Vertex root;
+ Set<Vertex> nextLevel;
+ while(!roots.isEmpty())
+ {
+ // remove a node n from S
+ root = roots.remove(0);
+ // insert n into L
+ retVal.add(root.getDeployer());
+
+ // for each node m with an edge e from n to m do
+ if (root.hasConsumers())
+ {
+ // ensure backward compatibility
+ nextLevel = new TreeSet<Vertex>(Ordered.COMPARATOR);
+ for(final Vertex consumer : root.consumers)
+ {
+ // remove edge e from the graph
+ consumer.decrementDegree();
+ // if m has no other incoming edges then insert m into S
+ if (!consumer.hasProducers())
+ {
+ this.remove(consumer);
+ nextLevel.add(consumer);
+ }
+ }
+
+ // append to the end of list in sorted order
+ roots.addAll(nextLevel);
+ }
+ }
+
+ if (this.vertices.size() > 0)
+ {
+ // if graph has edges then graph has at least one cycle
+ throw new IllegalStateException("Cycle detected in subgraph: " + this.vertices);
+ }
+ else
+ {
+ // topologically sorted order
+ return retVal;
+ }
+ }
+
+ private Set<String> getIntersection(final Set<String> inputs, final Set<String> outputs)
+ {
+ final Set<String> intersection = new HashSet<String>();
+
+ for (final String input : inputs)
+ for (final String output : outputs)
+ if (input.equals(output))
+ intersection.add(input);
+
+ inputs.removeAll(intersection);
+ outputs.removeAll(intersection);
+
+ return intersection;
+ }
+
+ private Dependency getDependency(final String name)
+ {
+ if (this.dependencies.containsKey(name))
+ {
+ return this.dependencies.get(name);
+ }
+ else
+ {
+ final Dependency newDependency = new Dependency();
+ this.dependencies.put(name, newDependency);
+ return newDependency;
+ }
+ }
+
+ private void createEdges()
+ {
+ Dependency dependency;
+ boolean hasModifiers;
+
+ for (final String dependencyName : this.dependencies.keySet())
+ {
+ dependency = this.dependencies.get(dependencyName);
+ hasModifiers = dependency.modifiers.size() > 0;
+
+ if (hasModifiers)
+ {
+ this.createEdges(dependency.producers, dependency.modifiers);
+ this.createEdges(dependency.modifiers, dependency.consumers);
+ }
+ else
+ {
+ this.createEdges(dependency.producers, dependency.consumers);
+ }
+ }
+ }
+
+ private void createEdges(final List<Vertex> producers, final List<Vertex> consumers)
+ {
+ for (final Vertex producer : producers)
+ for (final Vertex consumer : consumers)
+ {
+ producer.addConsumer(consumer);
+ consumer.incrementDegree();
+ }
+ }
+
+ private List<Vertex> getRoots()
+ {
+ final List<Vertex> retVal = new LinkedList<Vertex>();
+
+ Vertex current;
+ for (final Iterator<Vertex> i = this.vertices.iterator(); i.hasNext(); )
+ {
+ current = i.next();
+ if (!current.hasProducers())
+ {
+ retVal.add(current);
+ i.remove();
+ }
+ }
+
+ return retVal;
+ }
+
+ private void remove(final Vertex v)
+ {
+ this.vertices.remove(v);
+ }
+
+ private static class Vertex implements Ordered
+ {
+ // Wrapped deployer
+ private Deployer deployer;
+ // Incoming edges
+ private int inDegree;
+ // Outgoing edges
+ private List<Vertex> consumers = new LinkedList<Vertex>();
+
+ public Vertex(final Deployer deployer)
+ {
+ this.deployer = deployer;
+ }
+
+ public void incrementDegree()
+ {
+ this.inDegree++;
+ }
+
+ public void decrementDegree()
+ {
+ this.inDegree--;
+ }
+
+ public boolean hasProducers()
+ {
+ return this.inDegree > 0;
+ }
+
+ public void addConsumer(final Vertex v)
+ {
+ this.consumers.add(v);
+ }
+
+ public boolean hasConsumers()
+ {
+ return this.consumers.size() > 0;
+ }
+
+ public Deployer getDeployer()
+ {
+ return this.deployer;
+ }
+
+ public int getRelativeOrder()
+ {
+ return this.deployer.getRelativeOrder();
+ }
+
+ public void setRelativeOrder(final int order)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String toString()
+ {
+ return this.deployer.toString();
+ }
+ }
+
+ private static class Dependency
+ {
+ // deployers creating this dependency
+ private List<Vertex> producers = new LinkedList<Vertex>();
+ // deployers modifying this dependency
+ private List<Vertex> modifiers = new LinkedList<Vertex>();
+ // deployers consuming this dependency
+ private List<Vertex> consumers = new LinkedList<Vertex>();
+ }
+
+ }
+
+}
Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerSorterFactory.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerSorterFactory.java 2010-05-18 13:34:14 UTC (rev 104930)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerSorterFactory.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -30,12 +30,11 @@
{
/**
* Create new DeployerSorter.
- * Currently just plain domino sorting.
*
* @return deployer sorter instance
*/
public static DeployerSorter newSorter()
{
- return new DominoDeployerSorter();
+ return new DependenciesTopologicalDeployerSorter();
}
}
Added: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/InOutTopologicalDeployerSorter.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/InOutTopologicalDeployerSorter.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/InOutTopologicalDeployerSorter.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -0,0 +1,193 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2009, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.deployers.plugins.sort;
+
+import java.util.AbstractList;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.IdentityHashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Stack;
+import java.util.TreeSet;
+
+import org.jboss.deployers.spi.Ordered;
+import org.jboss.deployers.spi.deployer.Deployer;
+import org.jboss.util.graph.Edge;
+import org.jboss.util.graph.Graph;
+import org.jboss.util.graph.Vertex;
+
+/**
+ * Simple topological sorting: http://en.wikipedia.org/wiki/Topological_sorting.
+ *
+ * Each input or output is a task, dependency between tasks is determined by deployer.
+ * e.g. Deployer D has input X and output Y, hence we have 2 tasks and the dependency between them,
+ * meaning that task X needs to be finished before task Y.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class InOutTopologicalDeployerSorter implements DeployerSorter
+{
+ @SuppressWarnings({"unchecked"})
+ public List<Deployer> sortDeployers(List<Deployer> original, Deployer newDeployer)
+ {
+ Graph<Integer> graph = new Graph<Integer>();
+ Map<String, Set<Deployer>> output2deployer = new HashMap<String, Set<Deployer>>();
+ List<Deployer> splitList = new SplitList<Deployer>(original, newDeployer);
+ Set<Deployer> notUsed = new TreeSet<Deployer>(Ordered.COMPARATOR);
+ for (Deployer deployer : splitList)
+ {
+ boolean used = false;
+
+ Set<String> inputs = deployer.getInputs();
+ Set<Vertex<Integer>> ivd = fillVertices(inputs, graph);
+ Set<String> outputs = deployer.getOutputs();
+ Set<Vertex<Integer>> ovd = fillVertices(outputs, graph);
+ ivd.retainAll(ovd); // intersection
+ for (String output : outputs)
+ {
+ Set<Deployer> deployers = output2deployer.get(output);
+ if (deployers == null)
+ {
+ deployers = new TreeSet<Deployer>(Ordered.COMPARATOR);
+ output2deployer.put(output, deployers);
+ }
+ deployers.add(deployer);
+ used = true;
+
+ for (String input : inputs)
+ {
+ Vertex<Integer> from = graph.findVertexByName(input);
+ Vertex<Integer> to = graph.findVertexByName(output);
+ // ignore pass-through
+ if (from != to && ivd.contains(from) == false)
+ graph.addEdge(from, to, 0);
+ }
+ }
+
+ if (used == false)
+ notUsed.add(deployer);
+ }
+ Stack<Vertex<Integer>> noIncoming = new Stack<Vertex<Integer>>();
+ for (Vertex<Integer> vertex : graph.getVerticies())
+ {
+ if (vertex.getIncomingEdgeCount() == 0)
+ noIncoming.push(vertex);
+ }
+ List<Vertex<Integer>> sorted = new ArrayList<Vertex<Integer>>();
+ while(noIncoming.isEmpty() == false)
+ {
+ Vertex<Integer> n = noIncoming.pop();
+ sorted.add(n);
+ n.setData(sorted.size());
+ List<Edge<Integer>> edges = new ArrayList<Edge<Integer>>(n.getOutgoingEdges());
+ for (Edge<Integer> edge : edges)
+ {
+ Vertex<Integer> m = edge.getTo();
+ graph.removeEdge(n, m);
+ if (m.getIncomingEdgeCount() == 0)
+ noIncoming.push(m);
+ }
+ }
+ if (graph.getEdges().isEmpty() == false)
+ throw new IllegalStateException("We have a cycle: " + newDeployer + ", previous: " + original);
+
+ Set<Deployer> sortedDeployers = new LinkedHashSet<Deployer>();
+ for (Vertex<Integer> v : sorted)
+ {
+ Set<Deployer> deployers = output2deployer.get(v.getName());
+ if (deployers != null)
+ {
+ Deployer first = deployers.iterator().next();
+ Iterator<Deployer> notUsedIter = notUsed.iterator();
+ while(notUsedIter.hasNext())
+ {
+ Deployer next = notUsedIter.next();
+ if (next.getInputs().isEmpty() && Ordered.COMPARATOR.compare(next, first) < 0)
+ {
+ sortedDeployers.add(next);
+ notUsedIter.remove();
+ }
+ }
+ for (Deployer deployer : deployers)
+ {
+ if (sortedDeployers.contains(deployer) == false)
+ sortedDeployers.add(deployer);
+ }
+ }
+ }
+ sortedDeployers.addAll(notUsed); // add the one's with no output
+ return new ArrayList<Deployer>(sortedDeployers);
+ }
+
+ private static Set<Vertex<Integer>> fillVertices(Set<String> keys, Graph<Integer> graph)
+ {
+ Map<Vertex<Integer>, Object> dv = new IdentityHashMap<Vertex<Integer>, Object>();
+ for (String key : keys)
+ dv.put(getVertex(key, graph), 0);
+ return dv.keySet();
+ }
+
+ private static Vertex<Integer> getVertex(String key, Graph<Integer> graph)
+ {
+ Vertex<Integer> vertex = graph.findVertexByName(key);
+ if (vertex == null)
+ {
+ vertex = new Vertex<Integer>(key);
+ graph.addVertex(vertex);
+ }
+ return vertex;
+ }
+
+ private class SplitList<T> extends AbstractList<T>
+ {
+ private List<T> head;
+ private List<T> tail;
+
+ private SplitList(List<T> head, T tail)
+ {
+ this.head = head;
+ this.tail = Collections.singletonList(tail);
+ }
+
+ @Override
+ public T get(int index)
+ {
+ int headSize = head.size();
+ if (index < headSize)
+ return head.get(index);
+ else
+ return tail.get(index - headSize);
+ }
+
+ @Override
+ public int size()
+ {
+ return head.size() + tail.size();
+ }
+ }
+}
\ No newline at end of file
Added: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/KahnDeployerSorter.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/KahnDeployerSorter.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/KahnDeployerSorter.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -0,0 +1,372 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2009, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.deployers.plugins.sort;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.IdentityHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.jboss.deployers.spi.Ordered;
+import org.jboss.deployers.spi.deployer.Deployer;
+
+/**
+ * @author <a href="cdewolf at redhat.com">Carlo de Wolf</a>
+ */
+public class KahnDeployerSorter implements DeployerSorter
+{
+ private static class Edge
+ {
+ Deployer from;
+ String input;
+ Deployer to;
+
+ Edge(Deployer from, String input, Deployer to)
+ {
+ if(from.equals(to))
+ throw new IllegalArgumentException("cyclic edge");
+ this.from = from;
+ this.input = input;
+ this.to = to;
+ }
+
+ @Override
+ public boolean equals(Object o)
+ {
+ if(this == o) return true;
+ if(o == null || getClass() != o.getClass()) return false;
+
+ Edge edge = (Edge) o;
+
+ if(from != null ? !from.equals(edge.from) : edge.from != null) return false;
+ if(!input.equals(edge.input)) return false;
+ if(!to.equals(edge.to)) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int result = from != null ? from.hashCode() : 0;
+ result = 31 * result + input.hashCode();
+ result = 31 * result + to.hashCode();
+ return result;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Edge{" +
+ "from=" + from +
+ ", input='" + input + '\'' +
+ ", to=" + to +
+ '}';
+ }
+ }
+
+ private static class ScoredDeployer
+ {
+ Deployer deployer;
+ int score;
+
+ ScoredDeployer(Deployer deployer)
+ {
+ this.deployer = deployer;
+ this.score = deployer.getRelativeOrder();
+ }
+
+ @Override
+ public String toString()
+ {
+ return "ScoredDeployer{" +
+ "deployer=" + deployer +
+ ", score=" + score +
+ '}';
+ }
+ }
+
+ protected int compare(Deployer one, Deployer two)
+ {
+ int relation = one.getRelativeOrder() - two.getRelativeOrder();
+ if(relation == 0)
+ relation = one.hashCode() - two.hashCode();
+ assert relation != 0;
+ return relation;
+ }
+
+ protected Collection<Edge> createEdges(Deployer from, Map<String, Collection<Deployer>> inputCache, Set<String> outputs)
+ {
+ Collection<Edge> result = new ArrayList<Edge>();
+ for(String output : outputs)
+ {
+ Collection<Deployer> deployers = inputCache.get(output);
+ if(deployers != null) for(Deployer to : deployers)
+ {
+ if(from != to)
+ result.add(new Edge(from, output, to));
+ }
+ }
+ return result;
+ }
+
+ protected Collection<Edge> createEdges(Map<String, Collection<Deployer>> outputCache, Set<String> inputs, Deployer to)
+ {
+ Collection<Edge> result = new ArrayList<Edge>();
+ for(String input : inputs)
+ {
+ Collection<Deployer> deployers = outputCache.get(input);
+ if(deployers != null) for(Deployer from : deployers)
+ {
+ result.add(new Edge(from, input, to));
+ }
+ }
+ return result;
+ }
+
+ protected Collection<Edge> findInputs(Map<Deployer, Set<Edge>> edgeCache, Deployer from, Map<String, Collection<Deployer>> cache, Set<String> inputs)
+ {
+ Collection<Edge> result = new ArrayList<Edge>();
+ for(String input : inputs)
+ {
+ //result.addAll(cache.get(input));
+ Collection<Deployer> deployers = cache.get(input);
+ if(deployers != null) for(Deployer d : deployers)
+ {
+ if(d != from)
+ {
+ //result.add(new Edge(from, input, d));
+ Edge potential = new Edge(from, input, d);
+ Set<Edge> edges = edgeCache.get(d);
+ if(edges.contains(potential))
+ result.add(potential);
+ }
+ }
+ }
+ return result;
+ }
+
+ protected boolean isInputMaster(Collection<Deployer> deployers, Deployer deployer, String input)
+ {
+ for(Deployer other : deployers)
+ {
+ if(isTransient(other, input))
+ {
+ if(compare(other, deployer) > 0)
+ return false;
+ }
+ }
+ return true;
+ }
+
+ protected boolean isTransient(Deployer deployer, String input)
+ {
+ return deployer.getInputs().contains(input) && deployer.getOutputs().contains(input);
+ }
+
+ protected void process(Deployer deployer, Collection<Deployer> s, Map<String, Collection<Deployer>> inputCache, Map<Deployer, Set<Edge>> edgeCache, Set<String> outputs, Map<String, Collection<Deployer>> outputCache)
+ {
+ outputs.addAll(deployer.getOutputs());
+ if(deployer.getInputs() == null || deployer.getInputs().size() == 0)
+ s.add(deployer);
+ else
+ {
+ Set<Edge> edges = edgeCache.get(deployer);
+ assert edges == null;
+ edges = new HashSet<Edge>();
+ edgeCache.put(deployer, edges);
+
+ for(String input : deployer.getInputs())
+ {
+ Collection<Deployer> c = inputCache.get(input);
+ if(c == null)
+ {
+ c = new ArrayList<Deployer>();
+ inputCache.put(input, c);
+ }
+ c.add(deployer);
+ }
+
+ Collection<Edge> c = createEdges(outputCache, deployer.getInputs(), deployer);
+ if(c.isEmpty())
+ {
+ // might be a bit premature, see below
+ s.add(deployer);
+ }
+ else
+ {
+ edges.addAll(c);
+ }
+ }
+
+ for(String output : deployer.getOutputs())
+ {
+ Collection<Deployer> c = outputCache.get(output);
+ if(c == null)
+ {
+ c = new ArrayList<Deployer>();
+ outputCache.put(output, c);
+ }
+ c.add(deployer);
+ }
+
+ Collection<Edge> edges = createEdges(deployer, inputCache, deployer.getOutputs());
+ for(Edge e : edges)
+ {
+ Set<Edge> cachedEdges = edgeCache.get(e.to);
+ if(cachedEdges == null)
+ {
+ cachedEdges = new HashSet<Edge>();
+ edgeCache.put(e.to, cachedEdges);
+ }
+ cachedEdges.add(e);
+ // remove a prematurely added deployer
+ s.remove(e.to);
+ }
+ }
+
+ /**
+ * Break the cyclic graph by processing transient deployers. Basically choosing one edge which we want removed.
+ *
+ * @param s the deployers
+ * @param inputCache the input cache
+ * @param outputCache the output cache
+ * @param edgeCache the edge cache
+ */
+ public void processTransientDeployers(List<Deployer> s, Map<String, Collection<Deployer>> inputCache, Map<String, Collection<Deployer>> outputCache, Map<Deployer, Set<Edge>> edgeCache)
+ {
+ for(String input : inputCache.keySet())
+ {
+ Collection<Deployer> others = outputCache.get(input);
+ if(others == null)
+ continue;
+ List<Deployer> deployers = new ArrayList<Deployer>(inputCache.get(input));
+ deployers.retainAll(others);
+ if(deployers.isEmpty() || deployers.size() == 1)
+ continue;
+
+ List<ScoredDeployer> scoredDeployers = new ArrayList<ScoredDeployer>();
+ // TODO: too slow
+ for(Deployer d : deployers)
+ {
+ ScoredDeployer scoredDeployer = new ScoredDeployer(d);
+ scoredDeployers.add(scoredDeployer);
+
+ Set<Edge> edges = edgeCache.get(d);
+ for(Edge e : new HashSet<Edge>(edges))
+ {
+ if(deployers.contains(e.from) && input.equals(e.input))
+ edges.remove(e);
+ else if(deployers.contains(e.from))
+ scoredDeployer.score++;
+ }
+ }
+
+ Comparator<? super ScoredDeployer> comparator = new Comparator<ScoredDeployer>() {
+ public int compare(ScoredDeployer o1, ScoredDeployer o2)
+ {
+ int relation = o1.score - o2.score;
+ if(relation == 0)
+ relation = Ordered.COMPARATOR.compare(o1.deployer, o2.deployer);
+ return relation;
+ }
+ };
+ Collections.sort(scoredDeployers, comparator);
+
+ for(int i = 1; i < scoredDeployers.size(); i++)
+ {
+ Set<Edge> edges = edgeCache.get(scoredDeployers.get(i).deployer);
+ edges.add(new Edge(scoredDeployers.get(0).deployer, input, scoredDeployers.get(i).deployer));
+ }
+
+ // add the top one if it doesn't have any incoming edges
+ // note that the normal process step does the same thing, so exclude it.
+ Deployer deployer = scoredDeployers.get(0).deployer;
+ if(edgeCache.get(deployer).isEmpty() && !s.contains(deployer))
+ s.add(deployer);
+ }
+ }
+
+ public List<Deployer> sortDeployers(List<Deployer> original, Deployer newDeployer)
+ {
+ List<Deployer> result = new ArrayList<Deployer>();
+ // S ? Set of all nodes with no incoming edges
+ List<Deployer> s = new ArrayList<Deployer>();
+ Map<String, Collection<Deployer>> inputCache = new HashMap<String, Collection<Deployer>>();
+ Map<Deployer, Set<Edge>> edgeCache = new IdentityHashMap<Deployer, Set<Edge>>();
+ Set<String> outputs = new HashSet<String>();
+ Map<String, Collection<Deployer>> outputCache = new HashMap<String, Collection<Deployer>>();
+ for(Deployer deployer : original)
+ {
+ process(deployer, s, inputCache, edgeCache, outputs, outputCache);
+ }
+ process(newDeployer, s, inputCache, edgeCache, outputs, outputCache);
+
+ // find transient deployers and sort them out
+ processTransientDeployers(s, inputCache, outputCache, edgeCache);
+
+ // never, ever ask why this is here.
+ // I really mean it, do not ask.
+ // Seriously I will not give a sensible answer to this one.
+ // Okay, okay, stop bitching. There is a requirement that deployer need to be in name ordering.
+ // setupSillyNameEdges(deployer, newDeployer); // hmm does work out
+ Collections.sort(s, Ordered.COMPARATOR);
+
+ while(!s.isEmpty())
+ {
+ Deployer deployer = s.remove(0);
+ result.add(deployer);
+ // for each node m with an edge e from n to m do
+ Set<Deployer> nextLevel = new TreeSet<Deployer>(Ordered.COMPARATOR);
+ for(Edge e : findInputs(edgeCache, deployer, inputCache, deployer.getOutputs()))
+ {
+ // remove edge e from the graph
+ Set<Edge> edges = edgeCache.get(e.to);
+ edges.remove(e);
+ // if m has no other incoming edges then insert m into S
+ if(edges.isEmpty())
+ nextLevel.add(e.to);
+ }
+ s.addAll(nextLevel);
+ }
+ // if graph has edges then output error message (graph has at least one cycle)
+ String message = "";
+ for(Set<Edge> edges : edgeCache.values())
+ {
+ if(!edges.isEmpty())
+ message += "edges: " + edges;
+ }
+ if(message.length() > 0)
+ throw new IllegalStateException(message);
+
+ assert result.size() == original.size() + 1 : "not all deployers made it";
+ return result;
+ }
+}
Added: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/NewStagedSortedDeployers.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/NewStagedSortedDeployers.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/NewStagedSortedDeployers.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -0,0 +1,45 @@
+package org.jboss.deployers.plugins.sort;
+
+import org.jboss.deployers.spi.deployer.Deployer;
+
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
+ * @version $Revision: 1 $
+ */
+public class NewStagedSortedDeployers implements StagedSortedDeployers
+{
+ private Map<String, SortedDeployers> deployersByStage = new HashMap<String, SortedDeployers>();
+
+ public void addDeployer(String stageName, Deployer deployer)
+ {
+ SortedDeployers deployers = deployersByStage.get(stageName);
+ if (deployers == null)
+ {
+ deployers = new SortedDeployers();
+ deployersByStage.put(stageName, deployers);
+ }
+ deployers.sort(deployer);
+
+ }
+
+ public List<Deployer> getDeployerList(String stageName)
+ {
+ SortedDeployers deployers = deployersByStage.get(stageName);
+ if (deployers == null)
+ return Collections.emptyList();
+
+ return deployers.getDeployers();
+ }
+
+ public void removeDeployer(String stageName, Deployer deployer)
+ {
+ SortedDeployers deployers = deployersByStage.get(stageName);
+ if (deployers != null)
+ deployers.removeDeployer(deployer);
+ }
+}
Added: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/OldStagedSortedDeployers.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/OldStagedSortedDeployers.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/OldStagedSortedDeployers.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -0,0 +1,75 @@
+package org.jboss.deployers.plugins.sort;
+
+import org.jboss.deployers.spi.deployer.Deployer;
+
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ * @version $Revision: 1 $
+ */
+public class OldStagedSortedDeployers implements StagedSortedDeployers
+{
+ private Map<String, List<Deployer>> deployersByStage = new HashMap<String, List<Deployer>>();
+ private DeployerSorter sorter;
+
+ public void addDeployer(String stageName, Deployer deployer)
+ {
+ List<Deployer> deployers = deployersByStage.get(stageName);
+ if (deployers == null)
+ deployers = Collections.emptyList();
+ deployers = insert(deployers, deployer);
+ deployersByStage.put(stageName, deployers);
+
+ }
+
+ public List<Deployer> getDeployerList(String stageName)
+ {
+ List<Deployer> deployers = deployersByStage.get(stageName);
+ if (deployers == null || deployers.isEmpty())
+ return Collections.emptyList();
+
+ return deployers;
+ }
+
+ public void removeDeployer(String stageName, Deployer deployer)
+ {
+ List<Deployer> deployers = deployersByStage.get(stageName);
+ if (deployers == null)
+ return;
+
+ deployers.remove(deployer);
+ if (deployers.isEmpty())
+ deployersByStage.remove(stageName);
+ }
+
+ /**
+ * Insert the new Deployer.
+ *
+ * @param original the original deployers
+ * @param newDeployer the new deployer
+ * @return the sorted deployers
+ */
+ protected List<Deployer> insert(List<Deployer> original, Deployer newDeployer)
+ {
+ DeployerSorter sorter = this.sorter;
+ if (sorter == null)
+ sorter = DeployerSorterFactory.newSorter();
+
+ return sorter.sortDeployers(original, newDeployer);
+ }
+
+ /**
+ * The deployer sorter.
+ *
+ * @param sorter the sorter
+ */
+ public void setSorter(DeployerSorter sorter)
+ {
+ this.sorter = sorter;
+ }
+}
Added: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/SortedDeployers.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/SortedDeployers.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/SortedDeployers.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -0,0 +1,336 @@
+package org.jboss.deployers.plugins.sort;
+
+import org.jboss.deployers.spi.deployer.Deployer;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.IdentityHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
+ * @version $Revision: 1 $
+ */
+public class SortedDeployers
+{
+ private static class Entry
+ {
+
+ public Deployer deployer;
+ public int index;
+
+ private String nameCache;
+
+ private Entry(Deployer deployer)
+ {
+ this.deployer = deployer;
+ }
+
+ public Set<String> getInputs()
+ {
+ if (deployer.getInputs() == null) return Collections.emptySet();
+ return deployer.getInputs();
+ }
+
+ public Set<String> getOutputs()
+ {
+ if (deployer.getOutputs() == null) return Collections.emptySet();
+ return deployer.getOutputs();
+ }
+
+ public int getRelativeOrder()
+ {
+ return deployer.getRelativeOrder();
+ }
+
+ public int getIndex()
+ {
+ return index;
+ }
+
+ public void setIndex(int index)
+ {
+ this.index = index;
+ }
+
+ public String toString()
+ {
+ // this speeds up things a few milliseconds :)
+ if (nameCache == null) nameCache = deployer.toString();
+ return nameCache;
+ }
+ }
+
+ Map<String, List<Entry>> outputMap = new HashMap<String, List<Entry>>();
+ Map<String, List<Entry>> inputMap = new HashMap<String, List<Entry>>();
+ ArrayList<Entry> entries = new ArrayList<Entry>();
+ ArrayList<Deployer> deployers = new ArrayList<Deployer>();
+
+ public void addOutputs(Entry deployer)
+ {
+ if (deployer.getOutputs() == null) return;
+ for (String output : deployer.getOutputs())
+ {
+ List<Entry> list = outputMap.get(output);
+ if (list == null)
+ {
+ list = new ArrayList<Entry>();
+ outputMap.put(output, list);
+ }
+ list.add(deployer);
+ }
+ }
+
+ public void addInputs(Entry deployer)
+ {
+ if (deployer.getInputs() == null) return;
+ for (String input : deployer.getInputs())
+ {
+ List<Entry> list = inputMap.get(input);
+ if (list == null)
+ {
+ list = new ArrayList<Entry>();
+ inputMap.put(input, list);
+ }
+ list.add(deployer);
+ }
+ }
+
+ public void sort(Deployer d)
+ {
+ Entry n = new Entry(d);
+ addOutputs(n);
+ addInputs(n);
+
+ if (entries.size() == 0)
+ {
+ insertAt(n);
+ deployers.clear();
+ for (Entry entry : entries)
+ {
+ deployers.add(entry.deployer);
+ }
+ return;
+ }
+
+ insertAfterInputs(n);
+ IdentityHashMap<Entry, Entry> visited = new IdentityHashMap<Entry, Entry>();
+ traverseOutputs(n, visited);
+ relativeOrdering();
+
+ // For some reason, something depends on a new list within MC/VDF
+ // be careful if you change this
+ deployers = new ArrayList<Deployer>();
+ for (Entry entry : entries)
+ {
+ deployers.add(entry.deployer);
+ }
+ }
+
+ public void removeDeployer(Deployer d)
+ {
+ Entry removed = null;
+ int esize = entries.size();
+ for (int i = 0; i < esize; i++)
+ {
+ if (entries.get(0).deployer == d)
+ {
+ removed = entries.get(0);
+ removeAt(i);
+ break;
+ }
+ }
+ if (d.getInputs() != null)
+ {
+ for (String input : d.getInputs())
+ {
+ List<Entry> list = inputMap.get(input);
+ if (list != null)
+ {
+ list.remove(removed);
+ }
+ }
+ }
+ if (d.getOutputs() != null)
+ {
+ for (String output : d.getOutputs())
+ {
+ List<Entry> list = outputMap.get(output);
+ if (list != null)
+ {
+ list.remove(removed);
+ }
+ }
+ }
+ deployers = new ArrayList<Deployer>();
+ for (Entry entry : entries)
+ {
+ deployers.add(entry.deployer);
+ }
+ }
+
+ public List<Deployer> getDeployers()
+ {
+ return deployers;
+ }
+
+ private void traverseOutputs(Entry n, IdentityHashMap<Entry, Entry> visited)
+ {
+ if (n.getOutputs() == null) return;
+ if (visited.containsKey(n))
+ {
+ throw new IllegalStateException("Deployer " + n + " is involved in a cyclic dependency.");
+ }
+ visited.put(n, n);
+ for (String output : n.getOutputs())
+ {
+ List<Entry> inputs = inputMap.get(output);
+ if (inputs == null) continue;
+ for (Entry deployer : inputs)
+ {
+ if (deployer.getIndex() < n.getIndex())
+ {
+ // if both the new deployer and comparing deployer have the same output as input
+ // don't change the index of the new deployer. We always want to insert the deployer at the lowest
+ // possible index so that it is guaranteed that a lower index is always "not equal" to it.
+ if (n.getInputs().contains(output) && deployer.getOutputs().contains(output))
+ {
+
+ }
+ else
+ {
+ removeAt(deployer.getIndex());
+ deployer.setIndex(0);
+ insertAfterInputs(deployer);
+ traverseOutputs(deployer, visited);
+ }
+ }
+ }
+
+ }
+ }
+
+ private void insertAfterInputs(Entry n)
+ {
+ Set<String> nInputs = n.getInputs();
+ Set<String> nOutputs = n.getOutputs();
+ if (nInputs == null) return;
+ for (String input : nInputs)
+ {
+ List<Entry> outputs = outputMap.get(input);
+ if (outputs == null) continue;
+ for (Entry deployer : outputs)
+ {
+ if (deployer == n) continue;
+ if (deployer.getIndex() >= n.getIndex())
+ {
+ // if both the new deployer and comparing deployer have the same output as input
+ // don't change the index of the new deployer. We always want to insert the deployer at the lowest
+ // possible index so that it is guaranteed that a lower index is always "not equal" to it.
+ if (nOutputs.contains(input) && deployer.getInputs().contains(input))
+ {
+
+ }
+ else
+ {
+ n.setIndex(deployer.getIndex() + 1);
+ }
+ }
+ }
+ }
+ insertAt(n);
+ }
+
+ void insertAt(Entry n)
+ {
+ entries.add(n.getIndex(), n);
+ int esize = entries.size();
+ for (int i = n.getIndex() + 1; i < esize; i++)
+ {
+ entries.get(i).setIndex(i);
+ }
+ }
+
+ void removeAt(int index)
+ {
+ entries.remove(index);
+ int esize = entries.size();
+ for (int i = index; i < esize; i++)
+ {
+ entries.get(i).setIndex(i);
+ }
+ }
+
+ public void relativeOrdering()
+ {
+ // this algorithm may seem buggy, but I don't think it is.
+ // WE can do a simple for loop because deployers are add one at a time
+ // since they are added one at a time, the current entry list is already sorted
+ // also, we ensure that deployers are inserted at the lowest possible index. This means
+ // that they cannot be "equal to" a lower index than themselves and makes this
+ // single for-loop optimization rather than a real sort possible.
+ // Time improvement could be saved if name ordering was removed.
+ int esize = entries.size();
+ for (int i = 0; i < esize - 1; i++)
+ {
+ Entry d1 = entries.get(i);
+ Entry d2 = entries.get(i + 1);
+
+ // optimization. If relative order is the same, we don't have to do a swap
+ if (d1.getRelativeOrder() == d2.getRelativeOrder())
+ {
+ String name1 = d1.toString();
+ String name2 = d2.toString();
+ if (name1.compareTo(name2) < 0) continue;
+
+ if (isIOEqual(d1, d2))
+ {
+ swap(i, d1, d2);
+ }
+
+ continue;
+ }
+ boolean isEqual = isIOEqual(d1, d2);
+ if (isEqual)
+ {
+ if (d2.getRelativeOrder() < d1.getRelativeOrder())
+ {
+ swap(i, d1, d2);
+ }
+ }
+ }
+ }
+
+ private void swap(int i, Entry d1, Entry d2)
+ {
+ entries.set(i + 1, d1);
+ d1.setIndex(i + 1);
+ entries.set(i, d2);
+ d2.setIndex(i);
+ }
+
+ private boolean isIOEqual(Entry d1, Entry d2)
+ {
+ boolean isEqual = true;
+ Set<String> d1Outputs = d1.getOutputs();
+ if (d1Outputs == null) return true;
+ for (String output : d1Outputs)
+ {
+ List<Entry> inputs = inputMap.get(output);
+ if (inputs == null) continue;
+ if (inputs.contains(d2))
+ {
+ if (d1.getInputs().contains(output) && d2.getOutputs().contains(output))
+ {
+ continue;
+ }
+ isEqual = false;
+ break;
+ }
+ }
+ return isEqual;
+ }
+}
Added: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/StagedSortedDeployers.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/StagedSortedDeployers.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/StagedSortedDeployers.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -0,0 +1,39 @@
+package org.jboss.deployers.plugins.sort;
+
+import org.jboss.deployers.spi.deployer.Deployer;
+
+import java.util.List;
+
+/**
+ * Sorted deployers spi.
+ *
+ * @author <a href="mailto:bill at burkecentral.com">Bill Burke</a>
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ * @version $Revision: 1 $
+ */
+public interface StagedSortedDeployers
+{
+ /**
+ * Add new deployer.
+ *
+ * @param stageName the stage name
+ * @param deployer the deployer
+ */
+ void addDeployer(String stageName, Deployer deployer);
+
+ /**
+ * The deployer list for stage.
+ *
+ * @param stageName the stage name
+ * @return matching deployer per stage
+ */
+ List<Deployer> getDeployerList(String stageName);
+
+ /**
+ * Remove deployer.
+ *
+ * @param stageName the stage name
+ * @param deployer the deployer
+ */
+ void removeDeployer(String stageName, Deployer deployer);
+}
Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/DeployersDeployerTestSuite.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/DeployersDeployerTestSuite.java 2010-05-18 13:34:14 UTC (rev 104930)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/DeployersDeployerTestSuite.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -26,19 +26,7 @@
import junit.textui.TestRunner;
import org.jboss.test.deployers.deployer.helpers.test.ExactAttachmentDeployerWithVisitorTestCase;
-import org.jboss.test.deployers.deployer.test.ComponentUnitTestCase;
-import org.jboss.test.deployers.deployer.test.DeployerClassLoaderUnitTestCase;
-import org.jboss.test.deployers.deployer.test.DeployerContextClassLoaderUnitTestCase;
-import org.jboss.test.deployers.deployer.test.DeployerFlowUnitTestCase;
-import org.jboss.test.deployers.deployer.test.DeployerOrderingUnitTestCase;
-import org.jboss.test.deployers.deployer.test.DeployerProtocolUnitTestCase;
-import org.jboss.test.deployers.deployer.test.DeployerRequiredInputsUnitTestCase;
-import org.jboss.test.deployers.deployer.test.DeployerRequiredStageUnitTestCase;
-import org.jboss.test.deployers.deployer.test.DeployerWidthFirstUnitTestCase;
-import org.jboss.test.deployers.deployer.test.DeployersImplUnitTestCase;
-import org.jboss.test.deployers.deployer.test.HeuristicAllOrNothingUnitTestCase;
-import org.jboss.test.deployers.deployer.test.HeuristicRussionDollUnitTestCase;
-import org.jboss.test.deployers.deployer.test.MultipleComponentTypeUnitTestCase;
+import org.jboss.test.deployers.deployer.test.*;
/**
* Deployers Deployer Test Suite.
@@ -60,7 +48,6 @@
suite.addTest(DeployerProtocolUnitTestCase.suite());
suite.addTest(DeployerOrderingUnitTestCase.suite());
- suite.addTest(DeployerFlowUnitTestCase.suite());
suite.addTest(DeployerWidthFirstUnitTestCase.suite());
suite.addTest(DeployerClassLoaderUnitTestCase.suite());
suite.addTest(DeployersImplUnitTestCase.suite());
@@ -72,6 +59,14 @@
suite.addTest(DeployerRequiredStageUnitTestCase.suite());
suite.addTest(DeployerRequiredInputsUnitTestCase.suite());
+ // sorting tests
+ suite.addTest(DeployerFlowUnitTestCase.suite());
+ suite.addTest(DominoOrderingUnitTestCase.suite());
+ suite.addTest(KahnOrderingUnitTestCase.suite());
+ suite.addTest(InOutTopologicalOrderingUnitTestCase.suite());
+ suite.addTest(IndexingOrderingUnitTestCase.suite());
+ suite.addTest(DependenciesTopologicalOrderingUnitTestCase.suite());
+
// helper deployers
suite.addTest(ExactAttachmentDeployerWithVisitorTestCase.suite());
Added: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/support/TestDeployerAdapter.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/support/TestDeployerAdapter.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/support/TestDeployerAdapter.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -0,0 +1,36 @@
+/**
+ *
+ */
+package org.jboss.test.deployers.deployer.support;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+/**
+ * Deployer adapter.
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+public final class TestDeployerAdapter extends AbstractDeployer
+{
+
+ final String name;
+
+ public TestDeployerAdapter( final String name )
+ {
+ super();
+ this.name = name;
+ }
+
+ public void deploy(DeploymentUnit unit) throws DeploymentException
+ {
+ // NOOP
+ }
+
+ @Override
+ public String toString()
+ {
+ return super.toString() + "-" + this.name;
+ }
+
+}
Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/AbstractDeployerFlowUnitTest.java (from rev 104929, projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/AbstractDeployerFlowUnitTest.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/AbstractDeployerFlowUnitTest.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -0,0 +1,2197 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2009, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.deployer.test;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.plugins.deployers.DeployersImpl;
+import org.jboss.deployers.spi.deployer.Deployers;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
+import org.jboss.test.deployers.AbstractDeployerTest;
+import org.jboss.test.deployers.deployer.support.TestDeployerAdapter;
+import org.jboss.test.deployers.deployer.support.TestFlowDeployer;
+
+/**
+ * DeployerOrderingUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ * @author <a href="cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractDeployerFlowUnitTest extends AbstractDeployerTest
+{
+ public AbstractDeployerFlowUnitTest(String name)
+ {
+ super(name);
+ }
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ TestFlowDeployer.reset();
+ }
+
+ @Override
+ protected Deployers createDeployers()
+ {
+ Deployers deployers = super.createDeployers();
+ DeployersImpl impl = assertInstanceOf(deployers, DeployersImpl.class, false);
+ applySortingChanges(impl);
+ return impl;
+ }
+
+ protected abstract void applySortingChanges(DeployersImpl deployers);
+
+ public void testSimpleInputOutputCorrectOrder() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setOutputs("test");
+ addDeployer(main, deployer1);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("test");
+ 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());
+ }
+
+ public void testSimpleInputOutputWrongOrder() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("test");
+ addDeployer(main, deployer2);
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setOutputs("test");
+ addDeployer(main, deployer1);
+
+ Deployment deployment = createSimpleDeployment("wrongOrder");
+ 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());
+ }
+
+ public void testInputOutputLoop() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setInputs("A");
+ deployer1.setOutputs("B");
+ addDeployer(main, deployer1);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("B");
+ deployer2.setOutputs("C");
+ addDeployer(main, deployer2);
+ TestFlowDeployer deployer3 = new TestFlowDeployer("3");
+ deployer3.setInputs("C");
+ deployer3.setOutputs("A");
+ try
+ {
+ addDeployer(main, deployer3);
+ fail("Should not be here!");
+ }
+ catch (Throwable t)
+ {
+ checkThrowable(IllegalStateException.class, t);
+ }
+ }
+
+ public void testInputOutputTransient() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setOutputs("test");
+ addDeployer(main, deployer1);
+ TestFlowDeployer deployer3 = new TestFlowDeployer("3");
+ deployer3.setInputs("test");
+ addDeployer(main, deployer3);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("test");
+ deployer2.setOutputs("test");
+ addDeployer(main, deployer2);
+
+ Deployment deployment = createSimpleDeployment("transient");
+ main.addDeployment(deployment);
+ main.process();
+
+ // B can appear at any position
+ // BCA, CBA, CAB
+ assertDeployBefore(deployer2, deployer1);
+ assertTrue("C doesn't deploy", deployer1.getDeployOrder() > 0);
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(6, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(4, deployer3.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(7, deployer1.getDeployOrder());
+ assertEquals(8, deployer2.getDeployOrder());
+ assertEquals(9, deployer3.getDeployOrder());
+ assertEquals(6, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(4, deployer3.getUndeployOrder());
+ }
+
+ public void testInputOutputTransient2() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setInputs("test");
+ deployer1.setOutputs("test");
+ addDeployer(main, deployer1);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("test");
+ addDeployer(main, deployer2);
+
+ Deployment deployment = createSimpleDeployment("transient2");
+ 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());
+ }
+
+ public void testInputOutputMultipleTransient() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer4 = new TestFlowDeployer("4");
+ deployer4.setInputs("test");
+ addDeployer(main, deployer4);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("test");
+ deployer2.setOutputs("test");
+ addDeployer(main, deployer2);
+ TestFlowDeployer deployer3 = new TestFlowDeployer("3");
+ deployer3.setInputs("test");
+ deployer3.setOutputs("test");
+ addDeployer(main, deployer3);
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setOutputs("test");
+ addDeployer(main, deployer1);
+
+ Deployment deployment = createSimpleDeployment("transient");
+ 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());
+ }
+
+ public void testMultipleOutput() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setOutputs("test1", "test2");
+ addDeployer(main, deployer1);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("test1");
+ addDeployer(main, deployer2);
+ TestFlowDeployer deployer3 = new TestFlowDeployer("3");
+ deployer3.setInputs("test2");
+ addDeployer(main, deployer3);
+
+ Deployment deployment = createSimpleDeployment("MultipleOutput");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertDeployBefore(deployer2, deployer1);
+ assertDeployBefore(deployer3, deployer1);
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertDeployBefore(deployer2, deployer1);
+ assertDeployBefore(deployer3, deployer1);
+ assertUndeployAfter(deployer2, deployer1);
+ assertUndeployAfter(deployer3, deployer1);
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertDeployBefore(deployer2, deployer1);
+ assertDeployBefore(deployer3, deployer1);
+ assertUndeployAfter(deployer2, deployer1);
+ assertUndeployAfter(deployer3, deployer1);
+ }
+
+ public void testMultipleInput() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer3 = new TestFlowDeployer("in12");
+ deployer3.setInputs("test1", "test2");
+ addDeployer(main, deployer3);
+ TestFlowDeployer deployer1 = new TestFlowDeployer("out1");
+ deployer1.setOutputs("test1");
+ addDeployer(main, deployer1);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("out2");
+ deployer2.setOutputs("test2");
+ addDeployer(main, deployer2);
+
+ Deployment deployment = createSimpleDeployment("MultipleInput");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertDeployBefore(deployer3, deployer1);
+ assertDeployBefore(deployer3, deployer2);
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertDeployBefore(deployer3, deployer1);
+ assertDeployBefore(deployer3, deployer2);
+ assertEquals(3, deployer3.getDeployOrder());
+ assertUndeployAfter(deployer3, deployer1);
+ assertUndeployAfter(deployer3, deployer2);
+ assertEquals(4, deployer3.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertDeployBefore(deployer3, deployer1);
+ assertDeployBefore(deployer3, deployer2);
+ assertEquals(9, deployer3.getDeployOrder());
+ assertUndeployAfter(deployer3, deployer1);
+ assertUndeployAfter(deployer3, deployer2);
+ assertEquals(4, deployer3.getUndeployOrder());
+ }
+
+ public void testChain() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer3 = new TestFlowDeployer("3");
+ deployer3.setInputs("test2");
+ addDeployer(main, deployer3);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setInputs("test1");
+ deployer2.setOutputs("test2");
+ addDeployer(main, deployer2);
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setOutputs("test1");
+ addDeployer(main, deployer1);
+
+ Deployment deployment = createSimpleDeployment("Chain");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(1, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(3, deployer3.getDeployOrder());
+ assertEquals(6, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(4, deployer3.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(7, deployer1.getDeployOrder());
+ assertEquals(8, deployer2.getDeployOrder());
+ assertEquals(9, deployer3.getDeployOrder());
+ assertEquals(6, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(4, deployer3.getUndeployOrder());
+ }
+
+ public void testComplicated() throws Exception
+ {
+ // (1) (2) (3)
+ // \ / |
+ // T1 T2
+ // | |
+ // (4)
+ // |
+ // T3
+ // |
+ // (5)
+ // | |
+ // T1 T3
+ // \ /
+ // (6)
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer6 = new TestFlowDeployer("6");
+ deployer6.setInputs("test1", "test3");
+ addDeployer(main, deployer6);
+ TestFlowDeployer deployer5 = new TestFlowDeployer("5");
+ deployer5.setInputs("test3");
+ deployer5.setOutputs("test3");
+ addDeployer(main, deployer5);
+ TestFlowDeployer deployer4 = new TestFlowDeployer("4");
+ deployer4.setInputs("test2");
+ deployer4.setOutputs("test3");
+ addDeployer(main, deployer4);
+ TestFlowDeployer deployer3 = new TestFlowDeployer("3");
+ deployer3.setOutputs("test2");
+ addDeployer(main, deployer3);
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setOutputs("test1");
+ addDeployer(main, deployer2);
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setOutputs("test1");
+ addDeployer(main, deployer1);
+
+ Deployment deployment = createSimpleDeployment("Complicated");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertDeployBefore(deployer6, deployer1);
+ assertDeployBefore(deployer6, deployer2);
+ assertDeployBefore(deployer4, deployer3);
+ assertDeployBefore(deployer5, deployer4);
+ assertDeployBefore(deployer6, deployer5);
+ 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();
+
+ assertDeployBefore(deployer6, deployer1);
+ assertDeployBefore(deployer6, deployer2);
+ assertDeployBefore(deployer4, deployer3);
+ assertDeployBefore(deployer5, deployer4);
+ assertDeployBefore(deployer6, deployer5);
+ assertUndeployAfter(deployer6, deployer1);
+ assertUndeployAfter(deployer6, deployer2);
+ assertUndeployAfter(deployer4, deployer3);
+ assertUndeployAfter(deployer5, deployer4);
+ assertUndeployAfter(deployer6, deployer5);
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertDeployBefore(deployer6, deployer1);
+ assertDeployBefore(deployer6, deployer2);
+ assertDeployBefore(deployer4, deployer3);
+ assertDeployBefore(deployer5, deployer4);
+ assertDeployBefore(deployer6, deployer5);
+ assertUndeployAfter(deployer6, deployer1);
+ assertUndeployAfter(deployer6, deployer2);
+ assertUndeployAfter(deployer4, deployer3);
+ assertUndeployAfter(deployer5, deployer4);
+ assertUndeployAfter(deployer6, deployer5);
+ }
+
+ public void testIntermediateIsRelativelySorted() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer2 = new TestFlowDeployer("A");
+ deployer2.setInputs("test1");
+ addDeployer(main, deployer2);
+ TestFlowDeployer deployer3 = new TestFlowDeployer("B");
+ addDeployer(main, deployer3);
+ TestFlowDeployer deployer1 = new TestFlowDeployer("C");
+ deployer1.setOutputs("test1");
+ addDeployer(main, deployer1);
+
+ Deployment deployment = createSimpleDeployment("IntermediateIsRelativelySorted");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertDeployBefore(deployer2, deployer1);
+ assertTrue("B doesn't deploy", deployer3.getDeployOrder() > 0);
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertDeployBefore(deployer2, deployer1);
+ assertTrue("B doesn't deploy", deployer3.getDeployOrder() > 0);
+ assertUndeployAfter(deployer2, deployer1);
+ assertTrue("B doesn't undeploy", deployer3.getUndeployOrder() > 0);
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertDeployBefore(deployer2, deployer1);
+ assertTrue("B doesn't deploy", deployer3.getDeployOrder() > 0);
+ assertUndeployAfter(deployer2, deployer1);
+ assertTrue("B doesn't undeploy", deployer3.getUndeployOrder() > 0);
+ }
+
+ public void testTransitionOrdering() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer1 = new TestFlowDeployer("A");
+ deployer1.setInputs("3");
+ deployer1.setOutputs("4");
+ addDeployer(main, deployer1);
+
+ TestFlowDeployer deployer2 = new TestFlowDeployer("B");
+ deployer2.setInputs("1");
+ deployer2.setOutputs("2");
+ addDeployer(main, deployer2);
+
+ TestFlowDeployer deployer3 = new TestFlowDeployer("C");
+ deployer3.setInputs("2");
+ deployer3.setOutputs("3");
+ addDeployer(main, deployer3);
+
+ Deployment deployment = createSimpleDeployment("TransitionOrdering");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(3, deployer1.getDeployOrder());
+ assertEquals(1, deployer2.getDeployOrder());
+ assertEquals(2, deployer3.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(3, deployer1.getDeployOrder());
+ assertEquals(1, deployer2.getDeployOrder());
+ assertEquals(2, deployer3.getDeployOrder());
+ assertEquals(4, deployer1.getUndeployOrder());
+ assertEquals(6, deployer2.getUndeployOrder());
+ assertEquals(5, deployer3.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(9, deployer1.getDeployOrder());
+ assertEquals(7, deployer2.getDeployOrder());
+ assertEquals(8, deployer3.getDeployOrder());
+ assertEquals(4, deployer1.getUndeployOrder());
+ assertEquals(6, deployer2.getUndeployOrder());
+ assertEquals(5, deployer3.getUndeployOrder());
+ }
+
+ public void testSymetricDots() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer1 = new TestFlowDeployer("XB");
+ deployer1.setInputs("X");
+ deployer1.setOutputs("B");
+ addDeployer(main, deployer1);
+
+ TestFlowDeployer deployer2 = new TestFlowDeployer("XX");
+ deployer2.setInputs("X");
+ deployer2.setOutputs("X");
+ addDeployer(main, deployer2);
+
+ TestFlowDeployer deployer3 = new TestFlowDeployer("AX");
+ deployer3.setInputs("A");
+ deployer3.setOutputs("X");
+ addDeployer(main, deployer3);
+
+ Deployment deployment = createSimpleDeployment("SymetricDots");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(3, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(1, deployer3.getDeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer3.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertEquals(3, deployer1.getDeployOrder());
+ assertEquals(2, deployer2.getDeployOrder());
+ assertEquals(1, deployer3.getDeployOrder());
+ assertEquals(4, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(6, deployer3.getUndeployOrder());
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertEquals(9, deployer1.getDeployOrder());
+ assertEquals(8, deployer2.getDeployOrder());
+ assertEquals(7, deployer3.getDeployOrder());
+ assertEquals(4, deployer1.getUndeployOrder());
+ assertEquals(5, deployer2.getUndeployOrder());
+ assertEquals(6, deployer3.getUndeployOrder());
+ }
+
+ public void testDoubleCycle() throws Exception
+ {
+ // (D) (H) (B) (E) (G)
+ // | |
+ // T1 2nd
+ // | |
+ // (F) (C)
+ // |
+ // T2
+ // |
+ // (A)
+ DeployerClient main = createMainDeployer();
+
+ TestFlowDeployer deployer2 = new TestFlowDeployer("A");
+ deployer2.setInputs("test2");
+ addDeployer(main, deployer2);
+
+ TestFlowDeployer deployer3 = new TestFlowDeployer("B");
+ addDeployer(main, deployer3);
+
+ TestFlowDeployer deployer6 = new TestFlowDeployer("C");
+ deployer6.setInputs("2ndcycle");
+ addDeployer(main, deployer6);
+
+ TestFlowDeployer deployer1 = new TestFlowDeployer("D");
+ deployer1.setOutputs("test1");
+ addDeployer(main, deployer1);
+
+ TestFlowDeployer deployer4 = new TestFlowDeployer("E");
+ addDeployer(main, deployer4);
+
+ TestFlowDeployer deployer5 = new TestFlowDeployer("F");
+ deployer5.setInputs("test1");
+ deployer5.setOutputs("test2");
+ addDeployer(main, deployer5);
+
+ TestFlowDeployer deployer7 = new TestFlowDeployer("G");
+ addDeployer(main, deployer7);
+
+ TestFlowDeployer deployer8 = new TestFlowDeployer("H");
+ deployer8.setOutputs("2ndcycle");
+ addDeployer(main, deployer8);
+
+ Deployment deployment = createSimpleDeployment("DoubleCycle");
+ main.addDeployment(deployment);
+ main.process();
+
+ assertDeploy(deployer3);
+ assertDeployBefore(deployer6, deployer8);
+ assertDeployBefore(deployer5, deployer1);
+ assertDeploy(deployer4);
+ assertDeployBefore(deployer2, deployer5);
+ assertDeploy(deployer7);
+ assertEquals(-1, deployer3.getUndeployOrder());
+ assertEquals(-1, deployer8.getUndeployOrder());
+ assertEquals(-1, deployer6.getUndeployOrder());
+ assertEquals(-1, deployer1.getUndeployOrder());
+ assertEquals(-1, deployer4.getUndeployOrder());
+ assertEquals(-1, deployer5.getUndeployOrder());
+ assertEquals(-1, deployer2.getUndeployOrder());
+ assertEquals(-1, deployer7.getUndeployOrder());
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ assertDeploy(deployer3);
+ assertDeployBefore(deployer6, deployer8);
+ assertDeployBefore(deployer5, deployer1);
+ assertDeploy(deployer4);
+ assertDeployBefore(deployer2, deployer5);
+ assertDeploy(deployer7);
+ assertUndeploy(deployer3);
+ assertUndeployAfter(deployer6, deployer8);
+ assertUndeployAfter(deployer5, deployer1);
+ assertUndeploy(deployer4);
+ assertUndeployAfter(deployer2, deployer5);
+ assertUndeploy(deployer7);
+
+ main.addDeployment(deployment);
+ main.process();
+
+ assertDeploy(deployer3);
+ assertDeployBefore(deployer6, deployer8);
+ assertDeployBefore(deployer5, deployer1);
+ assertDeploy(deployer4);
+ assertDeployBefore(deployer2, deployer5);
+ assertDeploy(deployer7);
+ assertUndeploy(deployer3);
+ assertUndeployAfter(deployer6, deployer8);
+ assertUndeployAfter(deployer5, deployer1);
+ assertUndeploy(deployer4);
+ assertUndeployAfter(deployer2, deployer5);
+ assertUndeploy(deployer7);
+ }
+
+ public void testOrderedThenFlowWithPassThrough() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+
+ TestFlowDeployer deployer4 = new TestFlowDeployer("4");
+ deployer4.setInputs("test");
+ addDeployer(main, deployer4);
+
+ TestFlowDeployer deployer3 = new TestFlowDeployer("3");
+ deployer3.setRelativeOrder(3);
+ deployer3.setInputs("test");
+ deployer3.setOutputs("test");
+ addDeployer(main, deployer3);
+
+ TestFlowDeployer deployer2 = new TestFlowDeployer("2");
+ deployer2.setRelativeOrder(2);
+ addDeployer(main, deployer2);
+
+ TestFlowDeployer deployer1 = new TestFlowDeployer("1");
+ deployer1.setRelativeOrder(1);
+ addDeployer(main, deployer1);
+
+ Deployment deployment = createSimpleDeployment("orderedThenFlowWithPassThrough");
+ 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());
+ }
+
+ public void testSimplePassThrough() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+
+ TestFlowDeployer postJBWMD = new TestFlowDeployer("PassThrough");
+ postJBWMD.setInputs("JBWMD", "CLMD");
+ postJBWMD.setOutputs("JBWMD", "CLMD");
+ addDeployer(main, postJBWMD);
+ }
+
+ public void testWebBeansOrder() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+
+ TestFlowDeployer mcfcld = new TestFlowDeployer("ManagedConnectionFactory");
+ mcfcld.setInputs("ManagedConnectionFactoryDeploymentGroup");
+ mcfcld.setOutputs("CLMD");
+ addDeployer(main, mcfcld);
+
+ TestFlowDeployer postJBWMD = new TestFlowDeployer("PostJBossWebMetadataDeployer");
+ postJBWMD.setInputs("JBWMD", "CLMD");
+ postJBWMD.setOutputs("JBWMD", "CLMD");
+ addDeployer(main, postJBWMD);
+
+ TestFlowDeployer postEJB = new TestFlowDeployer("PostEjbJar");
+ postEJB.setInputs("EJB");
+ postEJB.setOutputs("EJB");
+ addDeployer(main, postEJB);
+
+ TestFlowDeployer warCL = new TestFlowDeployer("WarClassLoaderDeployer");
+ warCL.setInputs("JBWMD", "CLMD");
+ warCL.setOutputs("CLMD");
+ addDeployer(main, warCL);
+
+ TestFlowDeployer service = new TestFlowDeployer("ServiceCL");
+ service.setInputs("ServiceDeployment");
+ service.setOutputs("CLMD");
+ addDeployer(main, service);
+
+ TestFlowDeployer legacy = new TestFlowDeployer("Legacy");
+ legacy.setInputs("JBWMD", "WMD");
+ legacy.setOutputs("JBWMD");
+ addDeployer(main, legacy);
+
+ TestFlowDeployer cluster = new TestFlowDeployer("Cluster");
+ cluster.setInputs("JBWMD");
+ cluster.setOutputs("JBWMD");
+ addDeployer(main, cluster);
+
+ TestFlowDeployer postWMD = new TestFlowDeployer("PostWebMetadataDeployer");
+ postWMD.setInputs("JBWMD");
+ postWMD.setOutputs("JBWMD");
+ 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();
+ }
+
+ 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 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( "6", "7", "8" ); // 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();
+ }
+
+ public void testPartialOverlapping() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+
+ // "1", "2", are provided by other preceding deployers
+ TestFlowDeployer deployer1 = new TestFlowDeployer( "#1_12-2345" );
+ deployer1.setInputs( "1", "2" );
+ deployer1.setOutputs( "3", "5", "2", "4" );
+ addDeployer(main, deployer1);
+
+ TestFlowDeployer deployer2 = new TestFlowDeployer( "#2_125-246" );
+ deployer2.setInputs( "1", "5", "2" ); // depends on 5 (output of deployer1)
+ deployer2.setOutputs( "6", "2", "4" );
+ addDeployer(main, deployer2);
+
+ TestFlowDeployer deployer3 = new TestFlowDeployer( "#3_1256-247" );
+ deployer3.setInputs( "6", "1", "5", "2" ); // depends on 6 (output of deployer2) and 5 (output of deployer1)
+ deployer3.setOutputs( "7", "2", "4" );
+ addDeployer( main, deployer3 );
+
+ TestFlowDeployer deployer4 = new TestFlowDeployer( "#4_124-28" );
+ deployer4.setInputs( "1", "2", "4" ); // depends on 4 (output of deployer1, deployer2 and deployer3)
+ deployer4.setOutputs( "8", "2" );
+ 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();
+ }
+
+ /*
+ * Tests algorithm performance on complete oriented graph.
+ * All dependencies are specified using inputs/outputs.
+ */
+ public void testAlgorithmPerformance() throws Exception
+ {
+
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer;
+ final int COUNT_OF_DEPLOYERS = 500;
+
+ List<TestFlowDeployer> deployers = new LinkedList<TestFlowDeployer>();
+
+ for (int i = 0; i < COUNT_OF_DEPLOYERS; i++)
+ {
+ deployer = new TestFlowDeployer( String.valueOf(i) );
+ deployer.setOutputs( String.valueOf(i) );
+ for (int j = 0; j < i; j++) deployer.addInput( String.valueOf(j) );
+ deployers.add(deployer);
+ }
+
+ long start = System.currentTimeMillis();
+ for (TestFlowDeployer d : deployers)
+ {
+ addDeployer(main, d);
+ }
+ long end = System.currentTimeMillis();
+
+ System.out.println("------------------------------------------------------------------------");
+ System.out.println("Exhaustive deployer sorting 1 (" + getClass().getSimpleName() + ") took: " + (end - start) + " milliseconds");
+ System.out.println("------------------------------------------------------------------------");
+
+ // test proper deployers order
+ Deployment deployment = createSimpleDeployment( "exhaustiveDeployersOrderTest" );
+
+ main.addDeployment(deployment);
+ main.process();
+
+ for (int i = 0; i < COUNT_OF_DEPLOYERS; i++)
+ {
+ deployer = deployers.get(i);
+ assertEquals(i + 1, deployer.getDeployOrder());
+ assertEquals(-1, deployer.getUndeployOrder());
+ }
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ for (int i = 0; i < COUNT_OF_DEPLOYERS; i++)
+ {
+ deployer = deployers.get(i);
+ assertEquals(i + 1, deployer.getDeployOrder());
+ assertEquals(2*COUNT_OF_DEPLOYERS - i, deployer.getUndeployOrder());
+ }
+ }
+
+ /*
+ * Tests algorithm performance on complete oriented graph
+ * where vertex in this graph is represented as set of deployers.
+ * Deployers that are in specific vertex are ordered using deployer ordering feature.
+ */
+ public void testAlgorithmPerformance2() throws Exception
+ {
+ DeployerClient main = createMainDeployer();
+ TestFlowDeployer deployer;
+ final int COUNT_OF_DEPLOYERS = 1000;
+ final int MODULO = 50; // count of deployers in particular vertex
+
+ List<TestFlowDeployer> deployers = new LinkedList<TestFlowDeployer>();
+
+ for (int i = 0; i < COUNT_OF_DEPLOYERS; i++)
+ {
+ deployer = new TestFlowDeployer( String.valueOf(i) );
+ deployer.setOutputs( String.valueOf(i / MODULO) );
+ deployer.setRelativeOrder(i % MODULO);
+ for (int j = 0; j < i/MODULO; j++)
+ deployer.addInput( String.valueOf(j) );
+
+ deployers.add(deployer);
+ }
+
+ long start = System.currentTimeMillis();
+ for (TestFlowDeployer d : deployers)
+ {
+ addDeployer(main, d);
+ }
+ long end = System.currentTimeMillis();
+
+ System.out.println("------------------------------------------------------------------------");
+ System.out.println("Exhaustive deployer sorting 2 (" + getClass().getSimpleName() + ") took: " + (end - start) + " milliseconds");
+ System.out.println("------------------------------------------------------------------------");
+
+ // test proper deployers order
+ Deployment deployment = createSimpleDeployment( "exhaustiveDeployersOrderTest" );
+
+ main.addDeployment(deployment);
+ main.process();
+
+ int deployerDeployOrder;
+ int deployerUndeployOrder;
+ int deployerDeployOrderInModulo;
+ int deployerUndeployOrderInModulo;
+ int level;
+ for (int i = 0; i < COUNT_OF_DEPLOYERS; i++)
+ {
+ level = i / MODULO;
+ deployer = deployers.get(i);
+ deployerDeployOrder = deployer.getDeployOrder();
+ deployerDeployOrderInModulo = (deployerDeployOrder - 1) / MODULO;
+ deployerUndeployOrder = deployer.getUndeployOrder();
+ assertTrue("Wrong deployer(" + i + ") deploy order: " + deployerDeployOrder, level <= deployerDeployOrderInModulo && deployerDeployOrderInModulo < (level + 1));
+ assertEquals(i + 1, deployerDeployOrder); // remove if [JBDEPLOY-233] will be fixed
+ assertEquals(-1, deployerUndeployOrder);
+ }
+
+ main.removeDeployment(deployment);
+ main.process();
+
+ for (int i = 0; i < COUNT_OF_DEPLOYERS; i++)
+ {
+ level = i / MODULO;
+ deployer = deployers.get(i);
+ deployerDeployOrder = deployer.getDeployOrder();
+ deployerDeployOrderInModulo = (deployerDeployOrder - 1) / MODULO;
+ deployerUndeployOrder = deployer.getUndeployOrder();
+ deployerUndeployOrderInModulo = (deployerUndeployOrder - 1) / MODULO;
+ assertTrue("Wrong deployer(" + i + ") deploy order: " + deployerDeployOrder, level <= deployerDeployOrderInModulo && deployerDeployOrderInModulo < (level + 1));
+ assertEquals(i + 1, deployer.getDeployOrder()); // remove if [JBDEPLOY-233] will be fixed
+ assertTrue("Wrong deployer(" + i + ") undeploy order: " + deployerUndeployOrder, (2 * COUNT_OF_DEPLOYERS - level) >= deployerUndeployOrderInModulo && deployerUndeployOrderInModulo < (2 * COUNT_OF_DEPLOYERS - (level + 1)));
+ assertEquals(2 * COUNT_OF_DEPLOYERS - i, deployer.getUndeployOrder()); // remove if [JBDEPLOY-233] will be fixed
+ }
+ }
+
+ public void testRealWorldAS6DeployersScenario() throws Exception
+ {
+ // THIS IS REAL WORLD SCENARIO - AS deployers with their dependencies
+ DeployerClient main = createMainDeployer();
+ AbstractDeployer deployer;
+ long start = System.currentTimeMillis();
+
+ // PARSE
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.deployer.kernel.BeanDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.kernel.spi.deployment.KernelDeployment" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.plugins.annotations.ScanningMetaDataDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.deployers.spi.annotations.ScanningMetaData", "org.jboss.deployers.plugins.annotations.AbstractScanningMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.plugins.dependency.AliasesParserDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.deployers.vfs.plugins.dependency.DeploymentAliases" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.plugins.dependency.DependenciesParserDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.deployers.vfs.plugins.dependency.DependenciesMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.hibernate.deployers.metadata.HibernateMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.xnio.metadata.XnioMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.security.microcontainer.beans.metadata.SecurityPolicyMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.logging.metadata.LoggingMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.threads.metadata.ThreadsMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.aop.microcontainer.beans.metadata.AOPDeployment" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployment.AppParsingDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.metadata.ear.spec.EarMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployment.JBossAppParsingDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.metadata.ear.jboss.JBossAppMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ejb3.deployers.AppClientParsingDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.metadata.client.spec.ApplicationClientMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ejb3.deployers.JBossClientParsingDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setInputs( "org.jboss.metadata.client.spec.ApplicationClientMetaData" );
+ deployer.setOutputs( "org.jboss.metadata.client.jboss.JBossClientMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ejb3.deployers.PersistenceUnitParsingDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.metadata.jpa.spec.PersistenceMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.jpa.deployers.PersistenceParsingDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.metadata.jpa.spec.PersistenceMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.resource.deployers.ManagedConnectionFactoryParserDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.resource.deployers.RARParserDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.resource.metadata.RARDeploymentMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.security.deployers.AclConfigParsingDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.security.acl.config.ACLConfiguration" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.security.deployers.XacmlConfigParsingDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "javax.xml.bind.JAXBElement" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.system.deployers.SARDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.system.metadata.ServiceDeployment" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.varia.deployment.LegacyBeanShellDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.varia.deployment.BeanShellScript" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDescriptorDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.aop.asintegration.jboss5.AOPAnnotationMetaDataParserDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.aop.microcontainer.beans.metadata.AOPDeployment" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployment.EARContentsDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.metadata.ear.jboss.JBossAppMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployment.WebAppParsingDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.metadata.web.spec.WebMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployment.WebAppFragmentParsingDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.metadata.web.spec.WebFragmentMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployment.TldParsingDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.metadata.web.spec.TldMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployment.JBossWebAppParsingDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setInputs( "org.jboss.metadata.web.spec.WebMetaData" );
+ deployer.setOutputs( "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployment.EjbParsingDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setOutputs( "org.jboss.metadata.ejb.spec.EjbJarMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployment.JBossEjbParsingDeployer" );
+ deployer.setStage(DeploymentStages.PARSE);
+ deployer.setInputs( "org.jboss.metadata.ejb.spec.EjbJarMetaData" );
+ deployer.setOutputs( "standardjboss.xml", "org.jboss.metadata.ejb.jboss.JBossMetaData", "org.jboss.metadata.ApplicationMetaData" );
+ addDeployer(main, deployer);
+
+ // POST_PARSE
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.plugins.dependency.DependenciesMetaDataDeployer" );
+ deployer.setStage(DeploymentStages.POST_PARSE);
+ deployer.setInputs( "org.jboss.deployers.vfs.plugins.dependency.DependenciesMetaData" );
+ deployer.setOutputs( "org.jboss.deployers.vfs.plugins.dependency.DeploymentDependencies" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.plugins.dependency.DeploymentAliasesDeployer" );
+ deployer.setStage(DeploymentStages.POST_PARSE);
+ deployer.setInputs( "org.jboss.deployers.vfs.plugins.dependency.DeploymentAliases" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.plugins.dependency.DeploymentDependencyDeployer" );
+ deployer.setStage(DeploymentStages.POST_PARSE);
+ deployer.setInputs( "org.jboss.deployers.vfs.plugins.dependency.DeploymentDependencies" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployment.EarClassLoaderDeployer" );
+ deployer.setStage(DeploymentStages.POST_PARSE);
+ deployer.setInputs( "org.jboss.metadata.ear.jboss.JBossAppMetaData" );
+ deployer.setOutputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployment.EjbClassLoaderDeployer" );
+ deployer.setStage(DeploymentStages.POST_PARSE);
+ deployer.setInputs( "org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ deployer.setOutputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployment.LegacyWebXmlLessDeployer" );
+ deployer.setStage(DeploymentStages.POST_PARSE);
+ deployer.setInputs( "org.jboss.metadata.web.spec.WebMetaData", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.resource.deployers.ManagedConnectionFactoryClassLoaderDeployer" );
+ deployer.setStage(DeploymentStages.POST_PARSE);
+ deployer.setInputs( "org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup" );
+ deployer.setOutputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.system.deployers.ServiceClassLoaderDeployer" );
+ deployer.setStage(DeploymentStages.POST_PARSE);
+ deployer.setInputs( "org.jboss.system.metadata.ServiceDeployment" );
+ deployer.setOutputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.web.tomcat.service.deployers.ClusteringDefaultsDeployer" );
+ deployer.setStage(DeploymentStages.POST_PARSE);
+ deployer.setInputs( "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.web.tomcat.service.deployers.WarClassLoaderDeployer" );
+ deployer.setStage(DeploymentStages.POST_PARSE);
+ deployer.setInputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.weld.integration.deployer.metadata.PostJBossMetadataDeployer" );
+ deployer.setStage(DeploymentStages.POST_PARSE);
+ deployer.setInputs( "org.jboss.metadata.ejb.jboss.JBossMetaData", "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ deployer.setOutputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.weld.integration.deployer.metadata.PostJBossWebMetadataDeployer" );
+ deployer.setStage(DeploymentStages.POST_PARSE);
+ deployer.setInputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.weld.integration.deployer.metadata.WeldFilesDeployer" );
+ deployer.setStage(DeploymentStages.POST_PARSE);
+ deployer.setInputs( "org.jboss.weld.integration.deployer.ext.JBossWeldMetaData" );
+ deployer.setOutputs( "WELD_FILES", "WELD_CLASSPATH" );
+ addDeployer(main, deployer);
+
+ // PRE_DESCRIBE
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.plugins.classloading.ClassLoadingDefaultDeployer" );
+ deployer.setStage(DeploymentStages.PRE_DESCRIBE);
+ deployer.setInputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ deployer.setOutputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ addDeployer(main, deployer);
+
+ // DESCRIBE
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.plugins.classloader.InMemoryClassesDeployer" );
+ deployer.setStage(DeploymentStages.DESCRIBE);
+ deployer.setOutputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.seam.integration.microcontainer.deployers.SeamWebUrlIntegrationDeployer" );
+ deployer.setStage(DeploymentStages.DESCRIBE);
+ deployer.setInputs( "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.weld.integration.deployer.cl.WeldFacesIntegrationDeployer" );
+ deployer.setStage(DeploymentStages.DESCRIBE);
+ deployer.setInputs( "WELD_FILES" );
+ deployer.setOutputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderClassPathDeployer" );
+ deployer.setStage(DeploymentStages.DESCRIBE);
+ deployer.setInputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ deployer.setOutputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderDescribeDeployer" );
+ deployer.setStage(DeploymentStages.DESCRIBE);
+ deployer.setInputs( "org.jboss.classloading.spi.metadata.ClassLoadingMetaData" );
+ deployer.setOutputs( "org.jboss.classloading.spi.dependency.Module" );
+ addDeployer(main, deployer);
+
+ // CLASSLOADER
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.plugins.classloading.AbstractLevelClassLoaderSystemDeployer" );
+ deployer.setStage(DeploymentStages.CLASSLOADER);
+ deployer.setInputs( "org.jboss.deployers.structure.spi.ClassLoaderFactory" );
+ deployer.setOutputs( "java.lang.ClassLoader" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.aop.asintegration.jboss5.AOPClassLoaderDeployer" );
+ deployer.setStage(DeploymentStages.CLASSLOADER);
+ deployer.setInputs( "java.lang.ClassLoader" );
+ addDeployer(main, deployer);
+
+ // POST_CLASSLOADER
+
+ deployer = new TestDeployerAdapter( "org.jboss.aop.asintegration.jboss5.AOPDeploymentAopMetaDataDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "org.jboss.aop.microcontainer.beans.metadata.AOPDeployment" );
+ deployer.setOutputs( "org.jboss.aop.asintegration.jboss5.AopMetaDataDeployerOutput" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.aop.asintegration.jboss5.BeansDeploymentAopMetaDataDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "org.jboss.kernel.spi.deployment.KernelDeployment" );
+ deployer.setOutputs( "org.jboss.aop.asintegration.jboss5.AopMetaDataDeployerOutput" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployment.EarLibExcludeDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "org.jboss.metadata.ear.jboss.JBossAppMetaData" );
+ deployer.setOutputs( "org.jboss.classloading.spi.visitor.ResourceFilter.recurse" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.plugins.annotations.FilteredAnnotationEnvironmentDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "org.jboss.deployers.spi.annotations.ScanningMetaData", "org.jboss.classloading.spi.visitor.ResourceFilter.resource", "org.jboss.classloading.spi.dependency.Module", "org.jboss.classloading.spi.visitor.ResourceFilter.recurse" );
+ deployer.setOutputs( "org.jboss.deployers.spi.annotations.AnnotationEnvironment" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployment.EarSecurityDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "org.jboss.metadata.ear.jboss.JBossAppMetaData" );
+ deployer.setOutputs( "jboss.jacc", "org.jboss.system.metadata.ServiceMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployment.OptAnnotationMetaDataDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "org.jboss.metadata.web.spec.WebMetaData", "org.jboss.metadata.client.spec.ApplicationClientMetaData", "org.jboss.deployers.spi.annotations.AnnotationEnvironment", "org.jboss.metadata.ejb.spec.EjbJarMetaData" );
+ deployer.setOutputs( "annotated.org.jboss.metadata.web.spec.WebMetaData", "annotated.org.jboss.metadata.ejb.spec.EjbJarMetaData", "annotated.org.jboss.metadata.client.spec.ApplicationClientMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ejb.deployers.MergedJBossMetaDataDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "annotated.org.jboss.metadata.ejb.spec.EjbJarMetaData", "org.jboss.metadata.ejb.jboss.JBossMetaData", "org.jboss.metadata.ejb.spec.EjbJarMetaData" );
+ deployer.setOutputs( "merged.org.jboss.metadata.ejb.jboss.JBossMetaData", "org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ejb3.deployers.MergedJBossClientMetaDataDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "org.jboss.metadata.client.jboss.JBossClientMetaData", "annotated.org.jboss.metadata.client.spec.ApplicationClientMetaData", "org.jboss.metadata.client.spec.ApplicationClientMetaData" );
+ deployer.setOutputs( "org.jboss.metadata.client.jboss.JBossClientMetaData", "merged.org.jboss.metadata.client.jboss.JBossClientMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ha.framework.server.deployers.Ejb2HAPartitionDependencyDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "merged.org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ deployer.setOutputs( "merged.org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ha.framework.server.deployers.Ejb3HAPartitionDependencyDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "merged.org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ deployer.setOutputs( "merged.org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ejb.deployers.StandardJBossMetaDataDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "standardjboss.xml", "merged.org.jboss.metadata.ejb.jboss.JBossMetaData", "org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ deployer.setOutputs( "raw.org.jboss.metadata.ejb.jboss.JBossMetaData", "org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ejb3.deployers.Ejb3MetadataProcessingDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "merged.org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ deployer.setOutputs( "processed.org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ejb3.deployers.EjbMetadataJndiPolicyDecoratorDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "processed.org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ deployer.setOutputs( "EjbMetadataJndiPolicyDecoratorDeployer" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.weld.integration.deployer.metadata.PostWebMetadataDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "merged.org.jboss.metadata.web.jboss.JBossWebMetaData", "WELD_FILES", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.weld.integration.deployer.metadata.WeldEjbInterceptorMetadataDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "WELD_FILES", "merged.org.jboss.metadata.ejb.jboss.JBossMetaData", "org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ deployer.setOutputs( "org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ejb.deployers.EjbSecurityDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "merged.org.jboss.metadata.ejb.jboss.JBossMetaData", "org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ deployer.setOutputs( "jboss.jacc", "org.jboss.system.metadata.ServiceMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.web.deployers.WarAnnotationMetaDataDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "org.jboss.metadata.web.spec.WebMetaData" );
+ deployer.setOutputs( "annotated.org.jboss.metadata.web.spec.WebMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.web.deployers.MergedJBossWebMetaDataDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "annotated.org.jboss.metadata.web.spec.WebMetaData", "org.jboss.metadata.web.spec.WebMetaData", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "overlays.org.jboss.metadata.web.spec.WebMetaData", "org.jboss.metadata.web.jboss.JBossWebMetaData", "order.org.jboss.metadata.web.spec.WebMetaData", "localscis.org.jboss.metadata.web.spec.WebMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployment.MappedReferenceMetaDataResolverDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "org.jboss.metadata.client.jboss.JBossClientMetaData", "org.jboss.metadata.ejb.jboss.JBossMetaData", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "org.jboss.deployment.spi.DeploymentEndpointResolver" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.web.deployers.ServletContainerInitializerDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "org.jboss.metadata.web.jboss.JBossWebMetaData", "order.org.jboss.metadata.web.spec.WebMetaData", "localscis.org.jboss.metadata.web.spec.WebMetaData" );
+ deployer.setOutputs( "sci.org.jboss.metadata.web.spec.WebMetaData", "sci.handlestypes.org.jboss.metadata.web.spec.WebMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.web.deployers.WarSecurityDeployer" );
+ deployer.setStage(DeploymentStages.POST_CLASSLOADER);
+ deployer.setInputs( "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "jboss.jacc", "org.jboss.system.metadata.ServiceMetaData" );
+ addDeployer(main, deployer);
+
+ // PRE_REAL
+
+ deployer = new TestDeployerAdapter( "org.jboss.beanvalidation.deployers.ValidatorFactoryDeployer" );
+ deployer.setStage(DeploymentStages.PRE_REAL);
+ deployer.setOutputs( "javax.validation.ValidatorFactory" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ejb3.deployers.Ejb3DependenciesDeployer" );
+ deployer.setStage(DeploymentStages.PRE_REAL);
+ deployer.setInputs( "org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ deployer.setOutputs( "org.jboss.deployers.vfs.plugins.dependency.DependenciesMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.system.server.profileservice.persistence.deployer.ProfileServicePersistenceDeployer" );
+ deployer.setStage(DeploymentStages.PRE_REAL);
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.weld.integration.deployer.env.EjbServicesDeployer" );
+ deployer.setStage(DeploymentStages.PRE_REAL);
+ deployer.setInputs( "WELD_FILES", "org.jboss.weld.integration.deployer.env.BootstrapInfo" );
+ deployer.setOutputs( "BootstrapInfoEJB_SERVICES", "org.jboss.weld.integration.deployer.env.BootstrapInfo" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.weld.integration.deployer.env.WeldDiscoveryDeployer" );
+ deployer.setStage(DeploymentStages.PRE_REAL);
+ deployer.setInputs( "org.jboss.weld.integration.deployer.ext.JBossWeldMetaData", "WELD_FILES", "WELD_CLASSPATH" );
+ deployer.setOutputs( "org.jboss.weld.integration.deployer.env.WeldDiscoveryEnvironment" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.weld.integration.deployer.env.FlatDeploymentDeployer" );
+ deployer.setStage(DeploymentStages.PRE_REAL);
+ deployer.setInputs( "WELD_FILES", "org.jboss.weld.integration.deployer.env.BootstrapInfo", "org.jboss.weld.integration.deployer.env.WeldDiscoveryEnvironment", "BootstrapInfoEJB_SERVICES" );
+ deployer.setOutputs( "org.jboss.beans.metadata.spi.BeanMetaData", "org.jboss.weld.integration.deployer.env.BootstrapInfo", "BootstrapInfoDEPLOYMENT" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.weld.integration.deployer.env.WeldBootstrapDeployer" );
+ deployer.setStage(DeploymentStages.PRE_REAL);
+ deployer.setInputs( "javax.validation.ValidatorFactory", "WELD_FILES", "org.jboss.weld.integration.deployer.env.BootstrapInfo" );
+ deployer.setOutputs( "org.jboss.beans.metadata.spi.BeanMetaData" );
+ addDeployer(main, deployer);
+
+ // REAL
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.threads.metadata.ThreadsMetaData" );
+ deployer.setOutputs( "org.jboss.beans.metadata.spi.BeanMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.logging.metadata.LoggingMetaData" );
+ deployer.setOutputs( "org.jboss.beans.metadata.spi.BeanMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.xnio.metadata.XnioMetaData" );
+ deployer.setOutputs( "org.jboss.beans.metadata.spi.BeanMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ejb.deployers.CreateDestinationDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ deployer.setOutputs( "org.jboss.metadata.ejb.jboss.JBossMetaData", "org.jboss.system.metadata.ServiceMetaData", "org.jboss.kernel.spi.deployment.KernelDeployment" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ejb.deployers.EjbDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ deployer.setOutputs( "org.jboss.ejb.deployers.EjbDeployment", "org.jboss.system.metadata.ServiceMetaData", "org.jboss.kernel.spi.deployment.KernelDeployment" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ejb3.deployers.Ejb3ClientDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.metadata.client.jboss.JBossClientMetaData" );
+ deployer.setOutputs( "org.jboss.ejb3.clientmodule.ClientENCInjectionContainer", "org.jboss.kernel.spi.deployment.KernelDeployment" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ejb3.deployers.Ejb3Deployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.metadata.ejb.jboss.JBossMetaData", "processed.org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ deployer.setOutputs( "org.jboss.ejb3.Ejb3Deployment", "org.jboss.kernel.spi.deployment.KernelDeployment" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.deployer.kernel.AliasDeploymentDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.kernel.spi.deployment.KernelDeployment", "org.jboss.beans.metadata.spi.NamedAliasMetaData" );
+ deployer.setOutputs( "org.jboss.beans.metadata.spi.NamedAliasMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ejb3.endpoint.deployers.EJB3EndpointDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ deployer.setOutputs( "org.jboss.beans.metadata.spi.BeanMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.ejb3.metrics.deployer.Ejb3MetricsDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.ejb3.Ejb3Deployment" );
+ deployer.setOutputs( "org.jboss.ejb3.metrics.deployer.Ejb3MetricsDeployer" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.hibernate.deployers.HibernateDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.hibernate.deployers.metadata.HibernateMetaData" );
+ deployer.setOutputs( "org.jboss.beans.metadata.spi.BeanMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.jpa.deployers.PersistenceDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.metadata.jpa.spec.PersistenceMetaData" );
+ deployer.setOutputs( "org.jboss.metadata.jpa.spec.PersistenceUnitMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.jpa.deployers.PersistenceUnitDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.metadata.jpa.spec.PersistenceUnitMetaData" );
+ deployer.setOutputs( "org.jboss.beans.metadata.spi.BeanMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.beans.metadata.spi.BeanMetaData", "org.jboss.kernel.spi.deployment.KernelDeployment" );
+ deployer.setOutputs( "org.jboss.beans.metadata.spi.BeanMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.beans.metadata.spi.BeanMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.deployers.vfs.deployer.kernel.DeploymentAliasMetaDataDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.beans.metadata.spi.BeanMetaData", "org.jboss.beans.metadata.spi.NamedAliasMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.management.j2ee.deployers.EarModuleJSR77Deployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.metadata.ear.jboss.JBossAppMetaData" );
+ deployer.setOutputs( "javax.management.ObjectName" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.management.j2ee.deployers.EjbModuleJSR77Deployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.metadata.ejb.jboss.JBossMetaData" );
+ deployer.setOutputs( "javax.management.ObjectName" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.management.j2ee.deployers.JCAResourceJSR77Deployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup" );
+ deployer.setOutputs( "javax.management.ObjectName" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.management.j2ee.deployers.RarModuleJSR77Deployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.resource.metadata.RARDeploymentMetaData" );
+ deployer.setOutputs( "javax.management.ObjectName" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.resource.deployers.ManagedConnectionFactoryDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup" );
+ deployer.setOutputs( "org.jboss.system.metadata.ServiceDeployment" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.management.j2ee.deployers.ServiceModuleJSR77Deployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.system.metadata.ServiceDeployment" );
+ deployer.setOutputs( "javax.management.ObjectName" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.resource.deployers.RARDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.resource.metadata.RARDeploymentMetaData" );
+ deployer.setOutputs( "org.jboss.system.metadata.ServiceMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.varia.deployment.LegacyBeanShellScriptDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.varia.deployment.BeanShellScript" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSEJBAdapterDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.ejb3.Ejb3Deployment", "merged.org.jboss.metadata.ejb.jboss.JBossMetaData", "org.jboss.ejb.deployers.EjbDeployment", "org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData" );
+ deployer.setOutputs( "org.jboss.wsf.spi.deployment.integration.WebServiceDeployment" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSTypeDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.wsf.spi.deployment.integration.WebServiceDeployment", "org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "org.jboss.metadata.web.jboss.JBossWebMetaData", "org.jboss.wsf.spi.deployment.Deployment$DeploymentType" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.metadata.web.jboss.JBossWebMetaData", "org.jboss.wsf.spi.deployment.Deployment$DeploymentType" );
+ deployer.setOutputs( "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "jbossws.EndpointMetrics", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "jbossws.VFSRoot", "jbossws.ContainerMetaData", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.wsf.spi.deployment.Deployment", "jbossws.ContainerMetaData", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata", "jbossws.VirtualHosts" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.wsf.spi.deployment.Deployment", "jbossws.ContainerMetaData", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "jbossws.ContextRoot", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "jbossws.ContextRoot", "org.jboss.wsf.spi.deployment.Deployment", "jbossws.ContainerMetaData", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "jbossws.URLPattern", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "jbossws.URLPattern", "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.EndpointAddress", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "jbossws.URLPattern", "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "jbossws.EndpointName", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "jbossws.EndpointName", "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "jbossws.RegisteredEndpoint", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "jbossws.URLPattern", "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.VirtualHosts" );
+ deployer.setOutputs( "jbossws.WebMetaData", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.wsf.spi.deployment.Deployment", "jbossws.ContainerMetaData", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "jbossws.StackEndpointHandler", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "jbossws.JAXBIntros", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "jbossws.JAXBIntros", "jbossws.VFSRoot", "jbossws.URLPattern", "org.jboss.wsf.spi.deployment.Deployment", "jbossws.ContainerMetaData", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "jbossws.UnifiedMetaDataModel", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "jbossws.UnifiedMetaDataModel", "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "jbossws.JAXBIntros", "jbossws.UnifiedMetaDataModel", "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "jbossws.PublishedContract", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "jbossws.UnifiedMetaDataModel", "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "jbossws.InitializedMetaDataModel", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "jbossws.UnifiedMetaDataModel", "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "jbossws.StackEndpointHandler", "jbossws.UnifiedMetaDataModel", "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "jbossws.StackDescriptor", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.ContextProperties", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "jbossws.WebMetaData", "org.jboss.wsf.spi.deployment.Deployment", "jbossws.StackDescriptor", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.ContextProperties" );
+ deployer.setOutputs( "jbossws.WebMetaData", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "jbossws.WebMetaData", "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "jbossws.JACCPermisions", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "jbossws.WebMetaData", "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "jbossws.InjectionMetaData", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "jbossws.RegisteredEndpoint", "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "jbossws.EndpointRecordProcessors", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.wsf.spi.deployment.Deployment", "org.jboss.metadata.web.jboss.JBossWebMetaData", "jbossws.metadata" );
+ deployer.setOutputs( "jbossws.LifecycleHandler", "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.management.j2ee.deployers.WebModuleJSR77Deployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "javax.management.ObjectName" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.web.tomcat.service.deployers.TomcatDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.metadata.web.jboss.JBossWebMetaData" );
+ deployer.setOutputs( "org.jboss.web.deployers.WarDeployment", "org.jboss.system.metadata.ServiceMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.system.deployers.ServiceDeploymentDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.system.metadata.ServiceDeployment", "org.jboss.system.metadata.ServiceMetaData" );
+ deployer.setOutputs( "org.jboss.system.metadata.ServiceMetaData" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.management.j2ee.deployers.JMSResourceJSR77Deployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.system.metadata.ServiceMetaData" );
+ deployer.setOutputs( "javax.management.ObjectName" );
+ addDeployer(main, deployer);
+
+ deployer = new TestDeployerAdapter( "org.jboss.system.deployers.ServiceDeployer" );
+ deployer.setStage(DeploymentStages.REAL);
+ deployer.setInputs( "org.jboss.system.metadata.ServiceMetaData" );
+ addDeployer(main, deployer);
+
+ long end = System.currentTimeMillis();
+ System.out.println("------------------------------------------------------------------------");
+ System.out.println("Deployer sorting (" + getClass().getSimpleName() + ") took: " + (end - start) + " milliseconds");
+ System.out.println("------------------------------------------------------------------------");
+ }
+
+ private static void assertDeploy(TestFlowDeployer deployer)
+ {
+ assertTrue(deployer + " must deploy", deployer.getDeployOrder() > 0);
+ }
+
+ private static void assertDeployBefore(TestFlowDeployer after, TestFlowDeployer before)
+ {
+ assertTrue(before + " must deploy before " + after, after.getDeployOrder() > before.getDeployOrder());
+ }
+
+ private static void assertUndeploy(TestFlowDeployer deployer)
+ {
+ assertTrue(deployer + " must undeploy", deployer.getUndeployOrder() > 0);
+ }
+
+ private static void assertUndeployAfter(TestFlowDeployer after, TestFlowDeployer before)
+ {
+ assertTrue(before + " must undeploy after " + after, after.getUndeployOrder() < before.getUndeployOrder());
+ }
+}
\ No newline at end of file
Added: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/AbstractSorterOrderingUnitTest.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/AbstractSorterOrderingUnitTest.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/AbstractSorterOrderingUnitTest.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.deployer.test;
+
+import org.jboss.deployers.plugins.deployers.DeployersImpl;
+import org.jboss.deployers.plugins.sort.DeployerSorter;
+import org.jboss.deployers.plugins.sort.OldStagedSortedDeployers;
+
+/**
+ * Sorting via sorter.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public abstract class AbstractSorterOrderingUnitTest extends AbstractDeployerFlowUnitTest
+{
+ protected AbstractSorterOrderingUnitTest(String name)
+ {
+ super(name);
+ }
+
+ protected abstract DeployerSorter createSorter();
+
+ @Override
+ protected void applySortingChanges(DeployersImpl deployers)
+ {
+ OldStagedSortedDeployers sorter = new OldStagedSortedDeployers();
+ sorter.setSorter(createSorter());
+ deployers.setDeployersByStage(sorter);
+ }
+}
Added: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DependenciesTopologicalOrderingUnitTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DependenciesTopologicalOrderingUnitTestCase.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DependenciesTopologicalOrderingUnitTestCase.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.deployer.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.plugins.sort.DeployerSorter;
+import org.jboss.deployers.plugins.sort.DependenciesTopologicalDeployerSorter;
+
+/**
+ * Tests topological sorting.
+ *
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+public class DependenciesTopologicalOrderingUnitTestCase extends AbstractSorterOrderingUnitTest
+{
+ public DependenciesTopologicalOrderingUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(DependenciesTopologicalOrderingUnitTestCase.class);
+ }
+
+ @Override
+ protected DeployerSorter createSorter()
+ {
+ return new DependenciesTopologicalDeployerSorter();
+ }
+}
Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java 2010-05-18 13:34:14 UTC (rev 104930)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -23,1139 +23,29 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.jboss.deployers.client.spi.DeployerClient;
-import org.jboss.deployers.client.spi.Deployment;
-import org.jboss.test.deployers.AbstractDeployerTest;
-import org.jboss.test.deployers.deployer.support.TestFlowDeployer;
+import org.jboss.deployers.plugins.deployers.DeployersImpl;
+
/**
* DeployerOrderingUnitTestCase.
*
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
*/
-public class DeployerFlowUnitTestCase extends AbstractDeployerTest
+public class DeployerFlowUnitTestCase extends AbstractDeployerFlowUnitTest
{
- public static Test suite()
- {
- return new TestSuite(DeployerFlowUnitTestCase.class);
- }
-
public DeployerFlowUnitTestCase(String name)
{
super(name);
}
- protected void setUp() throws Exception
+ public static Test suite()
{
- super.setUp();
- TestFlowDeployer.reset();
+ return new TestSuite(DeployerFlowUnitTestCase.class);
}
- public void testSimpleInputOutputCorrectOrder() throws Exception
+ @Override
+ protected void applySortingChanges(DeployersImpl deployers)
{
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setOutputs("test");
- addDeployer(main, deployer1);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("test");
- 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());
+ // use default
}
-
- public void testSimpleInputOutputWrongOrder() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("test");
- addDeployer(main, deployer2);
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setOutputs("test");
- addDeployer(main, deployer1);
-
- Deployment deployment = createSimpleDeployment("wrongOrder");
- 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());
- }
-
- public void testInputOutputLoop() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setInputs("input1");
- deployer1.setOutputs("output1");
- addDeployer(main, deployer1);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("output1");
- deployer2.setOutputs("output2");
- addDeployer(main, deployer2);
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setInputs("output2");
- deployer3.setOutputs("input1");
- try
- {
- addDeployer(main, deployer3);
- fail("Should not be here!");
- }
- catch (Throwable t)
- {
- checkThrowable(IllegalStateException.class, t);
- }
- }
-
- public void testInputOutputTransient() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setOutputs("test");
- addDeployer(main, deployer1);
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setInputs("test");
- addDeployer(main, deployer3);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("test");
- deployer2.setOutputs("test");
- addDeployer(main, deployer2);
-
- Deployment deployment = createSimpleDeployment("transient");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(7, deployer1.getDeployOrder());
- assertEquals(8, deployer2.getDeployOrder());
- assertEquals(9, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
- }
-
- public void testInputOutputTransient2() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setInputs("test");
- deployer1.setOutputs("test");
- addDeployer(main, deployer1);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("test");
- addDeployer(main, deployer2);
-
- Deployment deployment = createSimpleDeployment("transient2");
- 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());
- }
-
- public void testInputOutputMultipleTransient() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer4 = new TestFlowDeployer("4");
- deployer4.setInputs("test");
- addDeployer(main, deployer4);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("test");
- deployer2.setOutputs("test");
- addDeployer(main, deployer2);
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setInputs("test");
- deployer3.setOutputs("test");
- addDeployer(main, deployer3);
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setOutputs("test");
- addDeployer(main, deployer1);
-
- Deployment deployment = createSimpleDeployment("transient");
- 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());
- }
-
- public void testMultipleOutput() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setOutputs("test1", "test2");
- addDeployer(main, deployer1);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("test1");
- addDeployer(main, deployer2);
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setInputs("test2");
- addDeployer(main, deployer3);
-
- Deployment deployment = createSimpleDeployment("MultipleOutput");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(7, deployer1.getDeployOrder());
- assertEquals(8, deployer2.getDeployOrder());
- assertEquals(9, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
- }
-
- public void testMultipleInput() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setInputs("test1", "test2");
- addDeployer(main, deployer3);
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setOutputs("test1");
- addDeployer(main, deployer1);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setOutputs("test2");
- addDeployer(main, deployer2);
-
- Deployment deployment = createSimpleDeployment("MultipleInput");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(7, deployer1.getDeployOrder());
- assertEquals(8, deployer2.getDeployOrder());
- assertEquals(9, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
- }
-
- public void testChain() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setInputs("test2");
- addDeployer(main, deployer3);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("test1");
- deployer2.setOutputs("test2");
- addDeployer(main, deployer2);
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setOutputs("test1");
- addDeployer(main, deployer1);
-
- Deployment deployment = createSimpleDeployment("Chain");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(7, deployer1.getDeployOrder());
- assertEquals(8, deployer2.getDeployOrder());
- assertEquals(9, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
- }
-
- public void testComplicated() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer6 = new TestFlowDeployer("6");
- deployer6.setInputs("test1", "test3");
- addDeployer(main, deployer6);
- TestFlowDeployer deployer5 = new TestFlowDeployer("5");
- deployer5.setInputs("test3");
- deployer5.setOutputs("test3");
- addDeployer(main, deployer5);
- TestFlowDeployer deployer4 = new TestFlowDeployer("4");
- deployer4.setInputs("test2");
- deployer4.setOutputs("test3");
- addDeployer(main, deployer4);
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setOutputs("test2");
- addDeployer(main, deployer3);
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setOutputs("test1");
- addDeployer(main, deployer2);
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setOutputs("test1");
- addDeployer(main, deployer1);
-
- Deployment deployment = createSimpleDeployment("Complicated");
- 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());
- }
-
- public void testIntermediateIsRelativelySorted() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer2 = new TestFlowDeployer("A");
- deployer2.setInputs("test1");
- addDeployer(main, deployer2);
- TestFlowDeployer deployer3 = new TestFlowDeployer("B");
- addDeployer(main, deployer3);
- TestFlowDeployer deployer1 = new TestFlowDeployer("C");
- deployer1.setOutputs("test1");
- addDeployer(main, deployer1);
-
- Deployment deployment = createSimpleDeployment("IntermediateIsRelativelySorted");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(3, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(7, deployer1.getDeployOrder());
- assertEquals(8, deployer2.getDeployOrder());
- assertEquals(9, deployer3.getDeployOrder());
- assertEquals(6, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(4, deployer3.getUndeployOrder());
- }
-
- public void testTransitionOrdering() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer1 = new TestFlowDeployer("A");
- deployer1.setInputs("3");
- deployer1.setOutputs("4");
- addDeployer(main, deployer1);
-
- TestFlowDeployer deployer2 = new TestFlowDeployer("B");
- deployer2.setInputs("1");
- deployer2.setOutputs("2");
- addDeployer(main, deployer2);
-
- TestFlowDeployer deployer3 = new TestFlowDeployer("C");
- deployer3.setInputs("2");
- deployer3.setOutputs("3");
- addDeployer(main, deployer3);
-
- Deployment deployment = createSimpleDeployment("TransitionOrdering");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(3, deployer1.getDeployOrder());
- assertEquals(1, deployer2.getDeployOrder());
- assertEquals(2, deployer3.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(3, deployer1.getDeployOrder());
- assertEquals(1, deployer2.getDeployOrder());
- assertEquals(2, deployer3.getDeployOrder());
- assertEquals(4, deployer1.getUndeployOrder());
- assertEquals(6, deployer2.getUndeployOrder());
- assertEquals(5, deployer3.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(9, deployer1.getDeployOrder());
- assertEquals(7, deployer2.getDeployOrder());
- assertEquals(8, deployer3.getDeployOrder());
- assertEquals(4, deployer1.getUndeployOrder());
- assertEquals(6, deployer2.getUndeployOrder());
- assertEquals(5, deployer3.getUndeployOrder());
- }
-
- public void testSymetricDots() throws Exception
- {
- DeployerClient main = createMainDeployer();
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setInputs("X");
- deployer1.setOutputs("B");
- addDeployer(main, deployer1);
-
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setInputs("X");
- deployer2.setOutputs("X");
- addDeployer(main, deployer2);
-
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setInputs("A");
- deployer3.setOutputs("X");
- addDeployer(main, deployer3);
-
- Deployment deployment = createSimpleDeployment("SymetricDots");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(3, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(1, deployer3.getDeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(3, deployer1.getDeployOrder());
- assertEquals(2, deployer2.getDeployOrder());
- assertEquals(1, deployer3.getDeployOrder());
- assertEquals(4, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(6, deployer3.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(9, deployer1.getDeployOrder());
- assertEquals(8, deployer2.getDeployOrder());
- assertEquals(7, deployer3.getDeployOrder());
- assertEquals(4, deployer1.getUndeployOrder());
- assertEquals(5, deployer2.getUndeployOrder());
- assertEquals(6, deployer3.getUndeployOrder());
- }
-
- public void testDoubleCycle() throws Exception
- {
- DeployerClient main = createMainDeployer();
-
- TestFlowDeployer deployer2 = new TestFlowDeployer("A");
- deployer2.setInputs("test2");
- addDeployer(main, deployer2);
-
- TestFlowDeployer deployer3 = new TestFlowDeployer("B");
- addDeployer(main, deployer3);
-
- TestFlowDeployer deployer6 = new TestFlowDeployer("C");
- deployer6.setInputs("2ndcycle");
- addDeployer(main, deployer6);
-
- TestFlowDeployer deployer1 = new TestFlowDeployer("D");
- deployer1.setOutputs("test1");
- addDeployer(main, deployer1);
-
- TestFlowDeployer deployer4 = new TestFlowDeployer("E");
- addDeployer(main, deployer4);
-
- TestFlowDeployer deployer5 = new TestFlowDeployer("F");
- deployer5.setInputs("test1");
- deployer5.setOutputs("test2");
- addDeployer(main, deployer5);
-
- TestFlowDeployer deployer7 = new TestFlowDeployer("G");
- addDeployer(main, deployer7);
-
- TestFlowDeployer deployer8 = new TestFlowDeployer("H");
- deployer8.setOutputs("2ndcycle");
- addDeployer(main, deployer8);
-
- Deployment deployment = createSimpleDeployment("DoubleCycle");
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer3.getDeployOrder());
- assertEquals(2, deployer8.getDeployOrder());
- assertEquals(3, deployer6.getDeployOrder());
- assertEquals(4, deployer1.getDeployOrder());
- assertEquals(5, deployer4.getDeployOrder());
- assertEquals(6, deployer5.getDeployOrder());
- assertEquals(7, deployer2.getDeployOrder());
- assertEquals(8, deployer7.getDeployOrder());
- assertEquals(-1, deployer3.getUndeployOrder());
- assertEquals(-1, deployer8.getUndeployOrder());
- assertEquals(-1, deployer6.getUndeployOrder());
- assertEquals(-1, deployer1.getUndeployOrder());
- assertEquals(-1, deployer4.getUndeployOrder());
- assertEquals(-1, deployer5.getUndeployOrder());
- assertEquals(-1, deployer2.getUndeployOrder());
- assertEquals(-1, deployer7.getUndeployOrder());
-
- main.removeDeployment(deployment);
- main.process();
-
- assertEquals(1, deployer3.getDeployOrder());
- assertEquals(2, deployer8.getDeployOrder());
- assertEquals(3, deployer6.getDeployOrder());
- assertEquals(4, deployer1.getDeployOrder());
- assertEquals(5, deployer4.getDeployOrder());
- assertEquals(6, deployer5.getDeployOrder());
- assertEquals(7, deployer2.getDeployOrder());
- assertEquals(8, deployer7.getDeployOrder());
- assertEquals(16, deployer3.getUndeployOrder());
- assertEquals(15, deployer8.getUndeployOrder());
- assertEquals(14, deployer6.getUndeployOrder());
- assertEquals(13, deployer1.getUndeployOrder());
- assertEquals(12, deployer4.getUndeployOrder());
- assertEquals(11, deployer5.getUndeployOrder());
- assertEquals(10, deployer2.getUndeployOrder());
- assertEquals(9, deployer7.getUndeployOrder());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(17, deployer3.getDeployOrder());
- assertEquals(18, deployer8.getDeployOrder());
- assertEquals(19, deployer6.getDeployOrder());
- assertEquals(20, deployer1.getDeployOrder());
- assertEquals(21, deployer4.getDeployOrder());
- assertEquals(22, deployer5.getDeployOrder());
- assertEquals(23, deployer2.getDeployOrder());
- assertEquals(24, deployer7.getDeployOrder());
- assertEquals(16, deployer3.getUndeployOrder());
- assertEquals(15, deployer8.getUndeployOrder());
- assertEquals(14, deployer6.getUndeployOrder());
- assertEquals(13, deployer1.getUndeployOrder());
- assertEquals(12, deployer4.getUndeployOrder());
- assertEquals(11, deployer5.getUndeployOrder());
- assertEquals(10, deployer2.getUndeployOrder());
- assertEquals(9, deployer7.getUndeployOrder());
- }
-
- public void testOrderedThenFlowWithPassThrough() throws Exception
- {
- DeployerClient main = createMainDeployer();
-
- TestFlowDeployer deployer4 = new TestFlowDeployer("4");
- deployer4.setInputs("test");
- addDeployer(main, deployer4);
-
- TestFlowDeployer deployer3 = new TestFlowDeployer("3");
- deployer3.setRelativeOrder(3);
- deployer3.setInputs("test");
- deployer3.setOutputs("test");
- addDeployer(main, deployer3);
-
- TestFlowDeployer deployer2 = new TestFlowDeployer("2");
- deployer2.setRelativeOrder(2);
- addDeployer(main, deployer2);
-
- TestFlowDeployer deployer1 = new TestFlowDeployer("1");
- deployer1.setRelativeOrder(1);
- addDeployer(main, deployer1);
-
- Deployment deployment = createSimpleDeployment("orderedThenFlowWithPassThrough");
- 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());
- }
-
- public void testWebBeansOrder() throws Exception
- {
- DeployerClient main = createMainDeployer();
-
- TestFlowDeployer mcfcld = new TestFlowDeployer("ManagedConnectionFactory");
- mcfcld.setInputs("ManagedConnectionFactoryDeploymentGroup");
- mcfcld.setOutputs("CLMD");
- addDeployer(main, mcfcld);
-
- TestFlowDeployer postJBWMD = new TestFlowDeployer("PostJBossWebMetadataDeployer");
- postJBWMD.setInputs("JBWMD", "CLMD");
- postJBWMD.setOutputs("JBWMD", "CLMD");
- addDeployer(main, postJBWMD);
-
- TestFlowDeployer postEJB = new TestFlowDeployer("PostEjbJar");
- postEJB.setInputs("EJB");
- postEJB.setOutputs("EJB");
- addDeployer(main, postEJB);
-
- TestFlowDeployer warCL = new TestFlowDeployer("WarClassLoaderDeployer");
- warCL.setInputs("JBWMD", "CLMD");
- warCL.setOutputs("CLMD");
- addDeployer(main, warCL);
-
- TestFlowDeployer service = new TestFlowDeployer("ServiceCL");
- service.setInputs("ServiceDeployment");
- service.setOutputs("CLMD");
- addDeployer(main, service);
-
- TestFlowDeployer legacy = new TestFlowDeployer("Legacy");
- legacy.setInputs("JBWMD", "WMD");
- legacy.setOutputs("JBWMD");
- addDeployer(main, legacy);
-
- TestFlowDeployer cluster = new TestFlowDeployer("Cluster");
- cluster.setInputs("JBWMD");
- cluster.setOutputs("JBWMD");
- addDeployer(main, cluster);
-
- TestFlowDeployer postWMD = new TestFlowDeployer("PostWebMetadataDeployer");
- postWMD.setInputs("JBWMD");
- postWMD.setOutputs("JBWMD");
- 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());
- 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());
- 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());
-
- main.addDeployment(deployment);
- main.process();
-
- assertEquals(15, deployer1.getDeployOrder());
- assertEquals(16, deployer2.getDeployOrder());
- assertEquals(17, deployer3.getDeployOrder());
- assertEquals(18, deployer7.getDeployOrder());
- 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());
-
- 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 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( "6", "7", "8" ); // 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();
- }
-
- public void testPartialOverlapping() throws Exception
- {
- DeployerClient main = createMainDeployer();
-
- // "1", "2", are provided by other preceding deployers
- TestFlowDeployer deployer1 = new TestFlowDeployer( "Deployer" );
- deployer1.setInputs( "1", "2" );
- deployer1.setOutputs( "3", "5", "2", "4" );
- addDeployer(main, deployer1);
-
- TestFlowDeployer deployer2 = new TestFlowDeployer( "Deployer" );
- deployer2.setInputs( "1", "5", "2" ); // depends on 5 (output of deployer1)
- deployer2.setOutputs( "6", "2", "4" );
- addDeployer(main, deployer2);
-
- TestFlowDeployer deployer3 = new TestFlowDeployer( "Deployer" );
- deployer3.setInputs( "6", "1", "5", "2" ); // depends on 6 (output of deployer2) and 5 (output of deployer1)
- deployer3.setOutputs( "7", "2", "4" );
- addDeployer( main, deployer3 );
-
- TestFlowDeployer deployer4 = new TestFlowDeployer( "Deployer" );
- deployer4.setInputs( "1", "2", "4" ); // depends on 4 (output of deployer1, deployer2 and deployer3)
- deployer4.setOutputs( "8", "2" );
- 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();
- }
}
Added: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DominoOrderingUnitTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DominoOrderingUnitTestCase.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DominoOrderingUnitTestCase.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -0,0 +1,62 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.deployer.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.plugins.sort.DeployerSorter;
+import org.jboss.deployers.plugins.sort.DominoDeployerSorter;
+
+/**
+ * Old domino sorting.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class DominoOrderingUnitTestCase extends AbstractSorterOrderingUnitTest
+{
+ public DominoOrderingUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(DominoOrderingUnitTestCase.class);
+ }
+
+ @Override
+ protected DeployerSorter createSorter()
+ {
+ return new DominoDeployerSorter();
+ }
+
+ public void testAlgorithmPerformance()
+ {
+ // ignored
+ }
+
+ public void testAlgorithmPerformance2()
+ {
+ // ignored
+ }
+}
Added: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/InOutTopologicalOrderingUnitTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/InOutTopologicalOrderingUnitTestCase.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/InOutTopologicalOrderingUnitTestCase.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -0,0 +1,69 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.deployer.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.plugins.sort.DeployerSorter;
+import org.jboss.deployers.plugins.sort.InOutTopologicalDeployerSorter;
+
+/**
+ * Simple topological sorting.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class InOutTopologicalOrderingUnitTestCase extends AbstractSorterOrderingUnitTest
+{
+ public InOutTopologicalOrderingUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(InOutTopologicalOrderingUnitTestCase.class);
+ }
+
+ @Override
+ protected DeployerSorter createSorter()
+ {
+ return new InOutTopologicalDeployerSorter();
+ }
+
+ @Override
+ public void testDeployersOrder1() throws Exception
+ {
+ // TODO - how much do we allow pass-through to participate in ordering?
+ // This just creates duplicit edges from vertex A to vertex B in final graph.
+ }
+
+ public void testAlgorithmPerformance()
+ {
+ // ignored
+ }
+
+ public void testAlgorithmPerformance2()
+ {
+ // ignored
+ }
+}
Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/IndexingOrderingUnitTestCase.java (from rev 104929, projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/IndexingOrderingUnitTestCase.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/IndexingOrderingUnitTestCase.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -0,0 +1,53 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.deployer.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.deployers.plugins.deployers.DeployersImpl;
+import org.jboss.deployers.plugins.sort.NewStagedSortedDeployers;
+import org.jboss.deployers.plugins.sort.StagedSortedDeployers;
+
+/**
+ * Sorting via indexing.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class IndexingOrderingUnitTestCase extends AbstractDeployerFlowUnitTest
+{
+ public IndexingOrderingUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(IndexingOrderingUnitTestCase.class);
+ }
+
+ @Override
+ protected void applySortingChanges(DeployersImpl deployers)
+ {
+ StagedSortedDeployers sorter = new NewStagedSortedDeployers();
+ deployers.setDeployersByStage(sorter);
+ }
+}
Added: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/KahnOrderingUnitTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/KahnOrderingUnitTestCase.java (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/KahnOrderingUnitTestCase.java 2010-05-18 13:53:32 UTC (rev 104931)
@@ -0,0 +1,62 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.deployer.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.deployers.plugins.sort.DeployerSorter;
+import org.jboss.deployers.plugins.sort.KahnDeployerSorter;
+
+/**
+ * Kahn topological sorting.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class KahnOrderingUnitTestCase extends AbstractSorterOrderingUnitTest
+{
+ public KahnOrderingUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(KahnOrderingUnitTestCase.class);
+ }
+
+ @Override
+ protected DeployerSorter createSorter()
+ {
+ return new KahnDeployerSorter();
+ }
+
+ public void testAlgorithmPerformance()
+ {
+ // ignored
+ }
+
+ public void testAlgorithmPerformance2()
+ {
+ // ignored
+ }
+}
More information about the jboss-cvs-commits
mailing list