XBELValidatorServiceImpl implements XBELValidatorService { @Override public void validate(String s) throws ValidationError { try { xv.validate(s); } catch (SAXParseException e) { final String name = e.getSystemId(); final String msg = e.getMessage(); final int line = e.getLineNumber(); final int column = e.getColumnNumber(); throw new ValidationError(name, msg, e, line, column); } catch (SAXException e) { throw new RuntimeException(e); } catch (IOException e) { throw new RuntimeException(e); } } XBELValidatorServiceImpl(); @Override boolean isValid(String s); @Override boolean isValid(File f); @Override void validate(String s); @Override List<ValidationError> validateWithErrors(String s); @Override void validate(File f); @Override List<ValidationError> validateWithErrors(File f);  }
@Test(expected = ValidationError.class) public void test() throws ValidationError { final String testxml = ROOT + "examples/invalid/beldocument_invalid.xbel"; final File testFile = new File(testxml); if (!testFile.canRead()) fail("can't read " + testxml); xvs.validate(testFile); }