CompoundHighlighter extends AbstractHighlighter implements UIDependent { public void addHighlighter(Highlighter highlighter) { addHighlighter(highlighter, false); } CompoundHighlighter(Highlighter... inList);  CompoundHighlighter(HighlightPredicate predicate, Highlighter... inList); void setHighlighters(Highlighter... inList); void addHighlighter(Highlighter highlighter); void addHighlighter(Highlighter highlighter, boolean prepend); void removeHighlighter(Highlighter hl); Highlighter[] getHighlighters(); @Override void updateUI(); static final Highlighter[] EMPTY_HIGHLIGHTERS; }
@Test public void testAddToEmptyCompoundHiglighter() { CompoundHighlighter pipeline = new CompoundHighlighter(); pipeline.addHighlighter(new ColorHighlighter()); }
@Test public void testCompoundHighlighterAddNull() { CompoundHighlighter pipeline = new CompoundHighlighter(); try { pipeline.addHighlighter(null); fail("compoundHighlighter must not accept null highlighter"); } catch(NullPointerException ex) { } ComponentAdapter adapter = createComponentAdapter(allColored, false); pipeline.highlight(allColored, adapter); }
@Test public void testCompoundHighlighterChange() { ColorHighlighter highlighter = new ColorHighlighter(); CompoundHighlighter pipeline = new CompoundHighlighter(); ChangeReport changeReport = new ChangeReport(); pipeline.addChangeListener(changeReport); int count = changeReport.getEventCount(); pipeline.addHighlighter(highlighter); assertEquals("event count must be increased", ++count, changeReport.getEventCount() ); assertCompoundHighlighterChange(highlighter, pipeline, changeReport); }