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);
}
Aggregations