private SyslogMessage test(String message) throws Exception {
MessageContext msgContext = new MessageContext();
ByteArrayInputStream in = new ByteArrayInputStream(message.getBytes("us-ascii"));
OMElement element = new SyslogMessageBuilder().processDocument(in, null, msgContext);
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = factory.newSchema(new StreamSource(SyslogMessageBuilderTest.class.getResource("schema.xsd").toExternalForm()));
Validator validator = schema.newValidator();
validator.setErrorHandler(new ErrorHandler() {
public void error(SAXParseException exception) throws SAXException {
throw exception;
}