public void doTest(final Runnable runnable) { final TimeoutWaiter waiter = new TimeoutWaiter(); final DuringUpdateTest test = new DuringUpdateTest(waiter, runnable); myChangeProvider.setTest(test); waiter.setControlled(test); myDirtyScopeManager.markEverythingDirty(); myClManager.ensureUpToDate(false); waiter.startTimeout(); if (test.getException() != null) { test.getException().printStackTrace(); } assert test.get() : (test.getException() == null ? null : test.getException().getMessage()); }
public void run() { try { myRunnable.run(); } catch (final Exception e) { myException = e; } myDone = myException == null; myChangeProvider.setTest(null); myChangeProvider.unlock(); synchronized (myWaiter) { myWaiter.notifyAll(); } }