use of com.canoo.dolphin.integration.parentchild.ParentTestBean in project dolphin-platform by canoo.
the class ParentChildControllerTest method testPostChildCreatedCalledWhenNonChildControllerCreated.
@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test if @PostChildCreated is not called in controller")
public void testPostChildCreatedCalledWhenNonChildControllerCreated(final String containerType, final String endpoint) {
try {
ClientContext context = connect(endpoint);
ControllerProxy<ParentTestBean> controller = createController(context, PARENT_CONTROLLER_NAME);
Assert.assertTrue(controller.getModel().postCreatedCalledProperty().get());
Property<Boolean> postChildCreatedProperty = controller.getModel().postChildCreatedCalledProperty();
Assert.assertNull(postChildCreatedProperty.get());
controller.createController(DUMMY_CHILD_CONTROLLER_NAME);
Thread.sleep(1000);
Assert.assertNull(postChildCreatedProperty.get());
destroy(controller, endpoint);
disconnect(context, endpoint);
} catch (Exception e) {
Assert.fail("Can not create controller for " + containerType, e);
}
}
Aggregations