use of com.canoo.platform.remoting.client.ClientContext in project dolphin-platform by canoo.
the class ActionControllerTest method performActionForFloat.
private void performActionForFloat(final String containerType, final String endpoint, final String action, final float result, final Param... params) {
try {
final ClientContext context = connect(endpoint);
final ControllerProxy<ActionTestBean> controller = createController(context, ACTION_CONTROLLER_NAME);
invoke(controller, action, containerType, params);
Assert.assertEquals(controller.getModel().getFloatValue().floatValue(), result);
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 ConnectionTest method testConnection.
@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Tests if the client API can create a connection to the server")
public void testConnection(String containerType, String endpoint) {
try {
ClientContext context = connect(endpoint);
Assert.assertNotNull(context);
disconnect(context, endpoint);
} catch (Exception e) {
Assert.fail("Can not create connection for " + containerType, e);
}
}
use of com.canoo.platform.remoting.client.ClientContext in project dolphin-platform by canoo.
the class ControllerWithoutModelTest 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 controller = createController(context, CONTROLLER_WITHOUT_MODEL_NAME);
Assert.assertNull(controller.getModel());
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 EnterpriseControllerTest method testCreateController.
@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Test if controller and model can be created")
public void testCreateController(String containerType, String endpoint) {
try {
ClientContext context = connect(endpoint);
ControllerProxy<EnterpriseTestBean> controller = createController(context, ENTERPRISE_CONTROLLER_NAME);
Assert.assertNotNull(controller);
Assert.assertNotNull(controller.getModel());
Assert.assertEquals(controller.getModel().getClass(), EnterpriseTestBean.class);
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 ActionControllerTest method performActionForBigInteger.
private void performActionForBigInteger(final String containerType, final String endpoint, final String action, final BigInteger result, final Param... params) {
try {
final ClientContext context = connect(endpoint);
final ControllerProxy<ActionTestBean> controller = createController(context, ACTION_CONTROLLER_NAME);
invoke(controller, action, containerType, params);
Assert.assertEquals(controller.getModel().getBigIntegerValue(), result);
destroy(controller, endpoint);
disconnect(context, endpoint);
} catch (Exception e) {
Assert.fail("Can not create controller for " + containerType, e);
}
}
Aggregations