use of com.helger.schematron.svrl.jaxb.SchematronOutputType in project ph-schematron by phax.
the class Issue036Test method testBasic.
@Test
public void testBasic() throws Exception {
final SchematronResourcePure aResPure = SchematronResourcePure.fromFile("src/test/resources/issues/github36/test.sch");
aResPure.setErrorHandler(new LoggingPSErrorHandler());
final SchematronOutputType aSOT = aResPure.applySchematronValidationToSVRL(new FileSystemResource("src/test/resources/issues/github36/test.xml"));
assertNotNull(aSOT);
assertFalse(SVRLHelper.getAllFailedAssertions(aSOT).isEmpty());
}
use of com.helger.schematron.svrl.jaxb.SchematronOutputType in project ph-schematron by phax.
the class Issue054Test method validateAndProduceSVRL.
public static void validateAndProduceSVRL(@Nonnull final File aSchematron, final File aXML) throws Exception {
final ISchematronResource aSCH = SchematronResourcePure.fromFile(aSchematron);
// Perform validation
final SchematronOutputType aSVRL = aSCH.applySchematronValidationToSVRL(new FileSystemResource(aXML));
assertNotNull(aSVRL);
if (false)
System.out.println(new SVRLMarshaller().getAsString(aSVRL));
}
use of com.helger.schematron.svrl.jaxb.SchematronOutputType in project ph-schematron by phax.
the class Issue083Test method _validateAndProduceSVRL.
private static void _validateAndProduceSVRL(@Nonnull final File aSchematron, @Nonnull final File aXML) throws Exception {
final SchematronResourcePure aSCH = SchematronResourcePure.fromFile(aSchematron);
SchematronDebug.setSaveIntermediateXSLTFiles(true);
// 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);
// XXX should be 1 according to #83
assertEquals(0, SVRLHelper.getAllFailedAssertionsAndSuccessfulReports(aSVRL).size());
}
use of com.helger.schematron.svrl.jaxb.SchematronOutputType in project ph-schematron by phax.
the class Issue025Test method testIssue25Invalid.
@Test
public void testIssue25Invalid() throws Exception {
final IReadableResource aSCH = new ClassPathResource("test-sch/xfront/example05/check-classifications.sch");
final IReadableResource aXML = new ClassPathResource("test-sch/xfront/example05/invalid-document.xml");
final SchematronOutputType aSOT = new SchematronResourcePure(aSCH).applySchematronValidationToSVRL(aXML);
assertNotNull(aSOT);
assertTrue(SVRLHelper.getAllFailedAssertions(aSOT).isNotEmpty());
}
use of com.helger.schematron.svrl.jaxb.SchematronOutputType in project ph-schematron by phax.
the class Issue025Test method testIssue25Valid.
@Test
public void testIssue25Valid() throws Exception {
final IReadableResource aSCH = new ClassPathResource("test-sch/xfront/example05/check-classifications.sch");
final IReadableResource aXML = new ClassPathResource("test-sch/xfront/example05/valid-document.xml");
final SchematronOutputType aSOT = new SchematronResourcePure(aSCH).applySchematronValidationToSVRL(aXML);
assertNotNull(aSOT);
assertTrue(SVRLHelper.getAllFailedAssertions(aSOT).isEmpty());
}
Aggregations