(fix) tests

This commit is contained in:
Andreas Penski (init) 2020-04-29 13:55:12 +02:00
parent 7ca3ef90f3
commit 5b1d0cd467
12 changed files with 92 additions and 56 deletions

View file

@ -13,6 +13,8 @@ import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.api.ResolvingConfigurationStrategy;
import net.sf.saxon.s9api.Processor;
/**
* @author Andreas Penski
*/
@ -27,6 +29,18 @@ public abstract class BaseResolvingStrategy implements ResolvingConfigurationStr
private static final String ORACLE_XERCES_CLASS = "com.sun.org.apache.xerces.internal.impl.Constants";
private Processor processor;
@Override
public Processor getProcessor() {
if (this.processor == null) {
this.processor = createProcessor();
}
return this.processor;
}
protected abstract Processor createProcessor();
public static void forceOpenJdkXmlImplementation() {
if (!isOpenJdkXmlImplementationAvailable()) {
throw new IllegalStateException("No OpenJDK version of XERCES found");

View file

@ -9,8 +9,6 @@ import javax.xml.validation.Validator;
import lombok.extern.slf4j.Slf4j;
import net.sf.saxon.s9api.Processor;
/**
*
*
@ -30,11 +28,6 @@ public class StrictLocalResolvingStrategy extends StrictRelativeResolvingStrateg
return schemaFactory;
}
@Override
public Processor createProcessor() {
return super.createProcessor();
}
@Override
public URIResolver createResolver(final URI repository) {
// intentionally return 'null', since all resolving is configured with the other objects

View file

@ -77,7 +77,7 @@ public class StrictRelativeResolvingStrategy extends BaseResolvingStrategy {
}
@Override
public Processor createProcessor() {
protected Processor createProcessor() {
final Processor processor = new Processor(false);
// verhindere global im Prinzip alle resolving strategien
final SecureUriResolver resolver = new SecureUriResolver();