Search in sources :

Example 36 with Param

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

the class ActionTestControllerTest method callPrivateMethodWithSeveralFloatParams.

@Test
public void callPrivateMethodWithSeveralFloatParams() {
    Assert.assertNull(controller.getModel().getFloatValue());
    final float value1 = 1F;
    final float value2 = 2F;
    controller.invoke(PRIVATE_WITH_SEVERAL_FLOAT_PARAMS_ACTION, new Param(PARAM_NAME_1, value1), new Param(PARAM_NAME_2, value2));
    Assert.assertEquals(controller.getModel().getFloatValue().floatValue(), value1 + value2);
}
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 37 with Param

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

the class ActionTestControllerTest method callPrivateMethodWithBigDecimalParam.

@Test
public void callPrivateMethodWithBigDecimalParam() {
    Assert.assertNull(controller.getModel().getBigDecimalValue());
    final BigDecimal value = new BigDecimal(10);
    controller.invoke(PUBLIC_WITH_BIGDECIMAL_PARAM_ACTION, new Param(PARAM_NAME, value));
    Assert.assertEquals(controller.getModel().getBigDecimalValue(), value);
}
Also used : Param(com.canoo.platform.remoting.client.Param) BigDecimal(java.math.BigDecimal) 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 38 with Param

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

the class ActionTestControllerTest method callPublicMethodWithSeveralShortParams.

@Test
public void callPublicMethodWithSeveralShortParams() {
    Assert.assertNull(controller.getModel().getShortValue());
    final short value1 = 10;
    final short value2 = 10;
    final short value3 = 10;
    controller.invoke(PUBLIC_WITH_SEVERAL_SHORT_PARAMS_ACTION, new Param(PARAM_NAME_1, value1), new Param(PARAM_NAME_2, value2), new Param(PARAM_NAME_3, value3));
    Assert.assertEquals(controller.getModel().getShortValue().shortValue(), (short) (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 39 with Param

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

the class ActionTestControllerTest method callPrivateMethodWithBigIntegerParam.

@Test
public void callPrivateMethodWithBigIntegerParam() {
    Assert.assertNull(controller.getModel().getBigIntegerValue());
    final BigInteger value = BigInteger.TEN;
    controller.invoke(PUBLIC_WITH_BIGINTEGER_PARAM_ACTION, new Param(PARAM_NAME, value));
    Assert.assertEquals(controller.getModel().getBigIntegerValue(), value);
}
Also used : Param(com.canoo.platform.remoting.client.Param) BigInteger(java.math.BigInteger) 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 40 with Param

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

the class ActionTestControllerTest method callPrivateMethodWithSeveralDoubleParams.

@Test
public void callPrivateMethodWithSeveralDoubleParams() {
    Assert.assertNull(controller.getModel().getDoubleValue());
    final double value1 = 1.0;
    final double value2 = 2.0;
    controller.invoke(PRIVATE_WITH_SEVERAL_DOUBLE_PARAMS_ACTION, new Param(PARAM_NAME_1, value1), new Param(PARAM_NAME_2, value2));
    Assert.assertEquals(controller.getModel().getDoubleValue().doubleValue(), value1 + value2);
}
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)

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