class ConcurrentMergeScheduler {
/** Used for testing */
public static boolean anyUnhandledExceptions() {
if (allInstances == null) {
throw new RuntimeException("setTestMode() was not called; often this is because your test case's setUp method fails to call super.setUp in LuceneTestCase");
}
synchronized(allInstances) {
final int count = allInstances.size();
// Make sure all outstanding threads are done so we see
// any exceptions they may produce:
for(int i=0;i<count;i++)
((ConcurrentMergeScheduler) allInstances.get(i)).sync();
boolean v = anyExceptions;
anyExceptions = false;
return v;
}
}
}
|