use of org.jowidgets.cap.common.tools.execution.SyncResultCallback in project jo-client-platform by jo-source.
the class ExecutorAnnotationPostProcessorTest method testChangeFirstAndLastName.
@Test
public void testChangeFirstAndLastName() {
final IExecutorService<String[]> service = ServiceProvider.getService(new ServiceId<IExecutorService<String[]>>("changeFirstAndLastName", IExecutorService.class));
Assert.assertNotNull(service);
final SyncResultCallback<List<IBeanDto>> result = new SyncResultCallback<List<IBeanDto>>();
service.execute(result, Collections.singletonList(new BeanKey(0, 0)), new String[] { "Hans", "Hansen" }, null);
final List<IBeanDto> dtos = result.getResultSynchronious();
Assert.assertNotNull(dtos);
Assert.assertEquals(1, dtos.size());
final IBeanDto dto = dtos.get(0);
Assert.assertEquals(0, dto.getId());
Assert.assertEquals("Hans Hansen", dto.getValue("name"));
}
use of org.jowidgets.cap.common.tools.execution.SyncResultCallback in project jo-client-platform by jo-source.
the class ExecutorAnnotationPostProcessorTest method testChangeNameList.
@Test
public void testChangeNameList() {
final IExecutorService<String> service = ServiceProvider.getService(new ServiceId<IExecutorService<String>>("changeNameList", IExecutorService.class));
Assert.assertNotNull(service);
final SyncResultCallback<List<IBeanDto>> result = new SyncResultCallback<List<IBeanDto>>();
service.execute(result, Collections.singletonList(new BeanKey(0, 0)), "Hans", null);
final List<IBeanDto> dtos = result.getResultSynchronious();
Assert.assertNotNull(dtos);
Assert.assertEquals(1, dtos.size());
final IBeanDto dto = dtos.get(0);
Assert.assertEquals(0, dto.getId());
Assert.assertEquals("Hans", dto.getValue("name"));
}
Aggregations