mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-26 01:05:38 +00:00
(fix) tests
This commit is contained in:
parent
7ca3ef90f3
commit
5b1d0cd467
12 changed files with 92 additions and 56 deletions
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue