@TestInfo(testType = TestInfo.TestType.UNIT)
public void testMultithreaded() throws InterruptedException{
int NUM_THREADS = 100;
WaitingSearcher baseSearcher = new WaitingSearcher();
final ISearcher searcher = new QueriesInProgressSearcher(baseSearcher);
final Object lock = new Object();
for (int i =0; i < NUM_THREADS; ++i) {
new Thread() {
public void run() {
synchronized (lock) {queriesInProgress++;}
try {
searcher.search(null, 0, 1, null, 1, null, null);
} catch (SearcherException e) {
e.printStackTrace();
fail();
}
synchronized (lock) {queriesInProgress--;}