use of com.intellij.util.xml.impl.DefaultDomAnnotator in project intellij-community by JetBrains.
the class DomHighlightingLiteTest method testDefaultAnnotator.
public void testDefaultAnnotator() throws Throwable {
final DefaultDomAnnotator annotator = new DefaultDomAnnotator() {
@Override
protected DomElementAnnotationsManagerImpl getAnnotationsManager(final DomElement element) {
return myAnnotationsManager;
}
};
final StringBuilder s = new StringBuilder();
final ArrayList<Annotation> toFill = new ArrayList<>();
final MyDomElementsInspection inspection = new MyDomElementsInspection() {
@Override
public void checkFileElement(final DomFileElement fileElement, final DomElementAnnotationHolder holder) {
s.append("visited");
}
};
annotator.runInspection(inspection, myElement, toFill);
assertEquals("visited", s.toString());
final DomElementsProblemsHolderImpl holder = assertNotEmptyHolder(myAnnotationsManager.getProblemHolder(myElement));
assertEmpty(toFill);
annotator.runInspection(inspection, myElement, toFill);
assertEquals("visited", s.toString());
assertSame(holder, assertNotEmptyHolder(myAnnotationsManager.getProblemHolder(myElement)));
assertEmpty(toFill);
}
Aggregations