h1. YAKINDU Statechart Tools – Testcase 02 - Editor |_. Nr |_. Testname |_. Test Instructions |_. Postconditions |_. Status| | 2.1 | Create a Java project |
In the main menu, select _File → New → Project…_.
In the _New_ wizard, select _Java → Java Project_.
Click on _Next_.
Enter @TestProject@ as new project name.
Click on _Finish_ to create the project.
Press [Ctrl-N]
to open the _New_ wizard.
Expand the _YAKINDU SCT_ tree entry.
Select _Statechart Model_.
Click on _Next_.
Enter @Staircase.sct@ as file name.
Click on _Finish_ to create the statechart.
A file named _Staircase.sct_ is created in the _TestProject_ project and it is shown in _project explorer_ view.
The statechart editor displays the definition section (left), the statechart model (center), and the palette (right).
The statechart contains a region named _main region_.
That region contains an entry point and a transition leading to state *StateA*.
There are no warning or error markers.
The _problems_ view contains no entries.
The palette contains various tools, like _Transition_, _State_, etc.
Right-click on the state to open the context menu.
Select _Show Properties View_.
In the _properties_ view, enter *LightOff* as the new _State Name_, overriding *StateA*.
Press @[Tab]@ to change focus.
In the tools palette, click on the _State_ entry.
Click inside the region at the position where you want to insert a new state.
Change the new state's name to *LightOn*.
A state named *LightOn* is created in the region.
The new state has one error marker, and there's one error entry in the _problems_ view.
The error message reads: "Node is not reachable". | %{color:red}open% | | 2.7 | Create a variable and an event |
Enter the following code into the statechart's definition section, overriding any existing contents:
@internal:@
@var light : boolean@
@interface:@
@in event keypress@
Click anywhere outside the definition section so that it now longer has the focus.
Enter the following code into the state specification of the *LightOff* state, overriding any existing contents:
@entry / light = false@
Enter the following code into the state specification of the *LightOn* state, overriding any existing contents:
@entry / light = true@
Click on the _Transition_ symbol in the _palette_ view.
Click and hold on the *LightOff* state, drag the mouse to the *LightOn* state, and release the mouse button.
Enter @keypress@ as trigger, and click outside of the transition specification text to release focus.
Create a second transition from the *LightOn* to the *LightOff* state.
Enter @after 30s@ as trigger.
Add elements of the following types to the main region:
- Composite State
- Orthogonal State
- Shallow History
- Deep History
- Final State
- Exit Point
- Choice
- Synchronization
Press [Ctrl+S]
to save the statechart to the statechart file.
Each element should be drawn correctly (size, color, appearance, etc.).
Error markers are set correctly, e.g., incoming transitions or names are missing, "Duplicate NamedElement 'xyz' in Region 'main_region'".
| %{color:red}open% | | 2.10.1 | Naming |Change the name of: initial entry, shallow history, deep history and exit nodes.
Press [Ctrl+S]
to save the statechart to the statechart file.
Select a state.
Select _Edit → Copy_ ([Ctrl+C]
) to copy the state to the clipboard.
Select the main region.
Select _Edit → Paste_ ([Ctrl+P]
) to paste a copy of the state to the main region.
Select _Edit → Copy_ (Ctrl+C) to copy the region
Select the diagram canvas
Select _Edit → Paste_ (Ctrl+V) to paste a copy of the region to the canvas
| A copy of the region with a synthetic name is added to the diagram canvas. The copy includes copies of everything included in the copied region. | %{color:red}open% | | 2.13 | Delete & paste state | Select a stateSelect _Edit → Cut_ (Ctrl+X) to delete the state
Select the main region
Select _Edit → Paste_ (Ctrl+V) to paste a copy of the state to the main region
| The selected state is deleted.A copy of the deleted state is added to the main region. The copy is identical to the deleted state, including all its contents.
| %{color:red}open% | | 2.14 | Delete & paste region | Select the main regionSelect _Edit → Cut_ (Ctrl+X) to delete the region
Select the diagram canvas
Select _Edit → Paste_ (Ctrl+V) to paste a copy of the region to the canvas
| The selected region is deleted.A copy of the deleted region is added to the diagram canvas. The copy is identical to the deleted region, including all its contents.
| %{color:red}open% | | 2.15 | Delete |Remove the following elements from the diagram:
- Copied region
- Elements added in T.2.10
Press [Ctrl+S]
to save the statechart to the statechart file.
Switch to the _SC Modeling_ perspective.
In the project explorer, expand the _Staircase.sct_ file.
The following child entries are displayed:
_Interface Scope_
_Internal Scope_
_Region main region_
[Ctrl++]
to zoom in and [Ctrl+-]
to zoom out. | The view should zoom in and out. | %{color:red}open% |
| 2.18 | Undo & Redo | Select a region which includes at least one state with an outgoing transition.
Press @[Del]@ to delete the region.
Press [Ctrl+Z]
to undo the deletion.
Press [Ctrl+Y]
(Windows), [Shift+Ctrl+Z]
(Linux), or [Shift+Cmd+Z]
(Mac) to redo the deletion.
Try to move the affected element by dragging.
The elements involved during undo and redo have to be still changeable (move, delete change e.g., name) afterwards | %{color:red}open% | | 2.19 | Tasks |
Import the project from the _test-plugins/org.yakindu.sct.model.resource.test_ directory in your YAKINDU Statechart Tools source code repository.
Open the file _testdata/Tasks.sct_ in that project.
Import and open the model _test-plugins/org.yakindu.sct.test.manual/testmodels/SimpleWithSubDiagrams.sct_
Open all sub-diagrams in own tabs and arrange them in a way you can see all breadcrumbs
After that change the statecharts name, and names of states with sub-diagrams included