XMLWorker implements XMLParserListener { public void text(String text) { if (text.startsWith("<![CDATA[") && text.endsWith("]]>")) { if (ignoreCdata()) return; else text = text.substring(9, text.length() - 3); } WorkerContext ctx = getLocalWC(); if (null != ctx.getCurrentTag()) { if (text.length() > 0) { Pipeline<?> wp = rootpPipe; ProcessObject po = new ProcessObject(); try { while (null != (wp = wp.content(ctx, ctx.getCurrentTag(), text, po))) ; } catch (PipelineException e) { throw new RuntimeWorkerException(e); } } } } XMLWorker(final Pipeline<?> pipeline, final boolean parseHtml); void init(); void startElement(final String tag, final Map<String, String> attr, final String ns); void endElement(final String tag, final String ns); void text(String text); void unknownText(final String text); void comment(final String comment); void close();  }
@Test public void verifyPipelineContentNotCalledOnNoTag() { worker.text("test"); Assert.assertFalse(called); }