new RegistriesImpl(Editor.ROOT_HANDLER_REGISTRY,
Editor.ROOT_ANNOTATION_REGISTRY, paintRegistry);
StyleAnnotationHandler.register(registries);
Editor editor = Editors.create();
editor.init(registries, KeyBindingRegistry.NONE, EditorSettings.DEFAULT);
// Now the actual test
ContentSerialisationUtil.setContentString(editor, "<body><line/>abc</body>");
CMutableDocument doc = editor.getDocument();
doc.setAnnotation(3, 4, "style/color", "red");
editor.getContent().debugCheckHealthy2();
timerService.tick(1000);
ContentView fullDoc = ((EditorImpl) editor).getContent().getFullContentView();
assertNotNull(
DocHelper.getElementWithTagName(fullDoc, AnnotationPaint.SPREAD_FULL_TAGNAME));
doc.setAnnotation(3, 4, "style/color", null);
timerService.tick(1000);
assertNull(DocHelper.getElementWithTagName(fullDoc, AnnotationPaint.SPREAD_FULL_TAGNAME));
doc.setAnnotation(3, 5, "style/color", "red");
editor.removeContentAndUnrender();
editor.reset();
timerService.tick(1000);
assertNull(DocHelper.getElementWithTagName(fullDoc, AnnotationPaint.SPREAD_FULL_TAGNAME));
}