Search in sources :

Example 26 with Param

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

the class ActionTestControllerTest method callPublicMethodWithBigDecimalParam.

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

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

the class ActionTestControllerTest method callPublicMethodWithIntegerParam.

/**
 * Start Integer Type Related Action Test
 */
@Test
public void callPublicMethodWithIntegerParam() {
    Assert.assertNull(controller.getModel().getIntegerValue());
    final int value = 10;
    controller.invoke(PUBLIC_WITH_INTEGER_PARAM_ACTION, new Param(PARAM_NAME, value));
    Assert.assertEquals(controller.getModel().getIntegerValue().intValue(), 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 28 with Param

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

the class ActionTestControllerTest method callPublicMethodWithShortParam.

/**
 * End Date Type Related Action Test
 */
/**
 * Start Short Type Related Action Test
 */
@Test
public void callPublicMethodWithShortParam() {
    Assert.assertNull(controller.getModel().getShortValue());
    final short value = 10;
    controller.invoke(PUBLIC_WITH_SHORT_PARAM_ACTION, new Param(PARAM_NAME, value));
    Assert.assertEquals(controller.getModel().getShortValue().shortValue(), 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 29 with Param

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

the class ActionTestControllerTest method callPublicMethodWithNullParam.

@Test
public void callPublicMethodWithNullParam() {
    Assert.assertNull(controller.getModel().getBooleanValue());
    String value = "Hello Dolphin Platform!";
    controller.invoke(PUBLIC_WITH_BOOLEAN_PARAM_ACTION, new Param(PARAM_NAME, null));
    Assert.assertNull(controller.getModel().getBooleanValue());
}
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 30 with Param

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

the class ActionTestControllerTest method callPrivateMethodWithFloatParam.

@Test
public void callPrivateMethodWithFloatParam() {
    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)

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