@Test public void testLongLineNearBufferBoundary() throws ParseException { char[] chars = new char[Context.MAXFILEREAD]; Arrays.fill(chars, 'a'); char[] substring = " this is a test ".toCharArray(); System.arraycopy(substring, 0, chars, Context.MAXFILEREAD - substring.length, substring.length); Reader in = new CharArrayReader(chars); QueryBuilder qb = new QueryBuilder().setFreetext("test"); Context c = new Context(qb.build(), qb); StringWriter out = new StringWriter(); boolean match = c.getContext(in, out, "", "", "", null, true, qb.isDefSearch(), null); assertTrue("No match found", match); String s = out.toString(); assertTrue("Match not written to Writer", s.contains(" this is a <b>test</b>")); assertTrue("No match on line #1", s.contains("href=\"#1\"")); }
public boolean getContext(Reader in, Writer out, String urlPrefix, String morePrefix, String path, Definitions tags, boolean limit, boolean isDefSearch, List<Hit> hits) { return getContext(in, out, urlPrefix, morePrefix, path, tags, limit, isDefSearch, hits, null); }
Context { public boolean getContext(Reader in, Writer out, String urlPrefix, String morePrefix, String path, Definitions tags, boolean limit, boolean isDefSearch, List<Hit> hits) { return getContext(in, out, urlPrefix, morePrefix, path, tags, limit, isDefSearch, hits, null); } }
Context { public boolean getContext(Reader in, Writer out, String urlPrefix, String morePrefix, String path, Definitions tags, boolean limit, boolean isDefSearch, List<Hit> hits) { return getContext(in, out, urlPrefix, morePrefix, path, tags, limit, isDefSearch, hits, null); } Context(Query query, QueryBuilder qbuilder); }
Context { public boolean getContext(Reader in, Writer out, String urlPrefix, String morePrefix, String path, Definitions tags, boolean limit, boolean isDefSearch, List<Hit> hits) { return getContext(in, out, urlPrefix, morePrefix, path, tags, limit, isDefSearch, hits, null); } Context(Query query, QueryBuilder qbuilder); void toggleAlt(); boolean isEmpty(); boolean getContext2(RuntimeEnvironment env, IndexSearcher searcher,
        int docId, Appendable dest, String urlPrefix, String morePrefix,
        boolean limit, int tabSize); boolean getContext(Reader in, Writer out, String urlPrefix,
        String morePrefix, String path, Definitions tags,
        boolean limit, boolean isDefSearch, List<Hit> hits); boolean getContext(Reader in, Writer out, String urlPrefix,
            String morePrefix, String path, Definitions tags,
            boolean limit, boolean isDefSearch, List<Hit> hits, Scopes scopes); }
Context { public boolean getContext(Reader in, Writer out, String urlPrefix, String morePrefix, String path, Definitions tags, boolean limit, boolean isDefSearch, List<Hit> hits) { return getContext(in, out, urlPrefix, morePrefix, path, tags, limit, isDefSearch, hits, null); } Context(Query query, QueryBuilder qbuilder); void toggleAlt(); boolean isEmpty(); boolean getContext2(RuntimeEnvironment env, IndexSearcher searcher,
        int docId, Appendable dest, String urlPrefix, String morePrefix,
        boolean limit, int tabSize); boolean getContext(Reader in, Writer out, String urlPrefix,
        String morePrefix, String path, Definitions tags,
        boolean limit, boolean isDefSearch, List<Hit> hits); boolean getContext(Reader in, Writer out, String urlPrefix,
            String morePrefix, String path, Definitions tags,
            boolean limit, boolean isDefSearch, List<Hit> hits, Scopes scopes);  }