Class Vertex

All Implemented Interfaces:
Builder<Vertex.RuntimeVertex>

public class Vertex extends CachedBuilder<Vertex,Vertex.RuntimeVertex>

Vertex

The Vertex holds the information for a state in a model.

The vertex is the verification point for a test. It's here where the test asserts that the system under test is in the expected state. The vertex is uniquely identified by its id. The source vertex is not mandatory, but in a model, there should be only one such instance. Also, the target vertex is not mandatory, but again, in a model, there should be only one such instance.
Author:
Nils Olsson
  • Constructor Details

    • Vertex

      public Vertex()
  • Method Details

    • getSharedState

      public String getSharedState()
      Gets the name of the shared state.
      Returns:
      The name as a string.
      See Also:
    • setSharedState

      public Vertex setSharedState(String sharedState)
      Sets the name of the shared state of this vertex. If the vertex is to act as a shared state, the name of the shared state needs to be set to a non-empty string.

      The shared state is portal to other shared states in other models. It creates a 'virtual edge' between to vertices sharing the same name in their shared state.

      In the 2 models above, GraphWalker will create virtual edges, the dotted arrows. These edges will allow passages between the 2 models.
      Parameters:
      sharedState - The name of the shared state.
      Returns:
      The vertex
    • addAction

      public Vertex addAction(Action action)
      Adds an action to the vertex, which represents a piece of code that will be executed each time the vertex is being traversed. The code is by default interpreted as javascript.
      Parameters:
      action - The action.
      Returns:
      The vertex.
    • addActions

      public Vertex addActions(Action... actions)
    • addActions

      public Vertex addActions(List<Action> actions)
    • setActions

      public Vertex setActions(List<Action> actions)
      Adds a list of actions to the vertex, which represents a pieces of code that will be executed each time the vertex is being traversed. The code snippets is by default interpreted as javascript.
      Parameters:
      actions - The actions.
      Returns:
      The vertex.
      See Also:
    • getActions

      public List<Action> getActions()
      Gets the lists of actions of the vertex.
      Returns:
      The actions
      See Also:
    • createCache

      protected Vertex.RuntimeVertex createCache()
      Creates an immutable vertex from this vertex.
      Specified by:
      createCache in class CachedBuilder<Vertex,Vertex.RuntimeVertex>
      Returns:
      An immutable vertex as a RuntimeVertex