Search in sources :

Example 31 with Param

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

the class ActionTestControllerTest method callPublicMethodWithBigIntegerParam.

/**
 * End BigDecimal Type Related Action Test
 */
/**
 * Start BigInteger Type Related Action Test
 */
@Test
public void callPublicMethodWithBigIntegerParam() {
    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 32 with Param

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

the class ActionTestControllerTest method callPrivateMethodWithDateParam.

@Test
public void callPrivateMethodWithDateParam() {
    Assert.assertNull(controller.getModel().getDateValue());
    final Date value = new Date();
    controller.invoke(PUBLIC_WITH_DATE_PARAM_ACTION, new Param(PARAM_NAME, value));
    Assert.assertEquals(controller.getModel().getDateValue(), value);
}
Also used : Param(com.canoo.platform.remoting.client.Param) Date(java.util.Date) 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 33 with Param

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

the class ActionTestControllerTest method callPrivateMethodWithStringParam.

@Test
public void callPrivateMethodWithStringParam() {
    Assert.assertNull(controller.getModel().getBooleanValue());
    String value = "Hello Dolphin Platform!";
    controller.invoke(PRIVATE_WITH_STRING_PARAM_ACTION, new Param(PARAM_NAME, value));
    Assert.assertTrue(controller.getModel().getBooleanValue());
    Assert.assertEquals(controller.getModel().getStringValue(), 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 34 with Param

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

the class ActionTestControllerTest method callPublicMethodWithSeveralFloatParams.

@Test
public void callPublicMethodWithSeveralFloatParams() {
    Assert.assertNull(controller.getModel().getFloatValue());
    final float value1 = 1F;
    final float value2 = 2F;
    final float value3 = 3F;
    controller.invoke(PUBLIC_WITH_SEVERAL_FLOAT_PARAMS_ACTION, new Param(PARAM_NAME_1, value1), new Param(PARAM_NAME_2, value2), new Param(PARAM_NAME_3, value3));
    Assert.assertEquals(controller.getModel().getFloatValue().floatValue(), 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 35 with Param

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

the class ActionTestControllerTest method callPrivateMethodWithSeveralShortParams.

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