Object data = in.readObject();
in.close();
assertEquals("This is the content", data);
System.out.println("Starting task " + task.getId());
BlockingTaskOperationResponseHandler operationResponseHandler = new BlockingTaskOperationResponseHandler();
getClient().start(task.getId(), "Darth Vader", operationResponseHandler);
operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
System.out.println("Started task " + task.getId());
System.out.println("Completing task " + task.getId());
operationResponseHandler = new BlockingTaskOperationResponseHandler();
ContentData result = new ContentData();
result.setAccessType(AccessType.Inline);
result.setType("java.lang.String");
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(bos);
out.writeObject("This is the result");
out.close();
result.setContent(bos.toByteArray());
getClient().complete(task.getId(), "Darth Vader", result, operationResponseHandler);
operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
System.out.println("Completed task " + task.getId());
assertTrue(manager.waitTillCompleted(MANAGER_COMPLETION_WAIT_TIME));
Map<String, Object> results = manager.getResults();
assertNotNull(results);