12461247124812491250125112521253125412551256
assertTrue("Failed to find correct number of highlights " + numHighlights + " found", numHighlights == 0); } }; helper.start(); } public void testNoFragments() throws Exception { TestHighlightRunner helper = new TestHighlightRunner() {
12671268126912701271127212731274127512761277
assertNull("The highlight result should be null for text with no query terms", result); } } }; helper.start(); } /** * Demonstrates creation of an XHTML compliant doc using new encoding facilities. *
14221423142414251426142714281429143014311432
reader.close(); } }; helper.start(); } protected TokenStream getTS2() { // String s = "Hi-Speed10 foo";
15911592159315941595159615971598159916001601
result = highlighter.getBestFragments(getTS2a(), s, 3, "..."); assertEquals("<B>Hi-Speed</B>10 foo", result); } }; helper.start(); } private Directory dir; private Analyzer a = new MockAnalyzer(random, MockTokenizer.WHITESPACE, false);
613614615616617618619620621622623
assertTrue("Failed to find correct number of highlights " + numHighlights + " found", numHighlights == 4); } }; helper.start(); } public void testGetFuzzyFragments() throws Exception { TestHighlightRunner helper = new TestHighlightRunner() {
629630631632633634635636637638639
assertTrue("Failed to find correct number of highlights " + numHighlights + " found", numHighlights == 5); } }; helper.start(); } public void testGetWildCardFragments() throws Exception { TestHighlightRunner helper = new TestHighlightRunner() {
645646647648649650651652653654655
assertTrue("Failed to find correct number of highlights " + numHighlights + " found", numHighlights == 4); } }; helper.start(); } public void testGetMidWildCardFragments() throws Exception { TestHighlightRunner helper = new TestHighlightRunner() {
661662663664665666667668669670671
assertTrue("Failed to find correct number of highlights " + numHighlights + " found", numHighlights == 5); } }; helper.start(); } public void testGetRangeFragments() throws Exception { TestHighlightRunner helper = new TestHighlightRunner() {
686687688689690691692693694695696
assertTrue("Failed to find correct number of highlights " + numHighlights + " found", numHighlights == 5); } }; helper.start(); } public void testConstantScoreMultiTermQuery() throws Exception { numHighlights = 0;
795796797798799800801802803804805
assertTrue("Failed to find correct number of highlights " + numHighlights + " found", numHighlights == 2); } }; helper.start(); } public void testGetBestFragmentsQueryScorer() throws Exception { TestHighlightRunner helper = new TestHighlightRunner() {