use of com.canoo.dolphin.integration.action.ActionTestBean in project dolphin-platform by canoo.
the class ActionControllerTest method testCallWithParamsAsMap.
@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Tests if an private action method can be called")
public void testCallWithParamsAsMap(String containerType, String endpoint) {
try {
final ClientContext context = connect(endpoint);
final ControllerProxy<ActionTestBean> controller = createController(context, ACTION_CONTROLLER_NAME);
final String value1 = "Hello Dolphin Platform!";
final String value2 = "I want to test you!";
final int value3 = 356;
final Map<String, Object> params = new HashMap<>();
params.put(PARAM_NAME_1, value1);
params.put(PARAM_NAME_2, value2);
params.put(PARAM_NAME_3, value3);
invoke(controller, PRIVATE_WITH_SEVERAL_PARAMS_ACTION, containerType, params);
Assert.assertTrue(controller.getModel().getBooleanValue());
Assert.assertEquals(controller.getModel().getStringValue(), value1 + value2 + value3);
destroy(controller, endpoint);
disconnect(context, endpoint);
} catch (Exception e) {
Assert.fail("Can not create controller for " + containerType, e);
}
}
use of com.canoo.dolphin.integration.action.ActionTestBean in project dolphin-platform by canoo.
the class ActionControllerTest method performActionForDouble.
private void performActionForDouble(final String containerType, final String endpoint, final String action, final double 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().getDoubleValue().doubleValue(), result);
destroy(controller, endpoint);
disconnect(context, endpoint);
} catch (Exception e) {
Assert.fail("Can not create controller for " + containerType, e);
}
}
use of com.canoo.dolphin.integration.action.ActionTestBean in project dolphin-platform by canoo.
the class ActionControllerTest method testCallPrivateMethod.
@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Tests if an private action method can be called")
public void testCallPrivateMethod(String containerType, String endpoint) {
try {
final ClientContext context = connect(endpoint);
final ControllerProxy<ActionTestBean> controller = createController(context, ACTION_CONTROLLER_NAME);
invoke(controller, PRIVATE_ACTION, containerType);
Assert.assertTrue(controller.getModel().getBooleanValue());
destroy(controller, endpoint);
disconnect(context, endpoint);
} catch (Exception e) {
Assert.fail("Can not create controller for " + containerType, e);
}
}
use of com.canoo.dolphin.integration.action.ActionTestBean in project dolphin-platform by canoo.
the class ActionControllerTest method performActionForCalendar.
private void performActionForCalendar(final String containerType, final String endpoint, final String action, final Calendar 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().getCalendarValue().getTime(), result.getTime());
destroy(controller, endpoint);
disconnect(context, endpoint);
} catch (Exception e) {
Assert.fail("Can not create controller for " + containerType, e);
}
}
use of com.canoo.dolphin.integration.action.ActionTestBean in project dolphin-platform by canoo.
the class ActionControllerTest method performActionForBigDecimal.
private void performActionForBigDecimal(final String containerType, final String endpoint, final String action, final BigDecimal 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().getBigDecimalValue(), result);
destroy(controller, endpoint);
disconnect(context, endpoint);
} catch (Exception e) {
Assert.fail("Can not create controller for " + containerType, e);
}
}
Aggregations