create tests for resolvers

This commit is contained in:
Andreas Penski (init) 2020-05-04 16:27:55 +02:00
parent 7671977249
commit edb8427dec
11 changed files with 187 additions and 94 deletions

View file

@ -19,7 +19,6 @@
package de.kosit.validationtool.impl;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
@ -84,7 +83,6 @@ public class Helper {
return new ContentRepository(strategy, Simple.REPOSITORY_URI);
}
public static URI getSchemaLocation() {
return SCHEMA;
}
@ -99,6 +97,15 @@ public class Helper {
public static final URI SCENARIOS_ILLFORMED = ROOT.resolve("scenarios-illformed.xml");
}
public static class Resolving {
public static final URI ROOT = EXAMPLES_DIR.resolve("resolving/");
public static final URI SCHEMA_WITH_REMOTE_REFERENCE = ROOT.resolve("withRemote.xsd");
public static final URI SCHEMA_WITH_REFERENCE = ROOT.resolve("main.xsd");
}
public static final URI MODEL_ROOT = Paths.get("src/main/model").toUri();
public static final URI ASSERTION_SCHEMA = MODEL_ROOT.resolve("xsd/assertions.xsd");
@ -135,16 +142,6 @@ public class Helper {
return c.readXml(url.toURI(), type);
}
/**
* Lädt das default test repository mit Artefacten für Unit-Tests
*
* @return ein {@link ContentRepository}
*/
public static ContentRepository loadTestRepository() {
return new ContentRepository(ResolvingMode.STRICT_RELATIVE.getStrategy(),
new File("src/test/resources/examples/repository").toURI());
}
public static String serialize(final XdmNode node) {
try ( final StringWriter writer = new StringWriter() ) {
final Processor processor = Helper.getTestProcessor();