use of com.helger.schematron.pure.validation.LoggingPSValidationHandler in project ph-schematron by phax.
the class Issue088Test method _validateAndProduceSVRL.
private static void _validateAndProduceSVRL(@Nonnull final File aSchematron, @Nonnull final File aXML) throws Exception {
final SchematronResourcePure aSCH = SchematronResourcePure.fromFile(aSchematron);
aSCH.setCustomValidationHandler(new LoggingPSValidationHandler());
// Perform validation
final SchematronOutputType aSVRL = aSCH.applySchematronValidationToSVRL(new FileSystemResource(aXML));
assertNotNull(aSVRL);
final String sSVRL = new SVRLMarshaller().getAsString(aSVRL);
assertNotNull(sSVRL);
if (false)
LOGGER.info("SVRL:\n" + sSVRL);
assertTrue(SVRLHelper.getAllFailedAssertionsAndSuccessfulReports(aSVRL).isEmpty());
}
use of com.helger.schematron.pure.validation.LoggingPSValidationHandler in project ph-schematron by phax.
the class Issue099Test method _validateAndProduceSVRL.
private static void _validateAndProduceSVRL(@Nonnull final File aSchematron, @Nonnull final File aXML) throws Exception {
SchematronDebug.setSaveIntermediateXSLTFiles(true);
final StopWatch aSW = StopWatch.createdStarted();
LOGGER.info("Start");
final ISchematronResource aSCH = SchematronResourcePure.fromFile(aSchematron);
if (aSCH instanceof SchematronResourcePure)
((SchematronResourcePure) aSCH).setCustomValidationHandler(new LoggingPSValidationHandler());
// Perform validation
final SchematronOutputType aSVRL = aSCH.applySchematronValidationToSVRL(new FileSystemResource(aXML));
assertNotNull(aSVRL);
aSW.stop();
LOGGER.info("Took " + aSW.getDuration());
LOGGER.info("SVRL:\n" + new SVRLMarshaller().getAsString(aSVRL));
assertTrue(SVRLHelper.getAllFailedAssertionsAndSuccessfulReports(aSVRL).isEmpty());
}
use of com.helger.schematron.pure.validation.LoggingPSValidationHandler in project ph-schematron by phax.
the class Issue126Test method _validateAndProduceSVRL.
private static void _validateAndProduceSVRL(@Nonnull final File aSchematron, @Nonnull final File aXML) throws Exception {
final SchematronResourcePure aSCH = SchematronResourcePure.fromFile(aSchematron);
aSCH.setCustomValidationHandler(new LoggingPSValidationHandler());
// Perform validation
final SchematronOutputType aSVRL = aSCH.applySchematronValidationToSVRL(new FileSystemResource(aXML));
assertNotNull(aSVRL);
final String sSVRL = new SVRLMarshaller().getAsString(aSVRL);
assertNotNull(sSVRL);
if (true)
LOGGER.info("SVRL:\n" + sSVRL);
assertEquals(1, SVRLHelper.getAllFailedAssertionsAndSuccessfulReports(aSVRL).size());
}
Aggregations