Search in sources :

Example 46 with Param

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

the class ActionTestControllerTest method callPublicMethodWithByteParam.

/**
 * End BigInteger Type Related Action Test
 */
/**
 * Start Byte Type Related Action Test
 */
@Test
public void callPublicMethodWithByteParam() {
    Assert.assertNull(controller.getModel().getByteValue());
    final Byte value = 10;
    controller.invoke(PUBLIC_WITH_BYTE_PARAM_ACTION, new Param(PARAM_NAME, value));
    Assert.assertEquals(controller.getModel().getByteValue(), 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 47 with Param

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

the class ActionTestControllerTest method callPrivateMethodWithDoubleParam.

@Test
public void callPrivateMethodWithDoubleParam() {
    Assert.assertNull(controller.getModel().getDoubleValue());
    final double value = 10.0;
    controller.invoke(PUBLIC_WITH_DOUBLE_PARAM_ACTION, new Param(PARAM_NAME, value));
    Assert.assertEquals(controller.getModel().getDoubleValue().doubleValue(), 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 48 with Param

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

the class ActionTestControllerTest method callPublicMethodWithSeveralBigIntegerParams.

@Test
public void callPublicMethodWithSeveralBigIntegerParams() {
    Assert.assertNull(controller.getModel().getBigIntegerValue());
    final BigInteger value1 = BigInteger.TEN;
    final BigInteger value2 = BigInteger.TEN;
    final BigInteger value3 = BigInteger.TEN;
    controller.invoke(PUBLIC_WITH_SEVERAL_BIGINTEGER_PARAMS_ACTION, new Param(PARAM_NAME_1, value1), new Param(PARAM_NAME_2, value2), new Param(PARAM_NAME_3, value3));
    Assert.assertEquals(controller.getModel().getBigIntegerValue(), value1.add(value2).add(value3));
}
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 49 with Param

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

the class ActionTestControllerTest method callPublicMethodWithLongParam.

/**
 * End Integer Type Related Action Test
 */
/**
 * Start Long Type Related Action Test
 */
@Test
public void callPublicMethodWithLongParam() {
    Assert.assertNull(controller.getModel().getLongValue());
    final long value = 10L;
    controller.invoke(PUBLIC_WITH_LONG_PARAM_ACTION, new Param(PARAM_NAME, value));
    Assert.assertEquals(controller.getModel().getLongValue().longValue(), 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 50 with Param

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

the class ActionTestControllerTest method callPublicMethodWithBooleanParam.

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

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