From 7ea1f09d21929ea3878b84afef4bb9f8f32f1014 Mon Sep 17 00:00:00 2001 From: Tamino Dauth Date: Tue, 21 May 2019 13:54:19 +0200 Subject: [PATCH] Adapt README code example #34 --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4e8d52d..7558af3 100644 --- a/README.md +++ b/README.md @@ -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")