Object data = in.readObject();
in.close();
assertEquals("This is the content", data);
System.out.println("Starting task " + task.getId());
BlockingTaskOperationResponseHandler operationResponseHandler = new BlockingTaskOperationResponseHandler();
client.start(task.getId(), "Darth Vader", operationResponseHandler);
operationResponseHandler.waitTillDone(5000);
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());
client.complete(task.getId(), "Darth Vader", result, operationResponseHandler);
operationResponseHandler.waitTillDone(5000);
System.out.println("Completed task " + task.getId());
assertTrue(manager.isCompleted());
Map<String, Object> results = manager.getResults();
assertNotNull(results);