Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Commit

Permalink
Adapt README code example #34
Browse files Browse the repository at this point in the history
  • Loading branch information
tdauth committed May 21, 2019
1 parent f04a2f9 commit 5d86fd3
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,20 @@ import de.retest.guistatemachine.api.GuiStateMachineApi
import de.retest.guistatemachine.api.GuiStateMachineSerializer
import de.retest.recheck.ui.descriptors.SutState
import de.retest.surili.commons.actions.NavigateToAction
import de.retest.surili.commons.actions.ActionType

val action = new NavigateToAction("http://google.com")
val unexploredActionTypes = Set(ActionType.fromAction(action))

val stateMachine = GuiStateMachineApi().createStateMachine("test")

val currentSutState = new SutState(currentDescriptors)
val currentState = stateMachine.createState(currentSutState, 1)
val action = new NavigateToAction("http://google.com")
val currentState = stateMachine.createState(currentSutState, unexploredActionTypes)

val nextSutState = new SutState(nextDescriptors)
val nextState = stateMachine.createState(nextSutState, 1)
stateMachine.executeAction(currentState, action, nextState, true)
val nextState = stateMachine.createState(nextSutState, unexploredActionTypes)

stateMachine.executeAction(currentState, action, nextState)

GuiStateMachineSerializer.javaObjectStream(stateMachine).save("mystatemachine.ser")
GuiStateMachineSerializer.gml(stateMachine).save("mystatemachine.gml")
Expand Down

0 comments on commit 5d86fd3

Please sign in to comment.