Search in sources :

Example 41 with Param

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

the class ActionTestControllerTest method callPrivateMethodWithShortParam.

@Test
public void callPrivateMethodWithShortParam() {
    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 42 with Param

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

the class ActionTestControllerTest method callPrivateMethodWithUUIDParam.

@Test
public void callPrivateMethodWithUUIDParam() {
    Assert.assertNull(controller.getModel().getUuidValue());
    final UUID value = UUID.randomUUID();
    controller.invoke(PUBLIC_WITH_UUID_PARAM_ACTION, new Param(PARAM_NAME, value));
    Assert.assertEquals(controller.getModel().getUuidValue(), value);
}
Also used : Param(com.canoo.platform.remoting.client.Param) UUID(java.util.UUID) 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 43 with Param

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

the class ActionTestControllerTest method callPrivateMethodWithElementTypeParam.

@Test
public void callPrivateMethodWithElementTypeParam() {
    Assert.assertNull(controller.getModel().getEnumValue());
    final ElementType value = ElementType.METHOD;
    controller.invoke(PUBLIC_WITH_ELEMENT_TYPE_PARAM_ACTION, new Param(PARAM_NAME, value));
    Assert.assertEquals(controller.getModel().getEnumValue().compareTo(value), 0);
}
Also used : ElementType(java.lang.annotation.ElementType) 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 44 with Param

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

the class ActionTestControllerTest method callPublicMethodWithSeveralByteParams.

@Test
public void callPublicMethodWithSeveralByteParams() {
    Assert.assertNull(controller.getModel().getByteValue());
    final Byte value1 = 10;
    final Byte value2 = 20;
    final Byte value3 = 30;
    controller.invoke(PUBLIC_WITH_SEVERAL_BYTE_PARAMS_ACTION, new Param(PARAM_NAME_1, value1), new Param(PARAM_NAME_2, value2), new Param(PARAM_NAME_3, value3));
    Assert.assertEquals(controller.getModel().getByteValue().byteValue(), (byte) (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 45 with Param

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

the class ActionTestControllerTest method callPublicMethodWithDateParam.

/**
 * End Calendar Type Related Action Test
 */
/**
 * Start Date Type Related Action Test
 */
@Test
public void callPublicMethodWithDateParam() {
    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)

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