public void testEmitterErrors() {
File[] files = getStreamsByExtension(".emitter-error");
assertTrue("No test files found.", files.length > 0);
for (int i = 0; i < files.length; i++) {
String content = getResource(files[i].getName());
List<Event> document = (List<Event>) load(new EventConstructor(), content.trim());
Writer writer = new StringWriter();
Emitter emitter = new Emitter(writer, new DumperOptions());
try {
for (Event event : document) {
emitter.emit(event);