Package org.testng.internal
Class DynamicGraph<T>
- java.lang.Object
-
- org.testng.internal.DynamicGraph<T>
-
public class DynamicGraph<T> extends Object
Representation of the graph of methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDynamicGraph.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, Iterable<T> tos)Add an edge between two nodes.voidaddEdge(int weight, T from, T to)voidaddEdge(int weight, T from, T... tos)Add an edge between two nodes.booleanaddNode(T node)Add a node to the graph.ListMultiMap<T,org.testng.internal.DynamicGraph.Edge<T>>getEdges()List<T>getFreeNodes()intgetNodeCount()intgetNodeCountWithStatus(DynamicGraph.Status status)voidsetStatus(Collection<T> nodes, DynamicGraph.Status status)Set the status for a set of nodes.voidsetStatus(T node, DynamicGraph.Status status)Set the status for a node.StringtoDot()StringtoString()
-
-
-
Method Detail
-
addNode
public boolean addNode(T node)
Add a node to the graph.
-
addEdge
public void addEdge(int weight, T from, T to)- 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.
-
getFreeNodes
public List<T> getFreeNodes()
- Returns:
- a set of all the nodes that don't depend on any other nodes.
-
setStatus
public void setStatus(Collection<T> nodes, DynamicGraph.Status status)
Set the status for a set of nodes.
-
setStatus
public void setStatus(T node, DynamicGraph.Status status)
Set the status for a node.
-
getNodeCount
public int getNodeCount()
- Returns:
- the number of nodes in this graph.
-
getNodeCountWithStatus
public int getNodeCountWithStatus(DynamicGraph.Status status)
-
toDot
public String toDot()
- Returns:
- a .dot file (GraphViz) version of this graph.
-
getEdges
public ListMultiMap<T,org.testng.internal.DynamicGraph.Edge<T>> getEdges()
-
-