use of com.canoo.platform.remoting.client.ClientContext in project dolphin-platform by canoo.
the class BeansControllerTest method testCreateController.
@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test if all bean types of Dolphin Platform can be injected in a controller")
public void testCreateController(String containerType, String endpoint) {
try {
ClientContext context = connect(endpoint);
ControllerProxy<BeanTestBean> controller = createController(context, BEAN_CONTROLLER_NAME);
Assert.assertTrue(controller.getModel().getBeanManagerInjected());
Assert.assertTrue(controller.getModel().getClientSessionInjected());
Assert.assertTrue(controller.getModel().getDolphinEventBusInjected());
Assert.assertTrue(controller.getModel().getPropertyBinderInjected());
Assert.assertTrue(controller.getModel().getRemotingContextInjected());
destroy(controller, endpoint);
disconnect(context, endpoint);
} catch (Exception e) {
Assert.fail("Error in test for " + containerType, e);
}
}
use of com.canoo.platform.remoting.client.ClientContext in project dolphin-platform by canoo.
the class ClientIdTest method testThatClientIdIsNotNull.
@Test(dataProvider = ENDPOINTS_DATAPROVIDER)
public void testThatClientIdIsNotNull(String containerType, String endpoint) {
ClientContext context = connect(endpoint);
Assert.assertNotNull(context.getClientId());
}
use of com.canoo.platform.remoting.client.ClientContext in project dolphin-platform by canoo.
the class EnterpriseControllerTest method testPostConstruct.
@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test if @PostConstruct is called in controller")
public void testPostConstruct(String containerType, String endpoint) {
try {
ClientContext context = connect(endpoint);
ControllerProxy<EnterpriseTestBean> controller = createController(context, ENTERPRISE_CONTROLLER_NAME);
Assert.assertTrue(controller.getModel().getPostConstructCalled());
destroy(controller, endpoint);
disconnect(context, endpoint);
} catch (Exception e) {
Assert.fail("Can not create controller for " + containerType, e);
}
}
use of com.canoo.platform.remoting.client.ClientContext in project dolphin-platform by canoo.
the class EnterpriseControllerTest method testPreDestroy.
@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test if @PreDestroy is called in controller")
public void testPreDestroy(String containerType, String endpoint) {
try {
ClientContext context = connect(endpoint);
ControllerProxy<EnterpriseTestBean> controller = createController(context, ENTERPRISE_CONTROLLER_NAME);
Property<Boolean> preDestroyProperty = controller.getModel().preDestroyCalledProperty();
Assert.assertNull(preDestroyProperty.get());
destroy(controller, endpoint);
Assert.assertTrue(preDestroyProperty.get());
disconnect(context, endpoint);
} catch (Exception e) {
Assert.fail("Can not create controller for " + containerType, e);
}
}
use of com.canoo.platform.remoting.client.ClientContext in project dolphin-platform by canoo.
the class ParentChildControllerTest method testPostChildCreatedCalledWhenChildControllerCreated.
@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test if @PostChildCreated is called in controller")
public void testPostChildCreatedCalledWhenChildControllerCreated(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(CHILD_CONTROLLER_NAME);
Thread.sleep(2000);
Assert.assertTrue(postChildCreatedProperty.get());
destroy(controller, endpoint);
disconnect(context, endpoint);
} catch (Exception e) {
Assert.fail("Can not create controller for " + containerType, e);
}
}
Aggregations