Package org.graphwalker.core.model
Class Model
- All Implemented Interfaces:
Builder<Model.RuntimeModel>
Model
The Model,or graph, is a collection of edges and vertices,
The model is a description of the expected behavior of
a system under test. It contains lists of edges and vertices, which creates
a directed graph.
In a model, the edges represents the actions during a test, and the vertices are where
the verifications are performed.- Author:
- Nils Olsson
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionModel()Create a new ModelModel(Model.RuntimeModel model) Create a new Model, based on a existingRuntimeModel -
Method Summary
Modifier and TypeMethodDescriptionAdds an action to the model.addActions(List<Action> actions) addActions(Action... actions) Adds an edge to the model.Adds a vertex to the model.build()Creates an immutable model from this model.deleteEdge(Edge edge) Delete an edge from the model.deleteVertex(Vertex vertex) Delete a vertex from the model.Gets the list of actions associated with the model.getEdges()Gets the list of edges of the model.Gets the list of vertices of the model.booleansetActions(List<Action> actions) Assign a list of actions to the model.setPredefinedPath(List<Edge> predefinedPath) Methods inherited from class org.graphwalker.core.model.BuilderBase
addRequirement, getId, getName, getProperties, getProperty, getRequirements, hasProperty, setId, setName, setProperties, setProperty, setRequirements
-
Constructor Details
-
Model
public Model()Create a new Model -
Model
Create a new Model, based on a existingRuntimeModel- Parameters:
model- ARuntimeModelthat the new Model will be based on.
-
-
Method Details
-
addVertex
Adds a vertex to the model.- Parameters:
vertex- The vertex to be added.- Returns:
- The model
-
addEdge
Adds an edge to the model. If either the source or target vertex of the edge is not in the model, they will be automatically added as well.- Parameters:
edge- The edge to be added.- Returns:
- The model.
-
deleteEdge
Delete an edge from the model. Will remove the edge from the model.- Parameters:
edge- The edge to be deleted.- Returns:
- The model.
-
deleteVertex
Delete a vertex from the model. Will remove a vertex from the model. Any edges that has the vertex as either source or target, will also be deleted from the model.- Parameters:
vertex- The vertex to be deleted.- Returns:
- The model.
-
addAction
Adds an action to the model. Before a model is being traversed, it will execute all its actions. This is typically needed to initiate variables and data.- Parameters:
action- The action to be added.- Returns:
- The model
-
addActions
-
addActions
-
setActions
Assign a list of actions to the model.- Parameters:
actions- A list of actions- Returns:
- The model
- See Also:
-
getActions
Gets the list of actions associated with the model.- Returns:
- List of actions
- See Also:
-
getVertices
Gets the list of vertices of the model.- Returns:
- The list of vertices
-
getEdges
Gets the list of edges of the model.- Returns:
- List of edges
-
setPredefinedPath
-
getPredefinedPath
-
hasPredefinedPath
public boolean hasPredefinedPath() -
build
Creates an immutable model from this model.- Returns:
- An immutable vertex as a RuntimeModel
-