String configName = "TestEnabled";
ILaunchConfiguration config = launch(configName,
pkg.getJavaProject().getElementName(),
unit.getTypes()[0].getFullyQualifiedName(), ILaunchManager.RUN_MODE);
ILaunch launch = null;
final Lock lock = new ReentrantLock();
final Condition condition = lock.newCondition();
lock.lock();
try {
// Wait for listener to be notified:
while (listener.getLaunch(configName) == null) {
condition.await(100, TimeUnit.MILLISECONDS);
}
launch = listener.getLaunch(configName);
// Wait for launch to terminate:
while (!launch.isTerminated()) {
condition.await(100, TimeUnit.MILLISECONDS);
}
// Give the tracker a bit more time to finish:
condition.await(100, TimeUnit.MILLISECONDS);
} finally {