public class WorkspaceModelManagerTest extends AbstractDubModelManagerTest {
@Test
public void testShutdown() throws Exception { testShutdown$(); }
public void testShutdown$() throws Exception {
WorkspaceModelManager dmm = new WorkspaceModelManager(new WorkspaceModel());
dmm.initializeModelManager();
final CountDownLatch latch = new CountDownLatch(1);
dmm.modelAgent.submit(new Callable<Void>() {
@Override
public Void call() throws Exception {
latch.countDown();
new CountDownLatch(1).await(); // wait until interrupted
throw DeeCore.createCoreException("error", new Exception());
}
});
latch.await();
// Test that shutdown happens successfully even with pending task, and no log entries are made.
dmm.shutdownManager();
}