Search in sources :

Example 86 with ActionEvent

use of javafx.event.ActionEvent in project Malai by arnobl.

the class TestSpinnerChanged method testProcessEventGoodState.

@Test
void testProcessEventGoodState() throws CancelFSMException {
    interaction.processEvent(new ActionEvent(widget, null));
    JfxtestHelper.waitForTimeoutTransitions();
    Mockito.verify(handler, Mockito.times(1)).fsmStops();
    Mockito.verify(handler, Mockito.times(1)).fsmStarts();
}
Also used : ActionEvent(javafx.event.ActionEvent) Test(org.junit.jupiter.api.Test)

Example 87 with ActionEvent

use of javafx.event.ActionEvent in project Malai by arnobl.

the class TestSpinnerChanged method testProcessEventReinit.

@Test
void testProcessEventReinit() {
    interaction.processEvent(new ActionEvent(widget, null));
    JfxtestHelper.waitForTimeoutTransitions();
    assertNull(interaction.getWidget());
    assertTrue(interaction.getFsm().getCurrentState() instanceof InitState);
}
Also used : ActionEvent(javafx.event.ActionEvent) InitState(org.malai.fsm.InitState) Test(org.junit.jupiter.api.Test)

Example 88 with ActionEvent

use of javafx.event.ActionEvent in project Malai by arnobl.

the class TestSpinnerChanged method testProcessEventGoodData.

@Test
void testProcessEventGoodData() {
    interaction.getFsm().addHandler(new InteractionHandlerStub() {

        @Override
        public void fsmStops() {
            assertEquals(widget, interaction.getWidget());
        }
    });
    interaction.processEvent(new ActionEvent(widget, null));
}
Also used : ActionEvent(javafx.event.ActionEvent) Test(org.junit.jupiter.api.Test)

Example 89 with ActionEvent

use of javafx.event.ActionEvent in project Malai by arnobl.

the class TestSpinnerChanged method testNoActionWhenNullRegistered.

@Test
void testNoActionWhenNullRegistered() throws CancelFSMException {
    interaction.registerToNodes(null);
    widget.fireEvent(new ActionEvent(widget, null));
    Mockito.verify(handler, Mockito.never()).fsmStops();
    Mockito.verify(handler, Mockito.never()).fsmStarts();
}
Also used : ActionEvent(javafx.event.ActionEvent) Test(org.junit.jupiter.api.Test)

Example 90 with ActionEvent

use of javafx.event.ActionEvent in project Malai by arnobl.

the class TestSpinnerChanged method testNoActionWhenNotRegistered.

@Test
void testNoActionWhenNotRegistered() throws CancelFSMException {
    widget.fireEvent(new ActionEvent(widget, null));
    Mockito.verify(handler, Mockito.never()).fsmStops();
    Mockito.verify(handler, Mockito.never()).fsmStarts();
}
Also used : ActionEvent(javafx.event.ActionEvent) Test(org.junit.jupiter.api.Test)

Aggregations

ActionEvent (javafx.event.ActionEvent)171 EventHandler (javafx.event.EventHandler)61 Stage (javafx.stage.Stage)52 KeyFrame (javafx.animation.KeyFrame)47 Timeline (javafx.animation.Timeline)47 FXML (javafx.fxml.FXML)44 Alert (javafx.scene.control.Alert)36 Button (javafx.scene.control.Button)35 Label (javafx.scene.control.Label)35 MenuItem (javafx.scene.control.MenuItem)33 ContextMenu (javafx.scene.control.ContextMenu)25 File (java.io.File)24 Insets (javafx.geometry.Insets)24 Scene (javafx.scene.Scene)24 List (java.util.List)21 ObservableList (javafx.collections.ObservableList)21 Node (javafx.scene.Node)20 TextField (javafx.scene.control.TextField)20 Optional (java.util.Optional)18 FXCollections (javafx.collections.FXCollections)18