XsdValidator implements Validator<Source, String> { @Override public void validate(Source message, String schema) { List<ValidationException> exceptions = doValidate(message, schema); if (exceptions != null && exceptions.size() > 0) { throw new ValidationException(exceptions); } } XsdValidator();  XsdValidator(ClassLoader classloader); @Override void validate(Source message, String schema); Source schemaSource(String resource); String getSchemaLanguage(); void setSchemaLanguage(String schemaLanguage);  }
@Test public void testValidate() throws Exception { XsdValidator.getCachedSchemas().clear(); Source testXml = new StreamSource(new ClassPathResource("xsd/test.xml") .getInputStream()); validator.validate(testXml, SCHEMA_RESOURCE); Assert.assertTrue(XsdValidator.getCachedSchemas().containsKey( SCHEMA_RESOURCE)); }