return 0L;
}
});
executor.execute(op);
Status status = op.getStatus();
assertEquals(op.getId(), status.getId());
assertEquals(RUNNING, status.getCode());
thread.poll(5, SECONDS).interrupt();
try {
op.get();
fail("Expected InterruptedException");
} catch (ExecutionException e) {
assertTrue(e.getCause() instanceof InterruptedException);
}
assertTrue(op.isDone());
status = op.getStatus();
assertEquals(op.getId(), status.getId());
assertEquals(FAILED, status.getCode());
assertTrue(status.getMessage().contains("test failed: "));
}