Search in sources :

Example 71 with Param

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

the class ActionTestControllerTest method callPrivateMethodWithNullParam.

@Test
public void callPrivateMethodWithNullParam() {
    Assert.assertNull(controller.getModel().getBooleanValue());
    controller.invoke(PRIVATE_WITH_STRING_PARAM_ACTION, new Param(PARAM_NAME, null));
    Assert.assertTrue(controller.getModel().getBooleanValue());
    Assert.assertNull(controller.getModel().getStringValue());
}
Also used : Param(com.canoo.platform.remoting.client.Param) Test(org.testng.annotations.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SpringTestNGControllerTest(com.canoo.platform.spring.test.SpringTestNGControllerTest) ControllerUnderTest(com.canoo.platform.spring.test.ControllerUnderTest)

Example 72 with Param

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

the class ActionTestControllerTest method callPublicMethodWithSeveralIntegerParams.

@Test
public void callPublicMethodWithSeveralIntegerParams() {
    Assert.assertNull(controller.getModel().getIntegerValue());
    final int value1 = 1;
    final int value2 = 2;
    final int value3 = 3;
    controller.invoke(PUBLIC_WITH_SEVERAL_INTEGER_PARAMS_ACTION, new Param(PARAM_NAME_1, value1), new Param(PARAM_NAME_2, value2), new Param(PARAM_NAME_3, value3));
    Assert.assertEquals(controller.getModel().getIntegerValue().intValue(), value1 + value2 + value3);
}
Also used : Param(com.canoo.platform.remoting.client.Param) Test(org.testng.annotations.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SpringTestNGControllerTest(com.canoo.platform.spring.test.SpringTestNGControllerTest) ControllerUnderTest(com.canoo.platform.spring.test.ControllerUnderTest)

Example 73 with Param

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

the class ActionTestControllerTest method callPublicMethodWithFloatParam.

/**
 * End Long Type Related Action Test
 */
/**
 * Start Float Type Related Action Test
 */
@Test
public void callPublicMethodWithFloatParam() {
    Assert.assertNull(controller.getModel().getFloatValue());
    final float value = 10F;
    controller.invoke(PUBLIC_WITH_FLOAT_PARAM_ACTION, new Param(PARAM_NAME, value));
    Assert.assertEquals(controller.getModel().getFloatValue().floatValue(), value);
}
Also used : Param(com.canoo.platform.remoting.client.Param) Test(org.testng.annotations.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SpringTestNGControllerTest(com.canoo.platform.spring.test.SpringTestNGControllerTest) ControllerUnderTest(com.canoo.platform.spring.test.ControllerUnderTest)

Example 74 with Param

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

the class ActionControllerTest method testCallPublicMethodWithLongParams.

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

Example 75 with Param

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

the class ActionControllerTest method testCallPublicMethodWithShortParams.

/**
 * End Date Type Related Integration Test
 */
/**
 * Start Short Type Related Integration Test
 */
@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Tests if an public action method with Short param can be called")
public void testCallPublicMethodWithShortParams(String containerType, String endpoint) {
    final short value = 10;
    performActionForShort(containerType, endpoint, PUBLIC_WITH_SHORT_PARAM_ACTION, value, new Param(PARAM_NAME, value));
}
Also used : Param(com.canoo.platform.remoting.client.Param) 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