Package org.testng.internal
Class DynamicGraph<T>
java.lang.Object
org.testng.internal.DynamicGraph<T>
- All Implemented Interfaces:
IDynamicGraph<T>
Representation of the graph of methods.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Manage edges and weights between nodes.Nested classes/interfaces inherited from interface org.testng.IDynamicGraph
IDynamicGraph.Status
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DynamicGraph.Edges<T>
private Set<IExecutionVisualiser>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Add an edge between two nodes.boolean
Add a node to the graph.private static <T> String
dotShortName
(T t) getDependenciesFor
(T node) getEdges()
For tests onlyint
int
void
setStatus
(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
(Set<IExecutionVisualiser> listener) toDot()
toString()
-
Field Details
-
m_nodesReady
-
m_nodesRunning
-
m_nodesFinished
-
m_edges
-
visualisers
-
-
Constructor Details
-
DynamicGraph
public DynamicGraph()
-
-
Method Details
-
addNode
Add a node to the graph.- Specified by:
addNode
in interfaceIDynamicGraph<T>
-
addEdge
- 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
- Specified by:
setVisualisers
in interfaceIDynamicGraph<T>
-
addEdges
Add an edge between two nodes.- Specified by:
addEdges
in interfaceIDynamicGraph<T>
-
getFreeNodes
- Specified by:
getFreeNodes
in interfaceIDynamicGraph<T>
- Returns:
- a set of all the nodes that don't depend on any other nodes.
-
getDependenciesFor
- Specified by:
getDependenciesFor
in interfaceIDynamicGraph<T>
-
setStatus
Set the status for a set of nodes.- Specified by:
setStatus
in interfaceIDynamicGraph<T>
-
setStatus
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
- Specified by:
getNodeCountWithStatus
in interfaceIDynamicGraph<T>
-
getNodesWithStatus
- Specified by:
getNodesWithStatus
in interfaceIDynamicGraph<T>
-
toString
-
dotShortName
-
toDot
- Specified by:
toDot
in interfaceIDynamicGraph<T>
- Returns:
- a .dot file (GraphViz) version of this graph.
-
getEdges
For tests only
-