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 void
addEdge(int weight, T from, T to)
void
addEdges(int weight, T from, java.lang.Iterable<T> tos)
Add an edge between two nodes.boolean
addNode(T node)
Add a node to the graph.java.util.List<T>
getDependenciesFor(T node)
java.util.List<T>
getFreeNodes()
int
getNodeCount()
int
getNodeCountWithStatus(IDynamicGraph.Status status)
java.util.Set<T>
getNodesWithStatus(IDynamicGraph.Status status)
void
setStatus(java.util.Collection<T> nodes, IDynamicGraph.Status status)
Set the status for a set of nodes.void
setStatus(T node, IDynamicGraph.Status status)
Set the status for a node.void
setVisualisers(java.util.Set<IExecutionVisualiser> listener)
java.lang.String
toDot()
java.lang.String
toString()
-
-
-
Method Detail
-
addNode
public boolean addNode(T node)
Add a node to the graph.- Specified by:
addNode
in interfaceIDynamicGraph<T>
-
addEdge
public void addEdge(int weight, T from, T to)
- Specified by:
addEdge
in interfaceIDynamicGraph<T>
- Parameters:
weight
- - Represents one ofTestRunner.PriorityWeight
ordinals 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:
setVisualisers
in interfaceIDynamicGraph<T>
-
addEdges
public void addEdges(int weight, T from, java.lang.Iterable<T> tos)
Add an edge between two nodes.- Specified by:
addEdges
in interfaceIDynamicGraph<T>
-
getFreeNodes
public java.util.List<T> getFreeNodes()
- Specified by:
getFreeNodes
in interfaceIDynamicGraph<T>
- Returns:
- a set of all the nodes that don't depend on any other nodes.
-
getDependenciesFor
public java.util.List<T> getDependenciesFor(T node)
- Specified by:
getDependenciesFor
in interfaceIDynamicGraph<T>
-
setStatus
public void setStatus(java.util.Collection<T> nodes, IDynamicGraph.Status status)
Set the status for a set of nodes.- Specified by:
setStatus
in interfaceIDynamicGraph<T>
-
setStatus
public void setStatus(T node, IDynamicGraph.Status status)
Set the status for a node.- Specified by:
setStatus
in interfaceIDynamicGraph<T>
-
getNodeCount
public int getNodeCount()
- Specified by:
getNodeCount
in interfaceIDynamicGraph<T>
- Returns:
- the number of nodes in this graph.
-
getNodeCountWithStatus
public int getNodeCountWithStatus(IDynamicGraph.Status status)
- Specified by:
getNodeCountWithStatus
in interfaceIDynamicGraph<T>
-
getNodesWithStatus
public java.util.Set<T> getNodesWithStatus(IDynamicGraph.Status status)
- Specified by:
getNodesWithStatus
in interfaceIDynamicGraph<T>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toDot
public java.lang.String toDot()
- Specified by:
toDot
in interfaceIDynamicGraph<T>
- Returns:
- a .dot file (GraphViz) version of this graph.
-
-