Search in sources :

Example 1 with SearchChainTextRepresentation

use of com.yahoo.search.debug.SearchChainTextRepresentation in project vespa by vespa-engine.

the class SearchChainTextRepresentationTestCase method testTextRepresentation.

public void testTextRepresentation() {
    SearchChainTextRepresentation textRepresentation = new SearchChainTextRepresentation(SimpleSearchChain.orderedChain, new SearchChainRegistry());
    String[] expected = { "test [Searchchain]  {", "  one [Searcher] {", "    Reason for forwarding to this search chain.", "    child-chain [Searchchain]  {", "      child-searcher [Searcher]", "    }", "    child-chain [Searchchain]  {", "      child-searcher [Searcher]", "    }", "  }", "  two [Searcher] {", "    Reason for forwarding to this search chain.", "    child-chain [Searchchain]  {", "      child-searcher [Searcher]", "    }", "    child-chain [Searchchain]  {", "      child-searcher [Searcher]", "    }", "  }", "}" };
    String[] result = textRepresentation.toString().split("\n");
    assertEquals(expected.length, result.length);
    int i = 0;
    for (String line : textRepresentation.toString().split("\n")) assertEquals(expected[i++], line);
}
Also used : SearchChainRegistry(com.yahoo.search.searchchain.SearchChainRegistry) SearchChainTextRepresentation(com.yahoo.search.debug.SearchChainTextRepresentation)

Aggregations

SearchChainTextRepresentation (com.yahoo.search.debug.SearchChainTextRepresentation)1 SearchChainRegistry (com.yahoo.search.searchchain.SearchChainRegistry)1