summaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/search/federation/test/BlockingSearcher.java
blob: dcecf36f2aea69bff3a28567a297edb9f7939d3d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.federation.test;

import com.yahoo.search.Query;
import com.yahoo.search.Result;
import com.yahoo.search.Searcher;
import com.yahoo.search.searchchain.Execution;

/**
 * @author tonytv
 */
public class BlockingSearcher extends Searcher {
    @Override
    public synchronized Result search(Query query, Execution execution) {
        try {
            while (true)
                wait();
        } catch (InterruptedException e) {
        }
        return execution.search(query);
    }
}