Package org.testng.internal
Class DynamicGraph<T>
- java.lang.Object
-
- org.testng.internal.DynamicGraph<T>
-
- All Implemented Interfaces:
IDynamicGraph<T>
public class DynamicGraph<T> extends java.lang.Object implements IDynamicGraph<T>
Representation of the graph of methods.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.testng.IDynamicGraph
IDynamicGraph.Status
-
-
Constructor Summary
Constructors Constructor Description DynamicGraph()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEdge(int weight, T from, T to)voidaddEdges(int weight, T from, java.lang.Iterable<T> tos)Add an edge between two nodes.booleanaddNode(T node)Add a node to the graph.java.util.List<T>getDependenciesFor(T node)java.util.List<T>getFreeNodes()intgetNodeCount()intgetNodeCountWithStatus(IDynamicGraph.Status status)java.util.Set<T>getNodesWithStatus(IDynamicGraph.Status status)java.util.List<T>getUpstreamDependenciesFor(T node)voidsetStatus(java.util.Collection<T> nodes, IDynamicGraph.Status status)Set the status for a set of nodes.voidsetStatus(T node, IDynamicGraph.Status status)Set the status for a node.voidsetVisualisers(java.util.Set<IExecutionVisualiser> listener)java.lang.StringtoDot()java.lang.StringtoString()
-
-
-
Method Detail
-
addNode
public boolean addNode(T node)
Add a node to the graph.- Specified by:
addNodein interfaceIDynamicGraph<T>
-
addEdge
public void addEdge(int weight, T from, T to)- Specified by:
addEdgein interfaceIDynamicGraph<T>- Parameters:
weight- - Represents one ofTestRunner.PriorityWeightordinals indicating the weightage of a particular node in the graphfrom- - Represents the edge that depends on another edge.to- - Represents the edge on which another edge depends upon.
-
setVisualisers
public void setVisualisers(java.util.Set<IExecutionVisualiser> listener)
- Specified by:
setVisualisersin interfaceIDynamicGraph<T>
-
addEdges
public void addEdges(int weight, T from, java.lang.Iterable<T> tos)Add an edge between two nodes.- Specified by:
addEdgesin interfaceIDynamicGraph<T>
-
getFreeNodes
public java.util.List<T> getFreeNodes()
- Specified by:
getFreeNodesin interfaceIDynamicGraph<T>- Returns:
- a set of all the nodes that don't depend on any other nodes.
-
getUpstreamDependenciesFor
public java.util.List<T> getUpstreamDependenciesFor(T node)
- Specified by:
getUpstreamDependenciesForin interfaceIDynamicGraph<T>
-
getDependenciesFor
public java.util.List<T> getDependenciesFor(T node)
- Specified by:
getDependenciesForin interfaceIDynamicGraph<T>
-
setStatus
public void setStatus(java.util.Collection<T> nodes, IDynamicGraph.Status status)
Set the status for a set of nodes.- Specified by:
setStatusin interfaceIDynamicGraph<T>
-
setStatus
public void setStatus(T node, IDynamicGraph.Status status)
Set the status for a node.- Specified by:
setStatusin interfaceIDynamicGraph<T>
-
getNodeCount
public int getNodeCount()
- Specified by:
getNodeCountin interfaceIDynamicGraph<T>- Returns:
- the number of nodes in this graph.
-
getNodeCountWithStatus
public int getNodeCountWithStatus(IDynamicGraph.Status status)
- Specified by:
getNodeCountWithStatusin interfaceIDynamicGraph<T>
-
getNodesWithStatus
public java.util.Set<T> getNodesWithStatus(IDynamicGraph.Status status)
- Specified by:
getNodesWithStatusin interfaceIDynamicGraph<T>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toDot
public java.lang.String toDot()
- Specified by:
toDotin interfaceIDynamicGraph<T>- Returns:
- a .dot file (GraphViz) version of this graph.
-
-