use of com.canoo.dolphin.integration.runlater.RunLaterTestBean in project dolphin-platform by canoo.
the class RunLaterControllerTest method testRunLaterInPostConstruct.
@Test
public void testRunLaterInPostConstruct() {
// given:
final ControllerUnderTest<RunLaterTestBean> controller = createController(RUN_LATER_CONTROLLER_NAME);
final RunLaterTestBean model = controller.getModel();
// then
Assert.assertNotNull(model.getPostConstructPreRunLaterCallIndex());
Assert.assertNotNull(model.getPostConstructRunLaterCallIndex());
Assert.assertNotNull(model.getPostConstructPostRunLaterCallIndex());
Assert.assertTrue(model.getPostConstructPreRunLaterCallIndex() > 0);
Assert.assertTrue(model.getPostConstructRunLaterCallIndex() > 0);
Assert.assertTrue(model.getPostConstructPostRunLaterCallIndex() > 0);
Assert.assertTrue(model.getPostConstructPreRunLaterCallIndex() < model.getPostConstructPostRunLaterCallIndex());
Assert.assertTrue(model.getPostConstructPostRunLaterCallIndex() < model.getPostConstructRunLaterCallIndex());
}
use of com.canoo.dolphin.integration.runlater.RunLaterTestBean in project dolphin-platform by canoo.
the class RunLaterControllerTest method testRunLaterInAction.
@Test
public void testRunLaterInAction() {
// given:
final ControllerUnderTest<RunLaterTestBean> controller = createController(RUN_LATER_CONTROLLER_NAME);
final RunLaterTestBean model = controller.getModel();
// when:
controller.invoke(RUN_LATER_ACTION_NAME);
// then:
Assert.assertNotNull(model.getActionPreRunLaterCallIndex());
Assert.assertNotNull(model.getActionRunLaterCallIndex());
Assert.assertNotNull(model.getActionPostRunLaterCallIndex());
Assert.assertTrue(model.getActionPreRunLaterCallIndex() > 0);
Assert.assertTrue(model.getActionRunLaterCallIndex() > 0);
Assert.assertTrue(model.getActionPostRunLaterCallIndex() > 0);
Assert.assertTrue(model.getActionPreRunLaterCallIndex() < model.getActionPostRunLaterCallIndex());
Assert.assertTrue(model.getActionPostRunLaterCallIndex() < model.getActionRunLaterCallIndex());
}
use of com.canoo.dolphin.integration.runlater.RunLaterTestBean in project dolphin-platform by canoo.
the class RunLaterControllerTest method testRunLaterAsyncInAction.
@Test
public void testRunLaterAsyncInAction() throws Exception {
// given:
final ControllerUnderTest<RunLaterTestBean> controller = createController(RUN_LATER_CONTROLLER_NAME);
final RunLaterTestBean model = controller.getModel();
final CommunicationMonitor monitor = controller.createMonitor();
model.actionRunLaterAsyncCallIndexProperty().onChanged(e -> {
monitor.signal();
});
// when:
controller.invoke(RUN_LATER_ASYNC_ACTION_NAME);
monitor.await(10, TimeUnit.SECONDS);
// then:
Assert.assertNotNull(model.getActionPreRunLaterAsyncCallIndex());
Assert.assertNotNull(model.getActionRunLaterAsyncCallIndex());
Assert.assertNotNull(model.getActionPostRunLaterAsyncCallIndex());
Assert.assertTrue(model.getActionPreRunLaterAsyncCallIndex() > 0);
Assert.assertTrue(model.getActionRunLaterAsyncCallIndex() > 0);
Assert.assertTrue(model.getActionPostRunLaterAsyncCallIndex() > 0);
Assert.assertTrue(model.getActionPreRunLaterAsyncCallIndex() < model.getActionPostRunLaterAsyncCallIndex());
Assert.assertTrue(model.getActionPostRunLaterAsyncCallIndex() < model.getActionRunLaterAsyncCallIndex());
}
Aggregations