/** * Assert that a document is valid. */ public void assertIsValid(){ if(!isValid()){ junit.framework.Assert.fail(messages.toString()); } }
/** * Append any validation message(s) to the specified StringBuffer. * * @param toAppendTo * @return specified StringBuffer with message(s) appended */ private StringBuilder appendMessage(StringBuilder toAppendTo) { if (isValid()) { return toAppendTo.append("[valid]"); } return toAppendTo.append(messages); }
/** * Append any validation message(s) to the specified StringBuffer. * * @param toAppendTo * @return specified StringBuffer with message(s) appended */ private StringBuffer appendMessage(StringBuffer toAppendTo) { if (isValid()) { return toAppendTo.append("[valid]"); } return toAppendTo.append(messages); }
/** * Assert that a document is valid. */ public void assertIsValid(){ if(!isValid()){ junit.framework.Assert.fail(messages.toString()); } }
/** * Assert that a Validator instance returns <code>isValid() == true</code> * @param validator */ public static void assertXMLValid(Validator validator) { assertEquals(validator.toString(), true, validator.isValid()); }
/** * Assert that a Validator instance returns <code>isValid() == true</code> * @param validator */ public static void assertXMLValid(Validator validator) { assertEquals(validator.toString(), true, validator.isValid()); }
/** * Asserts that the given xhtml does not match the schema. * * @param xhtml the xhtml to validate. * * @throws IOException if there is an I/O error * @throws SAXException if there is a parsing error */ public void assertSchemaMismatch(final String xhtml) throws IOException, SAXException { Validator validator = getSchemaValidator(xhtml); Assert.assertFalse("xhtml should not validate", validator.isValid()); }