@Test
public void test_valid_xml() throws IOException, SAXException {
Validator validator = getValidator("sw-config-xmlv-01.xml");
String source = "<person name='foo' age='50' />";
ValidationResult result = validator.validate(new DefaultMessage().setContent(source));
if (!result.isValid()) {
Assert.fail(result.getDetail());
}
source = "<person2 firstName='タロウ' lastName='ヤマダ' age='50' />";
result = validator.validate(new DefaultMessage().setContent(source));
if (!result.isValid()) {
Assert.fail(result.getDetail());
}
Assert.assertNull(result.getDetail());
}