Search in sources :

Example 16 with Param

use of com.canoo.platform.remoting.client.Param in project dolphin-platform by canoo.

the class ActionControllerTest method testCallPublicMethodWithIntegerParams.

/**
 * Start Integer Type Related Integration Test
 */
@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Tests if an public action method with Integer param can be called")
public void testCallPublicMethodWithIntegerParams(String containerType, String endpoint) {
    final int value = 10;
    performActionForInteger(containerType, endpoint, PUBLIC_WITH_INTEGER_PARAM_ACTION, value, new Param(PARAM_NAME, value));
}
Also used : Param(com.canoo.platform.remoting.client.Param) Test(org.testng.annotations.Test)

Example 17 with Param

use of com.canoo.platform.remoting.client.Param in project dolphin-platform by canoo.

the class ActionControllerTest method callPublicMethodWithSeveralIntegerParams.

@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Tests if an public action method with several Integer param can be called")
public void callPublicMethodWithSeveralIntegerParams(String containerType, String endpoint) {
    final int value1 = 1;
    final int value2 = 2;
    final int value3 = 3;
    final int result = value1 + value2 + value3;
    performActionForInteger(containerType, endpoint, PUBLIC_WITH_SEVERAL_INTEGER_PARAMS_ACTION, result, new Param(PARAM_NAME_1, value1), new Param(PARAM_NAME_2, value2), new Param(PARAM_NAME_3, value3));
}
Also used : Param(com.canoo.platform.remoting.client.Param) Test(org.testng.annotations.Test)

Example 18 with Param

use of com.canoo.platform.remoting.client.Param in project dolphin-platform by canoo.

the class ActionControllerTest method testCallPublicMethodWithNullParam.

@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Tests if an public action with null value for param method can be called")
public void testCallPublicMethodWithNullParam(String containerType, String endpoint) {
    try {
        final ClientContext context = connect(endpoint);
        final ControllerProxy<ActionTestBean> controller = createController(context, ACTION_CONTROLLER_NAME);
        invoke(controller, PUBLIC_WITH_BOOLEAN_PARAM_ACTION, containerType, new Param(PARAM_NAME, null));
        Assert.assertNull(controller.getModel().getBooleanValue());
        destroy(controller, endpoint);
        disconnect(context, endpoint);
    } catch (Exception e) {
        Assert.fail("Can not create controller for " + containerType, e);
    }
}
Also used : ClientContext(com.canoo.platform.remoting.client.ClientContext) ActionTestBean(com.canoo.dolphin.integration.action.ActionTestBean) Param(com.canoo.platform.remoting.client.Param) Test(org.testng.annotations.Test)

Example 19 with Param

use of com.canoo.platform.remoting.client.Param in project dolphin-platform by canoo.

the class ActionControllerTest method testCallPrivateMethodWithByteParams.

@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Tests if an private action method with Byte param can be called")
public void testCallPrivateMethodWithByteParams(String containerType, String endpoint) {
    final byte value = 10;
    performActionForByte(containerType, endpoint, PRIVATE_WITH_BYTE_PARAM_ACTION, value, new Param(PARAM_NAME, value));
}
Also used : Param(com.canoo.platform.remoting.client.Param) Test(org.testng.annotations.Test)

Example 20 with Param

use of com.canoo.platform.remoting.client.Param in project dolphin-platform by canoo.

the class ActionControllerTest method testCallPublicMethodWithUUIDParams.

/**
 * End Short Type Related Integration Test
 */
/**
 * Start UUID Type Related Integration Test
 */
@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Tests if an public action method with UUID param can be called")
public void testCallPublicMethodWithUUIDParams(String containerType, String endpoint) {
    final UUID value = UUID.randomUUID();
    performActionForUUID(containerType, endpoint, PUBLIC_WITH_UUID_PARAM_ACTION, value, new Param(PARAM_NAME, value));
}
Also used : Param(com.canoo.platform.remoting.client.Param) UUID(java.util.UUID) Test(org.testng.annotations.Test)

Aggregations

Param (com.canoo.platform.remoting.client.Param)95 Test (org.testng.annotations.Test)94 ControllerUnderTest (com.canoo.platform.spring.test.ControllerUnderTest)49 SpringTestNGControllerTest (com.canoo.platform.spring.test.SpringTestNGControllerTest)49 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)49 BigDecimal (java.math.BigDecimal)8 BigInteger (java.math.BigInteger)8 ActionTestBean (com.canoo.dolphin.integration.action.ActionTestBean)5 ClientContext (com.canoo.platform.remoting.client.ClientContext)5 ToDoList (com.canoo.platform.samples.distribution.common.model.ToDoList)4 ElementType (java.lang.annotation.ElementType)4 Calendar (java.util.Calendar)4 Date (java.util.Date)4 UUID (java.util.UUID)4 MappingException (com.canoo.dp.impl.remoting.MappingException)1 CallActionCommand (com.canoo.dp.impl.remoting.commands.CallActionCommand)1 ControllerActionException (com.canoo.platform.remoting.client.ControllerActionException)1 ValueConverterException (com.canoo.platform.remoting.spi.converter.ValueConverterException)1 CompletableFuture (java.util.concurrent.CompletableFuture)1