Search in sources :

Example 51 with Param

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

the class ActionTestControllerTest method callPrivateMethodWithSeveralLongParams.

@Test
public void callPrivateMethodWithSeveralLongParams() {
    Assert.assertNull(controller.getModel().getLongValue());
    final long value1 = 1L;
    final long value2 = 2L;
    controller.invoke(PRIVATE_WITH_SEVERAL_LONG_PARAMS_ACTION, new Param(PARAM_NAME_1, value1), new Param(PARAM_NAME_2, value2));
    Assert.assertEquals(controller.getModel().getLongValue().longValue(), 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 52 with Param

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

the class ActionTestControllerTest method callPrivateMethodWithLongParam.

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

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

the class ActionTestControllerTest method callPublicMethodWithUUIDParam.

/**
 * End Short Type Related Action Test
 */
/**
 * Start UUID Type Related Action Test
 */
@Test
public void callPublicMethodWithUUIDParam() {
    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 54 with Param

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

the class ToDoControllerTests method testElementDeleteSync.

@Test
public void testElementDeleteSync() {
    // given:
    ControllerUnderTest<ToDoList> controllerUnderTest = createController(TODO_CONTROLLER_NAME);
    ControllerUnderTest<ToDoList> controllerUnderTest2 = createController(TODO_CONTROLLER_NAME);
    // when:
    controllerUnderTest.getModel().getNewItemText().set("Banana");
    controllerUnderTest.invoke(ADD_ACTION);
    controllerUnderTest.invoke(REMOVE_ACTION, new Param(ITEM_PARAM, "Banana"));
    // then:
    Assert.assertEquals(controllerUnderTest2.getModel().getItems().size(), 0);
}
Also used : ToDoList(com.canoo.platform.samples.distribution.common.model.ToDoList) Param(com.canoo.platform.remoting.client.Param) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SpringTestNGControllerTest(com.canoo.platform.spring.test.SpringTestNGControllerTest) Test(org.testng.annotations.Test) ControllerUnderTest(com.canoo.platform.spring.test.ControllerUnderTest)

Example 55 with Param

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

the class ActionControllerTest method testCallPublicMethodWithDateParams.

/**
 * End Calendar Type Related Integration Test
 */
/**
 * Start Date Type Related Integration Test
 */
@Test(dataProvider = ENDPOINTS_DATAPROVIDER, description = "Tests if an public action method with Date param can be called")
public void testCallPublicMethodWithDateParams(String containerType, String endpoint) {
    final Date value = new Date();
    performActionForDate(containerType, endpoint, PUBLIC_WITH_DATE_PARAM_ACTION, value, new Param(PARAM_NAME, value));
}
Also used : Param(com.canoo.platform.remoting.client.Param) Date(java.util.Date) Test(org.testng.annotations.Test)

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