assertTrue(processingVAs.get(1).getContentHandler() instanceof ProcessorVisitor1);
}
public void test_filtering() throws IOException, SAXException {
Smooks smooks = new Smooks();
BasicExecutionEventListener eventListener = new BasicExecutionEventListener();
smooks.addConfigurations("config2.xml", getClass().getResourceAsStream("config2.xml"));
// Create an exec context - no profiles....
ExecutionContext executionContext = smooks.createExecutionContext();
CharArrayWriter outputWriter = new CharArrayWriter();
// Filter the input message to the outputWriter, using the execution context...
executionContext.setEventListener(eventListener);
smooks.filterSource(executionContext, new StreamSource(getClass().getResourceAsStream("testxml1.xml")), new StreamResult(outputWriter));
log.debug(outputWriter.toString());
byte[] expected = StreamUtils.readStream(getClass().getResourceAsStream("testxml1-expected.xml"));
assertTrue(StreamUtils.compareCharStreams(new ByteArrayInputStream(expected), new ByteArrayInputStream(outputWriter.toString().getBytes())));
assertEquals(32, eventListener.getEvents().size());
}