From efd4fd5fff1a919b8c16aa5e705498ac54a4b21c Mon Sep 17 00:00:00 2001 From: Andreas Penski Date: Wed, 18 Dec 2019 15:57:44 +0100 Subject: [PATCH] #39 The supplied Input unnecessarily is not written into memory --- .idea/encodings.xml | 5 +- CHANGELOG.md | 7 + pom.xml | 10 +- .../de/kosit/validationtool/api/Input.java | 42 +- .../validationtool/api/InputFactory.java | 80 +- .../cmd/CommandLineApplication.java | 1 + .../de/kosit/validationtool/cmd/Daemon.java | 68 +- .../validationtool/impl/DefaultCheck.java | 2 +- .../impl/input/AbstractInput.java | 57 + .../impl/input/ByteArrayInput.java | 39 + .../impl/input/LazyReadInput.java | 36 + .../impl/input/ResourceInput.java | 43 + .../impl/input/SourceInput.java | 108 + .../impl/input/StreamHelper.java | 95 + .../impl/tasks/DocumentParseAction.java | 8 +- .../impl/tasks/SchemaValidationAction.java | 154 +- .../validationtool/api/InputFactoryTest.java | 93 +- .../cmd/CommandlineApplicationTest.java | 109 +- .../de/kosit/validationtool/cmd/DaemonIT.java | 11 +- .../impl/ContentRepositoryTest.java | 14 +- .../impl/ConversionServiceTest.java | 30 +- .../validationtool/impl/DefaultCheckTest.java | 30 +- .../impl/DocumentParserTest.java | 21 +- .../de/kosit/validationtool/impl/Helper.java | 30 +- .../impl/RelativeUriResolverTest.java | 4 +- .../impl/SaxonSecurityTest.java | 19 +- .../impl/ScenarioRepositoryTest.java | 18 +- .../impl/SchemaValidatorActionTest.java | 113 - .../impl/SimpleScenarioCheck.java | 2 +- .../impl/tasks/SchemaValidatorActionTest.java | 174 + ...LReady_EU_UBL-NL_20170102_FULL-invalid.xml | 301 - .../UBLReady_EU_UBL-NL_20170102_FULL.xml | 302 - .../scenarios-illforned.xml} | 42 +- .../scenarios-1.xml => invalid/scenarios.xml} | 22 +- .../common/CCTS_CCT_SchemaModule-2.1.xsd | 769 --- .../UBL-CommonAggregateComponents-2.1.xsd | 4166 ------------- .../common/UBL-CommonBasicComponents-2.1.xsd | 5394 ----------------- .../UBL-CommonExtensionComponents-2.1.xsd | 235 - .../UBL-CommonSignatureComponents-2.1.xsd | 81 - .../UBL-CoreComponentParameters-2.1.xsd | 73 - .../UBL-ExtensionContentDataType-2.1.xsd | 99 - .../common/UBL-QualifiedDataTypes-2.1.xsd | 78 - .../UBL-SignatureAggregateComponents-2.1.xsd | 102 - .../UBL-SignatureBasicComponents-2.1.xsd | 83 - .../common/UBL-UnqualifiedDataTypes-2.1.xsd | 554 -- .../xsdrt/common/UBL-XAdESv132-2.1.xsd | 499 -- .../xsdrt/common/UBL-XAdESv141-2.1.xsd | 46 - .../common/UBL-xmldsig-core-schema-2.1.xsd | 332 - .../xsdrt/maindoc/UBL-CreditNote-2.1.xsd | 153 - .../UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd | 156 - .../UBL-2.1/xsl/BIIRULES-UBL-T10.xsl | 1383 ----- .../UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl | 1243 ---- .../resources/eRechnung/default-report.xsl | 756 --- .../repository/resources/eRechnung/report.xsl | 607 -- .../examples/simple/input/simple.xml | 10 + .../examples/simple/repository/simple.xsd | 6 +- .../resources/invalid/scenarios-illformed.xml | 90 - .../resources/invalid/scenarios-invalid.xml | 87 - .../resources/{simple => loading}/main.xsd | 0 .../resources/loading/resources/reference.xsd | 9 + .../resources/simple/resources/reference.xsd | 9 - src/test/resources/valid/report.xml | 101 - src/test/resources/valid/scenarios.xml | 96 - 63 files changed, 1111 insertions(+), 18196 deletions(-) create mode 100644 src/main/java/de/kosit/validationtool/impl/input/AbstractInput.java create mode 100644 src/main/java/de/kosit/validationtool/impl/input/ByteArrayInput.java create mode 100644 src/main/java/de/kosit/validationtool/impl/input/LazyReadInput.java create mode 100644 src/main/java/de/kosit/validationtool/impl/input/ResourceInput.java create mode 100644 src/main/java/de/kosit/validationtool/impl/input/SourceInput.java create mode 100644 src/main/java/de/kosit/validationtool/impl/input/StreamHelper.java delete mode 100644 src/test/java/de/kosit/validationtool/impl/SchemaValidatorActionTest.java create mode 100644 src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java delete mode 100644 src/test/resources/examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL-invalid.xml delete mode 100644 src/test/resources/examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL.xml rename src/test/resources/examples/{UBLReady/scenarios-2.xml => invalid/scenarios-illforned.xml} (52%) rename src/test/resources/examples/{UBLReady/scenarios-1.xml => invalid/scenarios.xml} (64%) delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/CCTS_CCT_SchemaModule-2.1.xsd delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonAggregateComponents-2.1.xsd delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonBasicComponents-2.1.xsd delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonExtensionComponents-2.1.xsd delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonSignatureComponents-2.1.xsd delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CoreComponentParameters-2.1.xsd delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-ExtensionContentDataType-2.1.xsd delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-QualifiedDataTypes-2.1.xsd delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureAggregateComponents-2.1.xsd delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureBasicComponents-2.1.xsd delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-UnqualifiedDataTypes-2.1.xsd delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv132-2.1.xsd delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv141-2.1.xsd delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-xmldsig-core-schema-2.1.xsd delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-CreditNote-2.1.xsd delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/default-report.xsl delete mode 100644 src/test/resources/examples/repository/resources/eRechnung/report.xsl delete mode 100644 src/test/resources/invalid/scenarios-illformed.xml delete mode 100644 src/test/resources/invalid/scenarios-invalid.xml rename src/test/resources/{simple => loading}/main.xsd (100%) create mode 100644 src/test/resources/loading/resources/reference.xsd delete mode 100644 src/test/resources/simple/resources/reference.xsd delete mode 100644 src/test/resources/valid/report.xml delete mode 100644 src/test/resources/valid/scenarios.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml index 67472d0..63fc954 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -1,7 +1,10 @@ - + + + + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index be7786c..6ab697c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Upcoming version +#Added +- Support java.xml.transform.Source/java.xml.transform.StreamSource as Input + + +#Changed +- Inputs are NOT read into memory (e.g. Byte-Array) prior processing within the validtor. This reduces memory consumption. + ## 1.1.1 ### Added - Convenience method for accessing information about well-formedness in Result diff --git a/pom.xml b/pom.xml index 008e63a..70c7b3d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ KoSIT XML Prüftool Implementierung de.kosit - 1.1.2-SNAPSHOT + 1.2.0-SNAPSHOT validationtool KoSIT XML Validator against XSD and Schematron based on defined scenarios. @@ -116,8 +116,7 @@ commons-io commons-io - 1.3.2 - test + 2.6 io.rest-assured @@ -129,6 +128,7 @@ de.kosit.validationtool packaged-test-scenarios 1.0.0 + test @@ -406,9 +406,9 @@ de.kosit.validationtool.cmd.CommandLineApplication -s - ${project.build.testOutputDirectory}/examples/UBLReady/scenarios-2.xml + ${project.build.testOutputDirectory}/examples/simple/scenarios.xml -r - ${project.build.testOutputDirectory}/examples/repository + ${project.build.testOutputDirectory}/examples/simple/repository -D diff --git a/src/main/java/de/kosit/validationtool/api/Input.java b/src/main/java/de/kosit/validationtool/api/Input.java index 69f9c22..ca27ebf 100644 --- a/src/main/java/de/kosit/validationtool/api/Input.java +++ b/src/main/java/de/kosit/validationtool/api/Input.java @@ -19,24 +19,46 @@ package de.kosit.validationtool.api; -import lombok.*; +import java.io.IOException; +import java.io.InputStream; + +import javax.xml.transform.Source; /** - * Eine Datei in eingelesener Form. + * An input for the validator. * * @author apenski */ -@Getter -@RequiredArgsConstructor (access = AccessLevel.PACKAGE) -@AllArgsConstructor (access = AccessLevel.PACKAGE) -public class Input { - private final byte[] content; +public interface Input { - private final String name; + /** + * The name of the input for document identification + * + * @return the name + */ + String getName(); - private byte[] hashCode; + /** + * The hashcode for document identification + * + * @return the computed hashcode + */ + byte[] getHashCode(); - private String digestAlgorithm; + /** + * The digest algorithm used for computing the {@link #getHashCode()} + * + * @return the name of the digest algorith + */ + String getDigestAlgorithm(); + + /** + * Opens a new {@link InputStream } for this input which carries the actual data + * + * @return an open {@link InputStream} + * @throws IOException on I/O while opening the stream + */ + Source getSource() throws IOException; } diff --git a/src/main/java/de/kosit/validationtool/api/InputFactory.java b/src/main/java/de/kosit/validationtool/api/InputFactory.java index 5e93fd3..cac5983 100644 --- a/src/main/java/de/kosit/validationtool/api/InputFactory.java +++ b/src/main/java/de/kosit/validationtool/api/InputFactory.java @@ -22,7 +22,6 @@ package de.kosit.validationtool.api; import static org.apache.commons.lang3.StringUtils.isNotEmpty; import java.io.BufferedInputStream; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; @@ -30,6 +29,7 @@ import java.io.InputStream; import java.net.MalformedURLException; import java.net.URI; import java.net.URL; +import java.net.URLConnection; import java.nio.file.Files; import java.nio.file.Path; import java.security.DigestInputStream; @@ -37,12 +37,19 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import javax.xml.bind.DatatypeConverter; +import javax.xml.transform.Source; +import javax.xml.transform.stream.StreamSource; import org.apache.commons.lang3.StringUtils; import lombok.Getter; import lombok.extern.slf4j.Slf4j; +import de.kosit.validationtool.impl.input.ByteArrayInput; +import de.kosit.validationtool.impl.input.ResourceInput; +import de.kosit.validationtool.impl.input.SourceInput; +import de.kosit.validationtool.impl.input.StreamHelper; + /** * Service zum Einlesen des Test-Objekts in den Speicher. Beim Einlesen wird gleichzeitig eine Prüfsumme ermittelt und * mit dem Ergebnis mitgeführt. @@ -69,7 +76,8 @@ public class InputFactory { InputFactory(final String specifiedAlgorithm) { this.algorithm = isNotEmpty(specifiedAlgorithm) ? specifiedAlgorithm : DEFAULT_ALGORITH; - createDigest(); + // check validity + StreamHelper.createDigest(this.algorithm); } /** @@ -140,11 +148,48 @@ public class InputFactory { */ public static Input read(final URL url, final String digestAlgorithm) { checkNull(url); + checkNotEmpty(url.getFile()); try { - return read(url.openStream(), url.getFile(), digestAlgorithm); - } catch (final IOException e) { + final URLConnection urlConnection = url.openConnection(); + urlConnection.connect(); + } catch (IOException e) { throw new IllegalArgumentException(MESSAGE_OPEN_STREAM_ERROR + url, e); } + return new ResourceInput(url, url.getFile(), digestAlgorithm); + + } + + /** + * Reads a test document from a {@link Source}. + * + * @param source source + * @return an {@link Input} + */ + public static Input read(final StreamSource source) { + return read(source, DEFAULT_ALGORITH); + } + + /** + * Reads a test document from a {@link Source} using a specified digest algorithm. + * + * @param source source + * @param digestAlgorithm the digest algorithm + * @return an {@link Input} + */ + public static Input read(final StreamSource source, final String digestAlgorithm) { + return read(source, digestAlgorithm, null); + } + + /** + * Reads a test document from a {@link Source} using a specified digest algorithm. + * + * @param source source + * @param digestAlgorithm the digest algorithm + * @return an {@link Input} + */ + public static Input read(final Source source, final String digestAlgorithm, final byte[] hashcode) { + checkNull(source); + return new SourceInput(source, source.getSystemId(), digestAlgorithm, hashcode); } /** @@ -162,6 +207,7 @@ public class InputFactory { } catch (final IOException e) { throw new IllegalArgumentException(MESSAGE_OPEN_STREAM_ERROR + file, e); } + } /** @@ -186,7 +232,14 @@ public class InputFactory { */ public static Input read(final byte[] input, final String name, final String digestAlgorithm) { checkNull(input); - return read(new ByteArrayInputStream(input), name, digestAlgorithm); + checkNotEmpty(name); + return new ByteArrayInput(input, name, digestAlgorithm); + } + + private static void checkNotEmpty(final String name) { + if (StringUtils.isBlank(name)) { + throw new IllegalArgumentException("Input name can not be null"); + } } private static void checkNull(final Object input) { @@ -221,7 +274,7 @@ public class InputFactory { private Input readStream(final InputStream inputStream, final String name) { if (StringUtils.isNotBlank(name)) { log.debug("Generating hashcode for {} using {} algorithm", name, getAlgorithm()); - final MessageDigest digest = createDigest(); + final MessageDigest digest = StreamHelper.createDigest(getAlgorithm()); final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; try ( final BufferedInputStream bis = new BufferedInputStream(inputStream); final DigestInputStream dis = new DigestInputStream(bis, digest); @@ -236,7 +289,9 @@ public class InputFactory { final byte[] hash = digest.digest(); log.debug("Generated hashcode for {} is {}", name, DatatypeConverter.printHexBinary(hash)); out.flush(); - return new Input(out.toByteArray(), name, hash, digest.getAlgorithm()); + final ByteArrayInput input = new ByteArrayInput(out.toByteArray(), name, digest.getAlgorithm()); + input.setHashCode(hash); + return input; } catch (final IOException e) { throw new IllegalArgumentException(MESSAGE_OPEN_STREAM_ERROR + name, e); } @@ -245,15 +300,4 @@ public class InputFactory { } } - private MessageDigest createDigest() { - try { - final MessageDigest digest; - digest = MessageDigest.getInstance(getAlgorithm()); - return digest; - } catch (final NoSuchAlgorithmException e) { - // should not happen - throw new IllegalStateException(String.format("Specified method %s is not available", getAlgorithm()), e); - } - } - } diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java index a7224d7..21527f9 100644 --- a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java +++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java @@ -240,6 +240,7 @@ public class CommandLineApplication { return result ? 0 : 1; } catch (final Exception e) { + e.printStackTrace(); if (cmd.hasOption(DEBUG.getOpt())) { log.error(e.getMessage(), e); } else { diff --git a/src/main/java/de/kosit/validationtool/cmd/Daemon.java b/src/main/java/de/kosit/validationtool/cmd/Daemon.java index 0bfaf87..a3ffe6a 100644 --- a/src/main/java/de/kosit/validationtool/cmd/Daemon.java +++ b/src/main/java/de/kosit/validationtool/cmd/Daemon.java @@ -27,10 +27,10 @@ import lombok.extern.slf4j.Slf4j; import de.kosit.validationtool.api.Check; import de.kosit.validationtool.api.CheckConfiguration; -import de.kosit.validationtool.api.Input; import de.kosit.validationtool.api.InputFactory; import de.kosit.validationtool.impl.DefaultCheck; import de.kosit.validationtool.impl.ObjectFactory; +import de.kosit.validationtool.impl.input.ByteArrayInput; import de.kosit.validationtool.model.scenarios.Scenarios; /** @@ -55,7 +55,7 @@ class Daemon { private final Check implemenation; - HttpServerHandler(Check check) { + HttpServerHandler(final Check check) { this.implemenation = check; } @@ -66,24 +66,25 @@ class Daemon { * soll. */ @Override - public void handle(HttpExchange httpExchange) throws IOException { + public void handle(final HttpExchange httpExchange) throws IOException { try { log.debug("Incoming request"); - String requestMethod = httpExchange.getRequestMethod(); + final String requestMethod = httpExchange.getRequestMethod(); if (requestMethod.equals("POST")) { - InputStream inputStream = httpExchange.getRequestBody(); - Input serverInput = InputFactory.read(inputStream, "Prüfling" + counter.incrementAndGet()); + final InputStream inputStream = httpExchange.getRequestBody(); + final ByteArrayInput serverInput = (ByteArrayInput) InputFactory.read(inputStream, + "Prüfling" + counter.incrementAndGet()); - int contentLength = serverInput.getContent().length; - if (contentLength != 0) { - writeOutputstreamArray(httpExchange, implemenation.check(serverInput)); + if (serverInput.getLength() > 0) { + writeOutputstreamArray(httpExchange, this.implemenation.check(serverInput)); } else { writeError(httpExchange, 400, "XML-Inhalt erforderlich!"); } + } else { writeError(httpExchange, 405, "Es ist nur die POST-Methode erlaubt!"); } - } catch (Exception e) { + } catch (final Exception e) { writeError(httpExchange, 500, "Interner Fehler bei der Verarbeitung des Requests: " + e.getMessage()); log.error("Es ist ein Fehler aufgetreten. Das Dokument kann nicht geprüft werden", e); } @@ -100,17 +101,17 @@ class Daemon { private final Scenarios scenarios; - HealthHandler(Scenarios scenarios) { + HealthHandler(final Scenarios scenarios) { this.scenarios = scenarios; } @Override - public void handle(HttpExchange httpExchange) throws IOException { - Health health = new Health(scenarios); - Document doc = health.writeHealthXml(); + public void handle(final HttpExchange httpExchange) throws IOException { + final Health health = new Health(this.scenarios); + final Document doc = health.writeHealthXml(); try { writeOutputstreamArray(httpExchange, doc); - } catch (TransformerException e) { + } catch (final TransformerException e) { writeError(httpExchange, 500, e.getMessage()); log.error("Fehler beim Erzeugen der Status-Information", e); } @@ -134,9 +135,9 @@ class Daemon { * @param rCode der Code-Status * @param response die String antwort, die ich anzeigen möchte */ - private static void writeError(HttpExchange httpExchange, int rCode, String response) throws IOException { + private static void writeError(final HttpExchange httpExchange, final int rCode, final String response) throws IOException { httpExchange.sendResponseHeaders(rCode, response.length()); - OutputStream os = httpExchange.getResponseBody(); + final OutputStream os = httpExchange.getResponseBody(); os.write(response.getBytes()); os.close(); } @@ -147,9 +148,10 @@ class Daemon { * @param httpExchange um den Antwort Body zu erhalten * @param doc der Report */ - private static void writeOutputstreamArray(HttpExchange httpExchange, Document doc) throws IOException, TransformerException { + private static void writeOutputstreamArray(final HttpExchange httpExchange, final Document doc) + throws IOException, TransformerException { final byte[] bytes = serialize(doc); - OutputStream os = httpExchange.getResponseBody(); + final OutputStream os = httpExchange.getResponseBody(); httpExchange.getResponseHeaders().add("Content-Type", "application/xml"); httpExchange.sendResponseHeaders(200, bytes.length); os.write(bytes); @@ -162,15 +164,15 @@ class Daemon { * * @param report Vom Typ Dokument, aka Report . */ - private static byte[] serialize(Document report) throws TransformerException { + private static byte[] serialize(final Document report) throws TransformerException { - try ( ByteArrayOutputStream bArrayOS = new ByteArrayOutputStream() ) { - DOMSource source = new DOMSource(report); - StreamResult streamResult = new StreamResult(bArrayOS); - Transformer transformer = ObjectFactory.createTransformer(true); + try ( final ByteArrayOutputStream bArrayOS = new ByteArrayOutputStream() ) { + final DOMSource source = new DOMSource(report); + final StreamResult streamResult = new StreamResult(bArrayOS); + final Transformer transformer = ObjectFactory.createTransformer(true); transformer.transform(source, streamResult); return bArrayOS.toByteArray(); - } catch (IOException e) { + } catch (final IOException e) { log.error("Report {}", e.getMessage(), e); throw new IllegalStateException(e); } @@ -180,19 +182,19 @@ class Daemon { * Methode zum Starten des Servers */ void startServer() { - CheckConfiguration config = new CheckConfiguration(scenarioDefinition); - config.setScenarioRepository(repository); + final CheckConfiguration config = new CheckConfiguration(this.scenarioDefinition); + config.setScenarioRepository(this.repository); HttpServer server = null; try { - server = HttpServer.create(new InetSocketAddress(hostName, port), 0); - DefaultCheck check = new DefaultCheck(config); + server = HttpServer.create(new InetSocketAddress(this.hostName, this.port), 0); + final DefaultCheck check = new DefaultCheck(config); server.createContext("/", new HttpServerHandler(check)); server.createContext("/health", new HealthHandler(check.getRepository().getScenarios())); - server.setExecutor(Executors.newFixedThreadPool(threadCount)); + server.setExecutor(Executors.newFixedThreadPool(this.threadCount)); server.start(); - log.info("Server unter Port {} ist erfolgreich gestartet", port); - } catch (IOException e) { - log.error("Fehler beim HttpServer erstellen!", e.getMessage(), e); + log.info("Server unter Port {} ist erfolgreich gestartet", this.port); + } catch (final IOException e) { + log.error("Fehler beim HttpServer erstellen: {}", e.getMessage(), e); } } } diff --git a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java index 8610347..257a765 100644 --- a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java +++ b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java @@ -81,8 +81,8 @@ public class DefaultCheck implements Check { this.repository = new ScenarioRepository(this.contentRepository); this.repository.initialize(configuration); this.checkSteps = new ArrayList<>(); - this.checkSteps.add(new CreateDocumentIdentificationAction()); this.checkSteps.add(new DocumentParseAction()); + this.checkSteps.add(new CreateDocumentIdentificationAction()); this.checkSteps.add(new ScenarioSelectionAction(this.repository)); this.checkSteps.add(new SchemaValidationAction()); this.checkSteps.add(new SchematronValidationAction(this.contentRepository, this.conversionService)); diff --git a/src/main/java/de/kosit/validationtool/impl/input/AbstractInput.java b/src/main/java/de/kosit/validationtool/impl/input/AbstractInput.java new file mode 100644 index 0000000..e4e4a8f --- /dev/null +++ b/src/main/java/de/kosit/validationtool/impl/input/AbstractInput.java @@ -0,0 +1,57 @@ +package de.kosit.validationtool.impl.input; + +import java.io.InputStream; + +import lombok.Getter; +import lombok.Setter; +import lombok.extern.slf4j.Slf4j; + +import de.kosit.validationtool.api.Input; + +/** + * Base class for all {@link Input Inputs}. + * + * @author Andreas Penski + */ +@Slf4j +public abstract class AbstractInput implements Input, LazyReadInput { + + private byte[] hashCode; + + @Getter + @Setter + private long length; + + @Override + public byte[] getHashCode() { + if (this.hashCode == null) { + throw new IllegalStateException("Hashcode is not computed yet"); + } + return this.hashCode; + } + + protected InputStream wrap(final InputStream stream) { + InputStream result = stream; + if (!isHashcodeComputed()) { + result = StreamHelper.wrapDigesting(this, result, getDigestAlgorithm()); + } + if (getLength() == 0) { + result = StreamHelper.wrapCount(this, result); + } + return result; + } + + @Override + public boolean isHashcodeComputed() { + return this.hashCode != null; + } + + @Override + public void setHashCode(final byte[] digest) { + this.hashCode = digest; + } + + public boolean supportsMultipleReads() { + return true; + } +} diff --git a/src/main/java/de/kosit/validationtool/impl/input/ByteArrayInput.java b/src/main/java/de/kosit/validationtool/impl/input/ByteArrayInput.java new file mode 100644 index 0000000..5dfa630 --- /dev/null +++ b/src/main/java/de/kosit/validationtool/impl/input/ByteArrayInput.java @@ -0,0 +1,39 @@ +package de.kosit.validationtool.impl.input; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; + +import javax.xml.transform.Source; +import javax.xml.transform.stream.StreamSource; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * Classical in-memory {@link de.kosit.validationtool.api.Input}. It is not memory efficient to read the whole file into + * memory prio validating. Consider using the {@link ResourceInput}. + * + * @author Andreas Penski + */ +@Getter +@AllArgsConstructor +public class ByteArrayInput extends AbstractInput { + + private final byte[] content; + + private final String name; + + private final String digestAlgorithm; + + @Override + public long getLength() { + return this.content != null ? this.content.length : 0; + } + + @Override + public Source getSource() { + final InputStream stream = wrap(new ByteArrayInputStream(this.content)); + return new StreamSource(stream, getName()); + } + +} diff --git a/src/main/java/de/kosit/validationtool/impl/input/LazyReadInput.java b/src/main/java/de/kosit/validationtool/impl/input/LazyReadInput.java new file mode 100644 index 0000000..31918aa --- /dev/null +++ b/src/main/java/de/kosit/validationtool/impl/input/LazyReadInput.java @@ -0,0 +1,36 @@ +package de.kosit.validationtool.impl.input; + +import java.io.InputStream; + +import de.kosit.validationtool.api.Input; + +/** + * Internal interface used for lazy generation of the hashcode for document identification. + * + * @see StreamHelper#wrapDigesting(LazyReadInput, InputStream, String) for details + * @author Andreas Penski + */ +interface LazyReadInput { + + /** + * Sets a hashcode + * + * @param digest the digest + */ + void setHashCode(byte[] digest); + + /** + * Determines whether a hashcode has been computed yet + * + * @return true when computed + */ + boolean isHashcodeComputed(); + + /** + * Setting the length of the {@link Input}. + * + * @param length the length + */ + void setLength(long length); + +} diff --git a/src/main/java/de/kosit/validationtool/impl/input/ResourceInput.java b/src/main/java/de/kosit/validationtool/impl/input/ResourceInput.java new file mode 100644 index 0000000..107677b --- /dev/null +++ b/src/main/java/de/kosit/validationtool/impl/input/ResourceInput.java @@ -0,0 +1,43 @@ +package de.kosit.validationtool.impl.input; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; + +import javax.xml.transform.Source; +import javax.xml.transform.stream.StreamSource; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +import de.kosit.validationtool.api.Input; + +/** + * An {@link Input} carries an {@link URL} which can be used for all 'locatable' inputs such as {@link File}, + * {@link java.nio.file.Path} and any other {@link URL}. + * + * This stream is NOT read into memory. So this implementation has good in memory efficieny. The validation process MAY + * read the stream more than once. Make sure, that the {@link URL} points to fast I/O devices + * + * @author Andreas Penski + */ +@Getter +@RequiredArgsConstructor +public class ResourceInput extends AbstractInput { + + private final URL url; + + private final String name; + + private final String digestAlgorithm; + + @Override + public Source getSource() throws IOException { + InputStream stream = this.url.openStream(); + if (!isHashcodeComputed()) { + stream = StreamHelper.wrapDigesting(this, stream, getDigestAlgorithm()); + } + return new StreamSource(stream, this.name); + } +} diff --git a/src/main/java/de/kosit/validationtool/impl/input/SourceInput.java b/src/main/java/de/kosit/validationtool/impl/input/SourceInput.java new file mode 100644 index 0000000..ba27f90 --- /dev/null +++ b/src/main/java/de/kosit/validationtool/impl/input/SourceInput.java @@ -0,0 +1,108 @@ +package de.kosit.validationtool.impl.input; + +import java.io.IOException; +import java.nio.charset.Charset; + +import javax.xml.transform.Source; +import javax.xml.transform.stream.StreamSource; + +import org.apache.commons.io.input.ReaderInputStream; +import org.apache.commons.lang3.NotImplementedException; + +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; + +/** + * A validator {@link de.kosit.validationtool.api.Input} based an on a {@link Source}. + * + * @author Andreas Penski + */ +@Getter +@Slf4j +public class SourceInput extends AbstractInput { + + private final Source source; + + private final String name; + + private final String digestAlgorithm; + + public SourceInput(final StreamSource source, final String name, final String digestAlgorithm) { + this(source, name, digestAlgorithm, null); + } + + public SourceInput(final Source source, final String name, final String digestAlgorithm, final byte[] hashCode) { + this.source = source; + this.name = name; + this.digestAlgorithm = digestAlgorithm; + setHashCode(hashCode); + validate(); + } + + private void validate() { + if (!isSupported()) { + throw new IllegalStateException("Unsupported source. Only StreamSource supported yet"); + } + if (((StreamSource) this.source).getInputStream() == null && !isHashcodeComputed()) { + log.warn("No hashcode supplied, will wrap the reader using system default charset"); + } + } + + @Override + public Source getSource() throws IOException { + if (!isSupported()) { + throw new IllegalStateException("Unsupported source. Only InputStream-based StreamSource supported yet"); + } + if (isWrappingRequired()) { + return wrap(); + } + if (isConsumed()) { + throw new IllegalStateException("A StreamSource can only read once"); + } + return this.source; + } + + private boolean isSupported() { + return isStreamSource(); + } + + private boolean isConsumed() throws IOException { + if (!isStreamSource()) { + throw new NotImplementedException("Supports only StreamSource yet"); + } + final StreamSource ss = (StreamSource) this.source; + try { + return (ss.getInputStream() != null && ss.getInputStream().available() == 0) + || (ss.getReader() != null && !ss.getReader().ready()); + } catch (final IOException e) { + return true; + } + } + + private boolean isStreamSource() { + return this.source instanceof StreamSource; + } + + private Source wrap() { + Source result = this.source; + if (isStreamSource()) { + final StreamSource ss = (StreamSource) this.source; + if (ss.getInputStream() != null) { + result = new StreamSource(wrap(ss.getInputStream()), this.source.getSystemId()); + } else if (ss.getReader() != null) { + result = new StreamSource(wrap(new ReaderInputStream(ss.getReader(), Charset.defaultCharset())), this.source.getSystemId()); + } + } + return result; + } + + private boolean isWrappingRequired() { + return !isHashcodeComputed(); + } + + @Override + public boolean supportsMultipleReads() { + return false; + } + +} diff --git a/src/main/java/de/kosit/validationtool/impl/input/StreamHelper.java b/src/main/java/de/kosit/validationtool/impl/input/StreamHelper.java new file mode 100644 index 0000000..d364384 --- /dev/null +++ b/src/main/java/de/kosit/validationtool/impl/input/StreamHelper.java @@ -0,0 +1,95 @@ +package de.kosit.validationtool.impl.input; + +import java.io.FilterInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.security.DigestInputStream; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +import org.apache.commons.io.input.CountingInputStream; + +/** + * Helper for stream handling. + * + * @author Andreas Penski + */ +public class StreamHelper { + + /** + * Helper class, which generates the hashcode while reading the stream e.g. for parsing the document. This allows + * generating the hashcode without an aditional reading step. + */ + private static class DigestingInputStream extends FilterInputStream { + + private final MessageDigest digest; + + private final LazyReadInput reference; + + DigestingInputStream(final LazyReadInput input, final InputStream in, final MessageDigest digest) { + super(new DigestInputStream(in, digest)); + this.digest = digest; + this.reference = input; + } + + @Override + public void close() throws IOException { + super.close(); + this.reference.setHashCode(this.digest.digest()); + } + + } + + private static class CountInputStream extends FilterInputStream { + + private final LazyReadInput reference; + + public CountInputStream(final LazyReadInput input, final InputStream stream) { + super(new org.apache.commons.io.input.CountingInputStream(stream)); + this.reference = input; + } + + @Override + public void close() throws IOException { + super.close(); + this.reference.setLength(((CountingInputStream) this.in).getByteCount()); + } + } + + private StreamHelper() { + // hide + } + + public static MessageDigest createDigest(final String algorithm) { + try { + final MessageDigest digest; + digest = MessageDigest.getInstance(algorithm); + return digest; + } catch (final NoSuchAlgorithmException e) { + // should not happen + throw new IllegalArgumentException(String.format("Specified method %s is not available", algorithm), e); + } + } + + /** + * Wraps the {@link InputStream} with a counting length implementation. + * + * @param input the {@link LazyReadInput input} + * @param stream the stream + * @return a wrapped stream + */ + public static InputStream wrapCount(final LazyReadInput input, final InputStream stream) { + return new CountInputStream(input, stream); + } + + /** + * Wraps the {@link InputStream} with an implementation the generates a hash sum over the stream data. + * + * @param input the {@link LazyReadInput input} + * @param stream the stream + * @return a wrapped stream + */ + public static InputStream wrapDigesting(final LazyReadInput input, final InputStream stream, final String digestAlgorithm) { + return new DigestingInputStream(input, stream, createDigest(digestAlgorithm)); + } +} diff --git a/src/main/java/de/kosit/validationtool/impl/tasks/DocumentParseAction.java b/src/main/java/de/kosit/validationtool/impl/tasks/DocumentParseAction.java index 55a86b3..0a166f5 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/DocumentParseAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/DocumentParseAction.java @@ -19,14 +19,10 @@ package de.kosit.validationtool.impl.tasks; -import java.io.ByteArrayInputStream; import java.io.IOException; -import java.io.InputStream; import java.util.Collections; import java.util.stream.Collectors; -import javax.xml.transform.stream.StreamSource; - import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -63,10 +59,10 @@ public class DocumentParseAction implements CheckAction { throw new IllegalArgumentException("Input may not be null"); } Result result; - try ( final InputStream input = new ByteArrayInputStream(content.getContent()) ) { + try { final DocumentBuilder builder = ObjectFactory.createProcessor().newDocumentBuilder(); builder.setLineNumbering(true); - final XdmNode doc = builder.build(new StreamSource(input)); + final XdmNode doc = builder.build(content.getSource()); result = new Result<>(doc, Collections.emptyList()); } catch (final SaxonApiException | IOException e) { log.debug("Exception while parsing {}", content.getName(), e); diff --git a/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java b/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java index f43afbd..fc4843e 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java @@ -20,67 +20,201 @@ package de.kosit.validationtool.impl.tasks; import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.Validator; +import org.apache.commons.io.FileUtils; import org.xml.sax.SAXException; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.Setter; import lombok.extern.slf4j.Slf4j; +import de.kosit.validationtool.api.Input; import de.kosit.validationtool.impl.CollectingErrorEventHandler; import de.kosit.validationtool.impl.ObjectFactory; +import de.kosit.validationtool.impl.input.AbstractInput; import de.kosit.validationtool.impl.model.Result; import de.kosit.validationtool.model.reportInput.CreateReportInput; import de.kosit.validationtool.model.reportInput.ValidationResultsXmlSchema; import de.kosit.validationtool.model.reportInput.XMLSyntaxError; import de.kosit.validationtool.model.scenarios.ScenarioType; +import net.sf.saxon.s9api.SaxonApiException; +import net.sf.saxon.s9api.Serializer; +import net.sf.saxon.s9api.XdmNode; + /** - * Schema-Validierung der Eingabe-Datei mittels Schema-Definition aus dem identifizierten Szenario. + * Schema valiation of the {@link Input} with the schema of the supplied scenario. This implementation is based on JDK + * functionality and therefore needs a {@link Source} to do the actual validation. Since we base the validator on Saxon + * HE functionality, we have no support for schema in Saxon (e.g. the in memory version of the document is not + * schema-aware) and need to re-read the actual source. + * + * Since the actual {@link Input} implementation may not be read twice, we must serialize the previously read document. + * This implementation tries to do the validation in an efficient manner. If possible the source is read a second time + * to validate. If not, the source is serialized to the heap upon re-read/validaiton up to a configurable file size. The + * document is serialized to a temporary file otherwise. * * @author Andreas Penski */ @Slf4j public class SchemaValidationAction implements CheckAction { - private Result validate(byte[] document, ScenarioType scenarioType) { + private static class ByteArraySerializedDocument implements SerializedDocument { + + private byte[] bytes; + + @Override + public void serialize(final XdmNode node) throws SaxonApiException, IOException { + try ( final ByteArrayOutputStream out = new ByteArrayOutputStream() ) { + final Serializer serializer = ObjectFactory.createProcessor().newSerializer(); + serializer.setOutputStream(out); + serializer.serializeNode(node); + serializer.close(); + this.bytes = out.toByteArray(); + } + } + + @Override + public void close() { + // nothing do do + } + + @Override + public InputStream openStream() { + return new ByteArrayInputStream(this.bytes); + } + } + + private static class FileSerializedDocument implements SerializedDocument { + + private final Path file; + + FileSerializedDocument() throws IOException { + this.file = Files.createTempFile("validator", ".xml"); + } + + @Override + public void serialize(final XdmNode node) throws SaxonApiException, IOException { + try ( final OutputStream out = Files.newOutputStream(this.file) ) { + final Serializer serializer = ObjectFactory.createProcessor().newSerializer(); + serializer.setOutputStream(out); + serializer.serializeNode(node); + serializer.close(); + } + } + + @Override + public void close() throws IOException { + Files.deleteIfExists(this.file); + } + + @Override + public InputStream openStream() throws IOException { + return Files.newInputStream(this.file); + } + } + + private static final Long BA_LIMIT = 10L; + + private static final String LIMIT_PARAMETER = "schema.validation.inmem.limit"; + + @Setter(AccessLevel.PACKAGE) + @Getter + private long inMemoryLimit = Long.parseLong(System.getProperty(LIMIT_PARAMETER, BA_LIMIT.toString())) * FileUtils.ONE_MB; + + private Result validate(final Bag results, final ScenarioType scenarioType) { log.debug("Validating document using scenario {}", scenarioType.getName()); final CollectingErrorEventHandler errorHandler = new CollectingErrorEventHandler(); - try ( InputStream input = new ByteArrayInputStream(document) ) { + try ( final SourceProvider validateInput = resolveSource(results) ) { + final Validator validator = ObjectFactory.createValidator(scenarioType.getSchema()); validator.setErrorHandler(errorHandler); - validator.validate(new StreamSource(input)); + validator.validate(validateInput.getSource()); return new Result<>(!errorHandler.hasErrors(), errorHandler.getErrors()); - } catch (SAXException | IOException e) { + } catch (final SAXException | SaxonApiException | IOException e) { throw new IllegalStateException("Error validating document", e); } } @Override - public void check(Bag results) { + public void check(final Bag results) { final CreateReportInput report = results.getReportInput(); final ScenarioType scenario = results.getScenarioSelectionResult().getObject(); - final Result validateResult = validate(results.getInput().getContent(), scenario); + + final Result validateResult = validate(results, scenario); + results.setSchemaValidationResult(validateResult); - ValidationResultsXmlSchema result = new ValidationResultsXmlSchema(); + final ValidationResultsXmlSchema result = new ValidationResultsXmlSchema(); report.setValidationResultsXmlSchema(result); result.getResource().addAll(scenario.getValidateWithXmlSchema().getResource()); if (!validateResult.isValid()) { result.getXmlSyntaxError().addAll(validateResult.getErrors()); } + } + private SourceProvider resolveSource(final Bag results) throws IOException, SaxonApiException { + final SourceProvider source; + if (results.getInput() instanceof AbstractInput && (((AbstractInput) results.getInput()).supportsMultipleReads())) { + source = () -> results.getInput().getSource(); + } else { + source = serialize(results.getInput(), results.getParserResult().getObject()); + } + return source; + } + + private SerializedDocument serialize(final Input input, final XdmNode object) throws IOException, SaxonApiException { + final SerializedDocument doc; + if (input instanceof AbstractInput && ((AbstractInput) input).getLength() < getInMemoryLimit()) { + doc = new ByteArraySerializedDocument(); + } else { + doc = new FileSerializedDocument(); + } + doc.serialize(object); + return doc; + } @Override - public boolean isSkipped(Bag results) { + public boolean isSkipped(final Bag results) { return hasNoScenario(results); } - private static boolean hasNoScenario(Bag results) { + private static boolean hasNoScenario(final Bag results) { return results.getScenarioSelectionResult() == null || results.getScenarioSelectionResult().isInvalid(); } + + private interface SourceProvider extends AutoCloseable { + + Source getSource() throws IOException; + + @Override + default void close() throws IOException { + // nothing + } + } + + private interface SerializedDocument extends AutoCloseable, SourceProvider { + + void serialize(XdmNode node) throws SaxonApiException, IOException; + + InputStream openStream() throws IOException; + + @Override + default Source getSource() throws IOException { + return new StreamSource(openStream()); + } + + } + } diff --git a/src/test/java/de/kosit/validationtool/api/InputFactoryTest.java b/src/test/java/de/kosit/validationtool/api/InputFactoryTest.java index f99d486..72d5990 100644 --- a/src/test/java/de/kosit/validationtool/api/InputFactoryTest.java +++ b/src/test/java/de/kosit/validationtool/api/InputFactoryTest.java @@ -23,17 +23,22 @@ import static org.assertj.core.api.Assertions.assertThat; import java.io.ByteArrayInputStream; import java.io.File; +import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; import java.nio.file.Paths; +import javax.xml.transform.stream.StreamSource; + import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import de.kosit.validationtool.impl.ConversionServiceTest; +import de.kosit.validationtool.impl.Helper.Simple; +import de.kosit.validationtool.impl.input.SourceInput; /** * Testet den Hashcode-Service. @@ -42,23 +47,22 @@ import de.kosit.validationtool.impl.ConversionServiceTest; */ public class InputFactoryTest { - private static final URL CONTENT = ConversionServiceTest.class.getResource("/valid/scenarios.xml"); - - private static final URL OTHER_CONTENT = ConversionServiceTest.class.getResource("/valid/report.xml"); - public static final String SOME_VALUE = "some value"; private static URL NOT_EXISTING; + private static final int EOF = -1; + + private static final int DEFAULT_BUFFER_SIZE = 4096; + static { try { NOT_EXISTING = new URL("file://localhost/somefile.text"); - } catch (MalformedURLException e) { + } catch (final MalformedURLException e) { // just ignore; } } - @Rule public ExpectedException expectedException = ExpectedException.none(); @@ -69,25 +73,40 @@ public class InputFactoryTest { } @Test - public void testSimple() { - final byte[] s1 = InputFactory.read(CONTENT).getHashCode(); - final byte[] s2 = InputFactory.read(CONTENT).getHashCode(); - final byte[] s3 = InputFactory.read(OTHER_CONTENT).getHashCode(); + public void testHashCodeGeneration() throws IOException { + final byte[] s1 = drain(InputFactory.read(Simple.SIMPLE_VALID.toURL())).getHashCode(); + final byte[] s2 = drain(InputFactory.read(Simple.SIMPLE_VALID.toURL())).getHashCode(); + final byte[] s3 = drain(InputFactory.read(Simple.INVALID.toURL())).getHashCode(); assertThat(s1).isNotEmpty(); assertThat(s1).isEqualTo(s2); assertThat(s3).isNotEmpty(); assertThat(s1).isNotEqualTo(s3); } + private static Input drain(final Input input) throws IOException { + final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; + final StreamSource s = (StreamSource) input.getSource(); + try ( final InputStream stream = s.getInputStream() ) { + + int n; + while (EOF != (n = stream.read(buffer))) { + // nothing + } + + } + return input; + + } + @Test public void testWrongAlgorithm() { - expectedException.expect(IllegalStateException.class); - InputFactory service = new InputFactory("unknown"); + this.expectedException.expect(IllegalArgumentException.class); + new InputFactory("unknown"); } @Test public void testNullInputURL() { - expectedException.expect(IllegalArgumentException.class); + this.expectedException.expect(IllegalArgumentException.class); InputFactory.read((URL) null); } @@ -105,43 +124,71 @@ public class InputFactoryTest { @Test public void testNullStream() { - expectedException.expect(IllegalArgumentException.class); + this.expectedException.expect(IllegalArgumentException.class); final Input input = InputFactory.read((InputStream)null, SOME_VALUE); } @Test public void testInputFile() throws URISyntaxException { - final Input input = InputFactory.read(new File(CONTENT.toURI())); + final Input input = InputFactory.read(new File(Simple.SIMPLE_VALID)); assertThat(input).isNotNull(); } @Test public void testInputPath() throws URISyntaxException { - final Input input = InputFactory.read(Paths.get(CONTENT.toURI())); + final Input input = InputFactory.read(Paths.get(Simple.SIMPLE_VALID)); assertThat(input).isNotNull(); } @Test public void testNullInput() { - expectedException.expect(IllegalArgumentException.class); + this.expectedException.expect(IllegalArgumentException.class); InputFactory.read((byte[]) null, SOME_VALUE); } @Test public void testNullInputName() { - expectedException.expect(IllegalArgumentException.class); + this.expectedException.expect(IllegalArgumentException.class); InputFactory.read(SOME_VALUE.getBytes(), null); } @Test - public void testEmptyInputName() { - expectedException.expect(IllegalArgumentException.class); - InputFactory.read(SOME_VALUE.getBytes(), ""); + public void testEmptyInputName() throws IOException { + this.expectedException.expect(IllegalArgumentException.class); + final Input input = InputFactory.read(SOME_VALUE.getBytes(), ""); + drain(input); + } + + @Test + public void testSourceInput() throws IOException { + try ( final InputStream s = Simple.SIMPLE_VALID.toURL().openStream() ) { + final SourceInput input = (SourceInput) InputFactory.read(new StreamSource(s)); + assertThat(input.getSource()).isNotNull(); + drain(input); + assertThat(input.getHashCode()).isNotNull(); + assertThat(input.getLength()).isGreaterThan(0L); + this.expectedException.expect(IllegalStateException.class); + input.getSource(); + } + } + + @Test + public void testSourceInputReader() throws IOException { + try ( final InputStream s = Simple.SIMPLE_VALID.toURL().openStream(); + final InputStreamReader reader = new InputStreamReader(s) ) { + final SourceInput input = (SourceInput) InputFactory.read(new StreamSource(reader)); + assertThat(input.getSource()).isNotNull(); + drain(input); + assertThat(input.getHashCode()).isNotNull(); + assertThat(input.getLength()).isGreaterThan(0L); + this.expectedException.expect(IllegalStateException.class); + input.getSource(); + } } @Test public void testUnexistingInput() { - expectedException.expect(IllegalArgumentException.class); + this.expectedException.expect(IllegalArgumentException.class); InputFactory.read(NOT_EXISTING); } diff --git a/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java b/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java index 47c54a6..eea1593 100644 --- a/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java +++ b/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java @@ -20,12 +20,6 @@ package de.kosit.validationtool.cmd; import static de.kosit.validationtool.impl.Helper.ASSERTIONS; -import static de.kosit.validationtool.impl.Helper.NOT_EXISTING; -import static de.kosit.validationtool.impl.Helper.REPOSITORY; -import static de.kosit.validationtool.impl.Helper.SAMPLE; -import static de.kosit.validationtool.impl.Helper.SAMPLE2; -import static de.kosit.validationtool.impl.Helper.SAMPLE_DIR; -import static de.kosit.validationtool.impl.Helper.SCENARIO_FILE; import static org.assertj.core.api.Assertions.assertThat; import java.io.IOException; @@ -34,9 +28,12 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; +import org.apache.commons.io.FileUtils; import org.junit.Before; import org.junit.Test; +import de.kosit.validationtool.impl.Helper.Simple; + /** * Testet die Parameter des Kommandozeilen-Tools. * @@ -51,88 +48,88 @@ public class CommandlineApplicationTest { @Before public void setup() throws IOException { - commandLine = new CommandLine(); - commandLine.activate(); + this.commandLine = new CommandLine(); + this.commandLine.activate(); } @Test public void testHelp() { - String[] args = new String[] { "-?" }; + final String[] args = new String[] { "-?" }; CommandLineApplication.mainProgram(args); - assertThat(commandLine.getErrorOutput()).isEmpty(); - checkForHelp(commandLine.getOutputLines()); + assertThat(this.commandLine.getErrorOutput()).isEmpty(); + checkForHelp(this.commandLine.getOutputLines()); } - private void checkForHelp(List outputLines) { + private static void checkForHelp(final List outputLines) { assertThat(outputLines.size()).isGreaterThan(0); outputLines.subList(1, outputLines.size() - 1).forEach(l -> assertThat(l.startsWith(" -") || l.startsWith(" "))); } @Test public void testRequiredScenarioFile() { - String[] args = new String[] { "-d", "arguments", "egal welche", "argument drin sind" }; + final String[] args = new String[] { "-d", "arguments", "egal welche", "argument drin sind" }; CommandLineApplication.mainProgram(args); - assertThat(commandLine.getErrorOutput()).isNotEmpty(); - assertThat(commandLine.getErrorOutput()).contains("Missing required option: s"); + assertThat(this.commandLine.getErrorOutput()).isNotEmpty(); + assertThat(this.commandLine.getErrorOutput()).contains("Missing required option: s"); } @Test public void testNotExistingScenarioFile() { - String[] args = new String[] { "-s", Paths.get(NOT_EXISTING).toString(), Paths.get(NOT_EXISTING).toString() }; + final String[] args = new String[] { "-s", Paths.get(Simple.NOT_EXISTING).toString(), Paths.get(Simple.NOT_EXISTING).toString() }; CommandLineApplication.mainProgram(args); - assertThat(commandLine.getErrorOutput()).isNotEmpty(); - assertThat(commandLine.getErrorOutput()).contains("Not a valid path for scenario definition specified"); + assertThat(this.commandLine.getErrorOutput()).isNotEmpty(); + assertThat(this.commandLine.getErrorOutput()).contains("Not a valid path for scenario definition specified"); } @Test public void testIncorrectRepository() { - String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), Paths.get(NOT_EXISTING).toString() }; + final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), Paths.get(Simple.NOT_EXISTING).toString() }; CommandLineApplication.mainProgram(args); - assertThat(commandLine.getErrorOutput()).isNotEmpty(); - assertThat(commandLine.getErrorOutput()).contains("Can not load schema from sources"); + assertThat(this.commandLine.getErrorOutput()).isNotEmpty(); + assertThat(this.commandLine.getErrorOutput()).contains("Can not load schema from sources"); } @Test public void testNotExistingTestTarget() { - String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-r", Paths.get(REPOSITORY).toString(), - Paths.get(NOT_EXISTING).toString() }; + final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", Paths.get(Simple.REPOSITORY).toString(), + Paths.get(Simple.NOT_EXISTING).toString() }; CommandLineApplication.mainProgram(args); - assertThat(commandLine.getErrorOutput()).isNotEmpty(); - assertThat(commandLine.getErrorOutput()).contains("No test targets found"); + assertThat(this.commandLine.getErrorOutput()).isNotEmpty(); + assertThat(this.commandLine.getErrorOutput()).contains("No test targets found"); } @Test public void testValidMinimalConfiguration() { - String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-r", Paths.get(REPOSITORY).toString(), - Paths.get(SAMPLE).toString() }; + final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", Paths.get(Simple.REPOSITORY).toString(), + Paths.get(Simple.SIMPLE_VALID).toString() }; CommandLineApplication.mainProgram(args); - assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT); + assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT); } @Test public void testValidMultipleInput() { - String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-r", Paths.get(REPOSITORY).toString(), - Paths.get(SAMPLE).toString(), Paths.get(SAMPLE2).toString() }; + final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", Paths.get(Simple.REPOSITORY).toString(), + Paths.get(Simple.SIMPLE_VALID).toString(), Paths.get(Simple.FOO).toString() }; CommandLineApplication.mainProgram(args); - assertThat(commandLine.getErrorOutput()).contains("Processing 2 object(s) completed"); + assertThat(this.commandLine.getErrorOutput()).contains("Processing 2 object(s) completed"); } @Test public void testValidDirectoryInput() { - String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-r", Paths.get(REPOSITORY).toString(), - Paths.get(SAMPLE_DIR).toString() }; + final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", Paths.get(Simple.REPOSITORY).toString(), + Paths.get(Simple.EXAMPLES).toString() }; CommandLineApplication.mainProgram(args); - assertThat(commandLine.getErrorOutput()).contains("Processing 4 object(s) completed"); + assertThat(this.commandLine.getErrorOutput()).contains("Processing 5 object(s) completed"); } @Test public void testValidOutputConfiguration() throws IOException { - Path output = Paths.get("output"); - // assertThat(output).doesNotExist(); - String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-o", output.getFileName().toString(), "-r", - Paths.get(REPOSITORY).toString(), Paths.get(SAMPLE).toString() }; + final Path output = Paths.get("output"); + FileUtils.deleteDirectory(output.toFile()); + final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-o", output.getFileName().toString(), "-r", + Paths.get(Simple.REPOSITORY).toString(), Paths.get(Simple.SIMPLE_VALID).toString() }; CommandLineApplication.mainProgram(args); - assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT); + assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT); assertThat(output).exists(); assertThat(Files.list(output)).hasSize(1); } @@ -140,45 +137,47 @@ public class CommandlineApplicationTest { @Test public void testNoInput() { // assertThat(output).doesNotExist(); - String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-r", Paths.get(REPOSITORY).toString(), }; + final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", Paths.get(Simple.REPOSITORY).toString(), }; CommandLineApplication.mainProgram(args); - checkForHelp(commandLine.getOutputLines()); + checkForHelp(this.commandLine.getOutputLines()); } @Test public void testPrint() { - String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-p", "-r", Paths.get(REPOSITORY).toString(), - Paths.get(SAMPLE).toString() }; + final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-p", "-r", + Paths.get(Simple.REPOSITORY).toString(), Paths.get(Simple.SIMPLE_VALID).toString() }; CommandLineApplication.mainProgram(args); - assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT); - assertThat(commandLine.getOutputLines().get(0)).contains(""); + assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT); + assertThat(this.commandLine.getOutputLines().get(0)).contains(""); } @Test public void testHtmlExtraktion() throws IOException { - Path output = Files.createTempDirectory("pruef-tool-test"); - String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-h", "-o", output.toAbsolutePath().toString(), "-r", - Paths.get(REPOSITORY).toString(), Paths.get(SAMPLE).toString() }; + final Path output = Files.createTempDirectory("pruef-tool-test"); + final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-h", "-o", output.toAbsolutePath().toString(), + "-r", Paths.get(Simple.REPOSITORY).toString(), Paths.get(Simple.SIMPLE_VALID).toString() }; CommandLineApplication.mainProgram(args); - assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT); + assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT); assertThat(Files.list(output).filter(f -> f.toString().endsWith(".html")).count()).isGreaterThan(0); } @Test public void testAssertionsExtraktion() throws IOException { - String[] args = new String[] { "-d", "-s", Paths.get(SCENARIO_FILE).toString(), "-r", Paths.get(REPOSITORY).toString(), "-c", - Paths.get(ASSERTIONS).toString(), Paths.get(REPOSITORY).toString(), Paths.get(SAMPLE).toString() }; + final String[] args = new String[] { "-d", "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", + Paths.get(Simple.REPOSITORY).toString(), "-c", Paths.get(ASSERTIONS).toString(), Paths.get(Simple.REPOSITORY).toString(), + Paths.get(Simple.SIMPLE_VALID).toString() }; CommandLineApplication.mainProgram(args); - assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT); - assertThat(commandLine.getErrorOutput()).contains("Can not find assertions for "); + assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT); + assertThat(this.commandLine.getErrorOutput()).contains("Can not find assertions for "); } @Test public void testDebugFlag() throws IOException { - String[] args = new String[] { "-s", Paths.get(SCENARIO_FILE).toString(), "-r", "unknown", "-d", Paths.get(ASSERTIONS).toString() }; + final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", "unknown", "-d", + Paths.get(ASSERTIONS).toString() }; CommandLineApplication.mainProgram(args); - assertThat(commandLine.getErrorOutput()).contains("at de.kosit.validationtool"); + assertThat(this.commandLine.getErrorOutput()).contains("at de.kosit.validationtool"); } } diff --git a/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java b/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java index a2311bc..aa5f7f7 100644 --- a/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java +++ b/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java @@ -10,6 +10,8 @@ import org.junit.Before; import org.junit.Ignore; import org.junit.Test; +import de.kosit.validationtool.impl.Helper.Simple; + import io.restassured.RestAssured; import io.restassured.http.ContentType; @@ -20,11 +22,9 @@ import io.restassured.http.ContentType; */ public class DaemonIT { - private static final String EXAMPLE_FILE = "examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL.xml"; private static final String APPLICATION_XML = "application/xml"; - private static final String INVALID_XML = "examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL-invalid.xml"; @Before public void setup() { @@ -41,7 +41,7 @@ public class DaemonIT { @Test public void makeSureThatSuccessTest() throws IOException { - try ( final InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) { + try ( final InputStream io = Simple.SIMPLE_VALID.toURL().openStream() ) { given().contentType(ContentType.XML).body(toContent(io)).when().post("/").then().statusCode(200); } } @@ -54,7 +54,7 @@ public class DaemonIT { @Test @Ignore // no default error report yet public void internalServerErrorTest() throws IOException { - try ( final InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(INVALID_XML) ) { + try ( final InputStream io = Simple.INVALID.toURL().openStream() ) { given().contentType(APPLICATION_XML).body(toContent(io)).when().post("/").then().statusCode(200); } } @@ -75,7 +75,8 @@ public class DaemonIT { @Test public void xmlResultTest() throws IOException { - try ( final InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) { + + try ( final InputStream io = Simple.SIMPLE_VALID.toURL().openStream() ) { given().body(toContent(io)).when().post("/").then().contentType(APPLICATION_XML).and().statusCode(200); } } diff --git a/src/test/java/de/kosit/validationtool/impl/ContentRepositoryTest.java b/src/test/java/de/kosit/validationtool/impl/ContentRepositoryTest.java index f184975..e70948b 100644 --- a/src/test/java/de/kosit/validationtool/impl/ContentRepositoryTest.java +++ b/src/test/java/de/kosit/validationtool/impl/ContentRepositoryTest.java @@ -36,6 +36,8 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; +import de.kosit.validationtool.impl.Helper.Simple; + import net.sf.saxon.s9api.XPathExecutable; import net.sf.saxon.s9api.XsltExecutable; @@ -53,7 +55,7 @@ public class ContentRepositoryTest { @Before public void setup() { - this.repository = new ContentRepository(ObjectFactory.createProcessor(), Helper.REPOSITORY); + this.repository = new ContentRepository(ObjectFactory.createProcessor(), Simple.REPOSITORY); } @Test @@ -71,19 +73,19 @@ public class ContentRepositoryTest { @Test public void testCreateSchemaNotExisting() throws Exception { this.exception.expect(IllegalStateException.class); - ContentRepository.createSchema(Helper.ASSERTION_SCHEMA.resolve("noexisting").toURL()); + ContentRepository.createSchema(Simple.NOT_EXISTING.toURL()); } @Test public void testLoadXSLT() { - final XsltExecutable executable = this.repository.loadXsltScript(Helper.SAMPLE_XSLT); + final XsltExecutable executable = this.repository.loadXsltScript(Simple.REPORT_XSL); assertThat(executable).isNotNull(); } @Test public void testLoadXSLTNotExisting() { this.exception.expect(IllegalStateException.class); - this.repository.loadXsltScript(Helper.SAMPLE_XSLT.resolve("notexisting")); + this.repository.loadXsltScript(Simple.NOT_EXISTING); } @Test @@ -119,8 +121,8 @@ public class ContentRepositoryTest { @Test public void testLoadSchema() { - final URL main = RelativeUriResolverTest.class.getClassLoader().getResource("simple/main.xsd"); - final Schema schema = ContentRepository.createSchema(main, new ClassPathResourceResolver("/simple")); + final URL main = RelativeUriResolverTest.class.getClassLoader().getResource("loading/main.xsd"); + final Schema schema = ContentRepository.createSchema(main, new ClassPathResourceResolver("/loading")); assertThat(schema).isNotNull(); } diff --git a/src/test/java/de/kosit/validationtool/impl/ConversionServiceTest.java b/src/test/java/de/kosit/validationtool/impl/ConversionServiceTest.java index a3ad35c..0353bac 100644 --- a/src/test/java/de/kosit/validationtool/impl/ConversionServiceTest.java +++ b/src/test/java/de/kosit/validationtool/impl/ConversionServiceTest.java @@ -31,6 +31,8 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; +import de.kosit.validationtool.impl.Helper.Invalid; +import de.kosit.validationtool.impl.Helper.Simple; import de.kosit.validationtool.model.scenarios.Scenarios; /** @@ -40,12 +42,6 @@ import de.kosit.validationtool.model.scenarios.Scenarios; */ public class ConversionServiceTest { - private static final URL VALID_XML = ConversionServiceTest.class.getResource("/valid/scenarios.xml"); - - private static final URL INVALID_XML = ConversionServiceTest.class.getResource("/invalid/scenarios-invalid.xml"); - - private static final URL ILLFORMED_XML = ConversionServiceTest.class.getResource("/invalid/scenarios-illformed.xml"); - private static final URL SCHEMA = ConversionServiceTest.class.getResource("/xsd/scenarios.xsd"); @Rule @@ -77,28 +73,28 @@ public class ConversionServiceTest { @Test public void testUnmarshal() throws URISyntaxException { - final Scenarios s = this.service.readXml(VALID_XML.toURI(), Scenarios.class); + final Scenarios s = this.service.readXml(Simple.SCENARIOS, Scenarios.class); assertThat(s).isNotNull(); - assertThat(s.getName()).isEqualToIgnoringCase("XInneres"); + assertThat(s.getName()).isEqualToIgnoringCase("HTML-TestSuite"); } @Test - public void testUnmarshalWithSchema() throws URISyntaxException { - final Scenarios s = this.service.readXml(VALID_XML.toURI(), Scenarios.class, ContentRepository.createSchema(SCHEMA)); + public void testUnmarshalWithSchema() { + final Scenarios s = this.service.readXml(Simple.SCENARIOS, Scenarios.class, ContentRepository.createSchema(SCHEMA)); assertThat(s).isNotNull(); - assertThat(s.getName()).isEqualToIgnoringCase("XInneres"); + assertThat(s.getName()).isEqualToIgnoringCase("HTML-TestSuite"); } @Test - public void testUnmarshalInvalidXml() throws URISyntaxException { + public void testUnmarshalInvalidXml() { this.exception.expect(ConversionService.ConversionExeption.class); - this.service.readXml(INVALID_XML.toURI(), Scenarios.class, ContentRepository.createSchema(SCHEMA)); + this.service.readXml(Invalid.SCENARIOS, Scenarios.class, ContentRepository.createSchema(SCHEMA)); } @Test - public void testUnmarshalIllFormed() throws URISyntaxException { + public void testUnmarshalIllFormed() { this.exception.expect(ConversionService.ConversionExeption.class); - this.service.readXml(ILLFORMED_XML.toURI(), Scenarios.class, ContentRepository.createSchema(SCHEMA)); + this.service.readXml(Invalid.SCENARIOS_ILLFORMED, Scenarios.class, ContentRepository.createSchema(SCHEMA)); } @Test @@ -110,13 +106,13 @@ public class ConversionServiceTest { @Test public void testUnmarshalUnknownType() throws URISyntaxException { this.exception.expect(ConversionService.ConversionExeption.class); - this.service.readXml(VALID_XML.toURI(), ConversionService.class); + this.service.readXml(Simple.SCENARIOS, ConversionService.class); } @Test public void testUnmarshalWithoutType() throws URISyntaxException { this.exception.expect(ConversionService.ConversionExeption.class); - this.service.readXml(VALID_XML.toURI(), null); + this.service.readXml(Simple.SCENARIOS, null); } } diff --git a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java index 421ea10..5fa5487 100644 --- a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java +++ b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java @@ -26,7 +26,6 @@ import static org.assertj.core.api.Assertions.assertThat; import java.io.File; import java.net.URISyntaxException; -import java.net.URL; import java.util.List; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -39,6 +38,7 @@ import de.kosit.validationtool.api.AcceptRecommendation; import de.kosit.validationtool.api.CheckConfiguration; import de.kosit.validationtool.api.Input; import de.kosit.validationtool.api.Result; +import de.kosit.validationtool.impl.Helper.Simple; /** * Test das Check-Interface @@ -47,10 +47,7 @@ import de.kosit.validationtool.api.Result; */ public class DefaultCheckTest { - private static final URL SCENARIO_DEFINITION = ScenarioRepositoryTest.class.getResource("/examples/UBLReady/scenarios-2.xml"); - private static final URL VALID_EXAMPLE = ScenarioRepositoryTest.class - .getResource("/examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL.xml"); public static final int MULTI_COUNT = 5; @@ -58,14 +55,23 @@ public class DefaultCheckTest { @Before public void setup() throws URISyntaxException { - final CheckConfiguration d = new CheckConfiguration(SCENARIO_DEFINITION.toURI()); - d.setScenarioRepository(new File("src/test/resources/examples/repository").toURI()); + final CheckConfiguration d = new CheckConfiguration(Simple.SCENARIOS); + d.setScenarioRepository(new File(Simple.REPOSITORY).toURI()); this.implementation = new DefaultCheck(d); } @Test public void testHappyCase() { - final Result doc = this.implementation.checkInput(read(VALID_EXAMPLE)); + final Result doc = this.implementation.checkInput(read(Simple.SIMPLE_VALID)); + assertThat(doc).isNotNull(); + assertThat(doc.getReport()).isNotNull(); + assertThat(doc.isAcceptable()).isTrue(); + assertThat(doc.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.ACCEPTABLE); + } + + @Test + public void testWithoutAcceptMatch() { + final Result doc = this.implementation.checkInput(read(Simple.FOO)); assertThat(doc).isNotNull(); assertThat(doc.getReport()).isNotNull(); assertThat(doc.isAcceptable()).isFalse(); @@ -74,13 +80,13 @@ public class DefaultCheckTest { @Test public void testHappyCaseDocument() { - final Document doc = this.implementation.check(read(VALID_EXAMPLE)); + final Document doc = this.implementation.check(read(Simple.SIMPLE_VALID)); assertThat(doc).isNotNull(); } @Test public void testMultipleCase() { - final List input = IntStream.range(0, MULTI_COUNT).mapToObj(i -> read(VALID_EXAMPLE)).collect(Collectors.toList()); + final List input = IntStream.range(0, MULTI_COUNT).mapToObj(i -> read(Simple.SIMPLE_VALID)).collect(Collectors.toList()); final List docs = this.implementation.checkInput(input); assertThat(docs).isNotNull(); assertThat(docs).hasSize(MULTI_COUNT); @@ -88,7 +94,7 @@ public class DefaultCheckTest { @Test public void testMultipleCaseDocument() { - final List input = IntStream.range(0, MULTI_COUNT).mapToObj(i -> read(VALID_EXAMPLE)).collect(Collectors.toList()); + final List input = IntStream.range(0, MULTI_COUNT).mapToObj(i -> read(Simple.SIMPLE_VALID)).collect(Collectors.toList()); final List docs = this.implementation.check(input); assertThat(docs).isNotNull(); assertThat(docs).hasSize(MULTI_COUNT); @@ -96,10 +102,10 @@ public class DefaultCheckTest { @Test public void testExtractHtml() { - final DefaultResult doc = (DefaultResult) this.implementation.checkInput(read(VALID_EXAMPLE)); + final DefaultResult doc = (DefaultResult) this.implementation.checkInput(read(Simple.SIMPLE_VALID)); assertThat(doc).isNotNull(); assertThat(doc.getReport()).isNotNull(); - assertThat(doc.isAcceptable()).isFalse(); + assertThat(doc.isAcceptable()).isTrue(); assertThat(doc.extractHtmlAsString()).isNotEmpty(); assertThat(doc.extractHtmlAsElement()).isNotEmpty(); assertThat(doc.extractHtml()).isNotEmpty(); diff --git a/src/test/java/de/kosit/validationtool/impl/DocumentParserTest.java b/src/test/java/de/kosit/validationtool/impl/DocumentParserTest.java index 0638f90..d914d9e 100644 --- a/src/test/java/de/kosit/validationtool/impl/DocumentParserTest.java +++ b/src/test/java/de/kosit/validationtool/impl/DocumentParserTest.java @@ -22,13 +22,11 @@ package de.kosit.validationtool.impl; import static de.kosit.validationtool.api.InputFactory.read; import static org.assertj.core.api.Assertions.assertThat; -import java.net.URL; - -import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; +import de.kosit.validationtool.impl.Helper.Simple; import de.kosit.validationtool.impl.model.Result; import de.kosit.validationtool.impl.tasks.DocumentParseAction; import de.kosit.validationtool.model.reportInput.XMLSyntaxError; @@ -42,25 +40,12 @@ import net.sf.saxon.s9api.XdmNode; */ public class DocumentParserTest { - private static final URL CONTENT = ConversionServiceTest.class.getResource("/valid/scenarios.xml"); - - private static final URL ILLFORMED = ConversionServiceTest.class.getResource("/invalid/scenarios-illformed.xml"); - - private static final URL NOT_EXISTING = ConversionServiceTest.class.getResource("/does not exist.xml"); - @Rule public ExpectedException exception = ExpectedException.none(); - private DocumentParseAction parser; - - @Before - public void setup() { - this.parser = new DocumentParseAction(); - } - @Test public void testSimple() { - final Result result = DocumentParseAction.parseDocument(read(CONTENT)); + final Result result = DocumentParseAction.parseDocument(read(Simple.SIMPLE_VALID)); assertThat(result).isNotNull(); assertThat(result.getObject()).isNotNull(); assertThat(result.getErrors()).isEmpty(); @@ -69,7 +54,7 @@ public class DocumentParserTest { @Test public void testIllformed() { - final Result result = DocumentParseAction.parseDocument(read(ILLFORMED)); + final Result result = DocumentParseAction.parseDocument(read(Simple.NOT_WELLFORMED)); assertThat(result).isNotNull(); assertThat(result.getErrors()).isNotEmpty(); assertThat(result.getObject()).isNull(); diff --git a/src/test/java/de/kosit/validationtool/impl/Helper.java b/src/test/java/de/kosit/validationtool/impl/Helper.java index cf183a8..14882a7 100644 --- a/src/test/java/de/kosit/validationtool/impl/Helper.java +++ b/src/test/java/de/kosit/validationtool/impl/Helper.java @@ -37,12 +37,14 @@ import net.sf.saxon.s9api.XdmNode; * * @author Andreas Penski */ -public class Helper { +public class Helper { public static class Simple { public static final URI ROOT = EXAMPLES_DIR.resolve("simple/"); + public static final URI EXAMPLES = ROOT.resolve("input/"); + public static final URI SIMPLE_VALID = Simple.ROOT.resolve("input/simple.xml"); public static final URI FOO = Simple.ROOT.resolve("input/foo.xml"); @@ -58,15 +60,30 @@ public class Helper { public static final URI UNKNOWN = ROOT.resolve("input/unknown.xml"); public static final URI GARBAGE = ROOT.resolve("input/no-xml.file"); + + public static final URI NOT_EXISTING = EXAMPLES_DIR.resolve("doesnotexist"); + + public static final URI REPORT_XSL = REPOSITORY.resolve("report.xsl"); + + public static URI getSchemaLocation() { + return ROOT.resolve("repository/simple.xsd"); + } + } + + public static class Invalid { + + public static final URI ROOT = EXAMPLES_DIR.resolve("invaid/"); + + public static final URI SCENARIOS = ROOT.resolve("scenarios.xml"); + + public static final URI SCENARIOS_ILLFORMED = ROOT.resolve("scenarios-illformed.xml"); } - public static final URI SOURCE_ROOT = Paths.get("src/main/resources").toUri(); public static final URI MODEL_ROOT = Paths.get("src/main/model").toUri(); public static final URI ASSERTION_SCHEMA = MODEL_ROOT.resolve("xsd/assertions.xsd"); - public static final URI SCENARIO_SCHEMA = MODEL_ROOT.resolve("xsd/scenarios.xsd"); public static final URI TEST_ROOT = Paths.get("src/test/resources").toUri(); @@ -74,21 +91,14 @@ public class Helper { public static final URI ASSERTIONS = EXAMPLES_DIR.resolve("assertions/tests-xrechnung.xml"); - public static final URI SCENARIO_FILE = EXAMPLES_DIR.resolve("UBLReady/scenarios-2.xml"); - public static final URI REPOSITORY = EXAMPLES_DIR.resolve("repository/"); public static final URL JAR_REPOSITORY = Helper.class.getClassLoader().getResource("xrechnung/repository/"); - public static final URI NOT_EXISTING = EXAMPLES_DIR.resolve("doesnotexist"); - public static final URI SAMPLE_DIR = EXAMPLES_DIR.resolve("UBLReady/"); - public static final URI SAMPLE_XSLT = EXAMPLES_DIR.resolve("repository/resources/eRechnung/report.xsl"); - public static final URI SAMPLE = SAMPLE_DIR.resolve("UBLReady_EU_UBL-NL_20170102_FULL.xml"); - public static final URI SAMPLE2 = SAMPLE_DIR.resolve("UBLReady_EU_UBL-NL_20170102_FULL-invalid.xml"); /** * Lädt ein XML-Dokument von der gegebenen URL diff --git a/src/test/java/de/kosit/validationtool/impl/RelativeUriResolverTest.java b/src/test/java/de/kosit/validationtool/impl/RelativeUriResolverTest.java index 8be3af1..c7b83d6 100644 --- a/src/test/java/de/kosit/validationtool/impl/RelativeUriResolverTest.java +++ b/src/test/java/de/kosit/validationtool/impl/RelativeUriResolverTest.java @@ -75,8 +75,8 @@ public class RelativeUriResolverTest { @Test public void testClasspathLocal() throws URISyntaxException, TransformerException { - this.resolver = new RelativeUriResolver(RelativeUriResolver.class.getClassLoader().getResource("simple").toURI()); - final URL moz = RelativeUriResolverTest.class.getClassLoader().getResource("simple/main.xsd"); + this.resolver = new RelativeUriResolver(RelativeUriResolver.class.getClassLoader().getResource("loading").toURI()); + final URL moz = RelativeUriResolverTest.class.getClassLoader().getResource("loading/main.xsd"); final Source resolved = this.resolver.resolve("./resources/reference.xsd", moz.toURI().toASCIIString()); assertThat(resolved).isNotNull(); } diff --git a/src/test/java/de/kosit/validationtool/impl/SaxonSecurityTest.java b/src/test/java/de/kosit/validationtool/impl/SaxonSecurityTest.java index 6508788..ea3ccec 100644 --- a/src/test/java/de/kosit/validationtool/impl/SaxonSecurityTest.java +++ b/src/test/java/de/kosit/validationtool/impl/SaxonSecurityTest.java @@ -33,7 +33,14 @@ import org.w3c.dom.Document; import lombok.extern.slf4j.Slf4j; -import net.sf.saxon.s9api.*; +import de.kosit.validationtool.impl.Helper.Simple; + +import net.sf.saxon.s9api.DOMDestination; +import net.sf.saxon.s9api.Processor; +import net.sf.saxon.s9api.SaxonApiException; +import net.sf.saxon.s9api.XsltCompiler; +import net.sf.saxon.s9api.XsltExecutable; +import net.sf.saxon.s9api.XsltTransformer; /** * Testet verschiedene Saxon Security Einstellungen. @@ -45,18 +52,18 @@ public class SaxonSecurityTest { @Test public void testEvilStylesheets() throws IOException { - Processor p = ObjectFactory.createProcessor(); + final Processor p = ObjectFactory.createProcessor(); for (int i = 1; i <= 5; i++) { try { - URL resource = SaxonSecurityTest.class.getResource(String.format("/evil/evil%s.xsl", i)); + final URL resource = SaxonSecurityTest.class.getResource(String.format("/evil/evil%s.xsl", i)); final XsltCompiler compiler = p.newXsltCompiler(); - final RelativeUriResolver resolver = new RelativeUriResolver(Helper.REPOSITORY); + final RelativeUriResolver resolver = new RelativeUriResolver(Simple.REPOSITORY); compiler.setURIResolver(resolver); final XsltExecutable exetuable = compiler.compile(new StreamSource(resource.openStream())); final XsltTransformer transformer = exetuable.load(); final Document document = ObjectFactory.createDocumentBuilder(false).newDocument(); document.createElement("root"); - Document result = ObjectFactory.createDocumentBuilder(false).newDocument(); + final Document result = ObjectFactory.createDocumentBuilder(false).newDocument(); transformer.getUnderlyingController().setUnparsedTextURIResolver(resolver); transformer.setURIResolver(resolver); transformer.setSource(new DOMSource(document)); @@ -68,7 +75,7 @@ public class SaxonSecurityTest { fail(String.format("Saxon configuration should prevent expansion within %s", resource)); } - } catch (SaxonApiException | RuntimeException e) { + } catch (final SaxonApiException | RuntimeException e) { log.info("Expected exception detected", e.getMessage()); } } diff --git a/src/test/java/de/kosit/validationtool/impl/ScenarioRepositoryTest.java b/src/test/java/de/kosit/validationtool/impl/ScenarioRepositoryTest.java index dbaa52b..abfab1d 100644 --- a/src/test/java/de/kosit/validationtool/impl/ScenarioRepositoryTest.java +++ b/src/test/java/de/kosit/validationtool/impl/ScenarioRepositoryTest.java @@ -22,10 +22,9 @@ package de.kosit.validationtool.impl; import static de.kosit.validationtool.api.InputFactory.read; import static org.assertj.core.api.Assertions.assertThat; -import java.io.File; import java.io.IOException; +import java.net.URI; import java.net.URISyntaxException; -import java.net.URL; import org.junit.Before; import org.junit.Rule; @@ -33,6 +32,7 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import de.kosit.validationtool.api.CheckConfiguration; +import de.kosit.validationtool.impl.Helper.Simple; import de.kosit.validationtool.impl.model.Result; import de.kosit.validationtool.impl.tasks.DocumentParseAction; import de.kosit.validationtool.model.scenarios.ScenarioType; @@ -48,8 +48,6 @@ import net.sf.saxon.s9api.XdmNode; public class ScenarioRepositoryTest { - private static final URL SAMPLE = ScenarioRepositoryTest.class.getResource("/valid/scenarios.xml"); - @Rule public ExpectedException expectedException = ExpectedException.none(); @@ -59,7 +57,7 @@ public class ScenarioRepositoryTest { @Before public void setup() { - this.content = new ContentRepository(ObjectFactory.createProcessor(), new File("src/test/resources/examples/repository").toURI()); + this.content = new ContentRepository(ObjectFactory.createProcessor(), Simple.REPOSITORY); final Scenarios def = new Scenarios(); final ScenarioType t = new ScenarioType(); t.setMatch("//*:name"); @@ -72,7 +70,7 @@ public class ScenarioRepositoryTest { @Test public void testHappyCase() throws Exception { - final Result scenario = this.repository.selectScenario(load(SAMPLE)); + final Result scenario = this.repository.selectScenario(load(Simple.SCENARIOS)); assertThat(scenario).isNotNull(); assertThat(scenario.isValid()).isTrue(); } @@ -83,7 +81,7 @@ public class ScenarioRepositoryTest { final ScenarioType fallback = new ScenarioType(); fallback.setName("fallback"); this.repository.setFallbackScenario(fallback); - final Result scenario = this.repository.selectScenario(load(SAMPLE)); + final Result scenario = this.repository.selectScenario(load(Simple.SCENARIOS)); assertThat(scenario).isNotNull(); assertThat(scenario.isValid()).isFalse(); assertThat(scenario.getObject().getName()).isEqualTo("fallback"); @@ -100,15 +98,15 @@ public class ScenarioRepositoryTest { final ScenarioType fallback = new ScenarioType(); fallback.setName("fallback"); this.repository.setFallbackScenario(fallback); - final Result scenario = this.repository.selectScenario(load(SAMPLE)); + final Result scenario = this.repository.selectScenario(load(Simple.SCENARIOS)); assertThat(scenario).isNotNull(); assertThat(scenario.isValid()).isFalse(); assertThat(scenario.getObject().getName()).isEqualTo("fallback"); } - private static XdmNode load(final URL url) throws IOException { + private static XdmNode load(final URI uri) throws IOException { final DocumentParseAction p = new DocumentParseAction(); - return DocumentParseAction.parseDocument(read(url)).getObject(); + return DocumentParseAction.parseDocument(read(uri.toURL())).getObject(); } @Test diff --git a/src/test/java/de/kosit/validationtool/impl/SchemaValidatorActionTest.java b/src/test/java/de/kosit/validationtool/impl/SchemaValidatorActionTest.java deleted file mode 100644 index 89d3a80..0000000 --- a/src/test/java/de/kosit/validationtool/impl/SchemaValidatorActionTest.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under - * one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. KoSIT licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package de.kosit.validationtool.impl; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.util.Collections; - -import javax.xml.validation.Schema; - -import org.junit.Before; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -import de.kosit.validationtool.api.InputFactory; -import de.kosit.validationtool.impl.model.Result; -import de.kosit.validationtool.impl.tasks.CheckAction; -import de.kosit.validationtool.impl.tasks.SchemaValidationAction; -import de.kosit.validationtool.model.reportInput.CreateReportInput; -import de.kosit.validationtool.model.scenarios.ResourceType; -import de.kosit.validationtool.model.scenarios.ScenarioType; -import de.kosit.validationtool.model.scenarios.ValidateWithXmlSchema; - -/** - * Testet die {@linkSchemaValidatorAction}. - * - * @author Andreas Penski - */ -public class SchemaValidatorActionTest { - - private static final URL VALID_EXAMPLE = SchemaValidatorActionTest.class - .getResource("/examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL.xml"); - - private static final URI INVALID_EXAMPLE = Helper.TEST_ROOT.resolve("invalid/scenarios-invalid.xml"); - - public ExpectedException expectedException = ExpectedException.none(); - - private SchemaValidationAction service; - - private ContentRepository repository; - - @Before - public void setup() { - service = new SchemaValidationAction(); - repository = new ContentRepository(ObjectFactory.createProcessor(), Helper.REPOSITORY); - - } - - @Test - public void testSimple() { - CheckAction.Bag bag = new CheckAction.Bag(InputFactory.read(VALID_EXAMPLE), new CreateReportInput()); - ScenarioType t = new ScenarioType(); - ValidateWithXmlSchema v = new ValidateWithXmlSchema(); - ResourceType r = new ResourceType(); - r.setLocation("resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd"); - r.setName("invoice"); - v.getResource().add(r); - t.setValidateWithXmlSchema(v); - t.initialize(repository, true); - bag.setScenarioSelectionResult(new Result<>(t, Collections.emptyList())); - service.check(bag); - assertThat(bag.getSchemaValidationResult().isValid()).isTrue(); - assertThat(bag.getSchemaValidationResult()).isNotNull(); - assertThat(bag.getSchemaValidationResult().isValid()).isTrue(); - } - - @Test - public void testValidationFailure() throws MalformedURLException { - CheckAction.Bag bag = new CheckAction.Bag(InputFactory.read(INVALID_EXAMPLE.toURL()), new CreateReportInput()); - ScenarioType t = new ScenarioType(); - ValidateWithXmlSchema v = new ValidateWithXmlSchema(); - ResourceType r = new ResourceType(); - r.setLocation(Helper.REPOSITORY.relativize(Helper.SCENARIO_SCHEMA).getRawPath()); - r.setName("invoice"); - v.getResource().add(r); - t.setValidateWithXmlSchema(v); - t.initialize(repository, true); - bag.setScenarioSelectionResult(new Result<>(t, Collections.emptyList())); - service.check(bag); - assertThat(bag.getSchemaValidationResult().isValid()).isFalse(); - bag.getSchemaValidationResult().getErrors().forEach(e->{ - assertThat(e.getRowNumber()).isGreaterThan(0); - assertThat(e.getColumnNumber()).isGreaterThan(0); - }); - } - - @Test - public void testSchemaReferences() { - final Schema reportInputSchema = repository.getReportInputSchema(); - assertThat(reportInputSchema).isNotNull(); - } - -} diff --git a/src/test/java/de/kosit/validationtool/impl/SimpleScenarioCheck.java b/src/test/java/de/kosit/validationtool/impl/SimpleScenarioCheck.java index 1444646..331b1f2 100644 --- a/src/test/java/de/kosit/validationtool/impl/SimpleScenarioCheck.java +++ b/src/test/java/de/kosit/validationtool/impl/SimpleScenarioCheck.java @@ -49,7 +49,7 @@ public class SimpleScenarioCheck { public void testUnknown() throws MalformedURLException { final Result result = this.implementation.checkInput(InputFactory.read(Simple.UNKNOWN.toURL())); assertThat(result).isNotNull(); - assertThat(result.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.REJECT); + assertThat(result.isProcessingSuccessful()).isFalse(); } @Test diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java b/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java new file mode 100644 index 0000000..c41d726 --- /dev/null +++ b/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java @@ -0,0 +1,174 @@ +/* + * Licensed to the Koordinierungsstelle für IT-Standards (KoSIT) under + * one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. KoSIT licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package de.kosit.validationtool.impl.tasks; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.net.MalformedURLException; +import java.net.URI; + +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; + +import org.junit.Before; +import org.junit.Test; +import org.junit.rules.ExpectedException; + +import de.kosit.validationtool.api.Input; +import de.kosit.validationtool.api.InputFactory; +import de.kosit.validationtool.impl.ContentRepository; +import de.kosit.validationtool.impl.Helper; +import de.kosit.validationtool.impl.Helper.Simple; +import de.kosit.validationtool.impl.ObjectFactory; +import de.kosit.validationtool.impl.input.SourceInput; +import de.kosit.validationtool.impl.model.Result; +import de.kosit.validationtool.impl.tasks.CheckAction.Bag; +import de.kosit.validationtool.model.reportInput.CreateReportInput; +import de.kosit.validationtool.model.scenarios.ResourceType; +import de.kosit.validationtool.model.scenarios.ScenarioType; +import de.kosit.validationtool.model.scenarios.ValidateWithXmlSchema; + +/** + * Tests die {@link SchemaValidationAction}. + * + * @author Andreas Penski + */ +public class SchemaValidatorActionTest { + + public ExpectedException expectedException = ExpectedException.none(); + + private SchemaValidationAction service; + + private ContentRepository repository; + + @Before + public void setup() { + this.service = new SchemaValidationAction(); + this.repository = new ContentRepository(ObjectFactory.createProcessor(), Simple.REPOSITORY); + } + + + @Test + public void testSimple() throws MalformedURLException { + final CheckAction.Bag bag = createBag(InputFactory.read(Simple.SIMPLE_VALID.toURL())); + this.service.check(bag); + assertThat(bag.getSchemaValidationResult().isValid()).isTrue(); + assertThat(bag.getSchemaValidationResult()).isNotNull(); + assertThat(bag.getSchemaValidationResult().isValid()).isTrue(); + } + + @Test + public void testValidationFailure() throws MalformedURLException { + final Input input = InputFactory.read(Simple.INVALID.toURL()); + final CheckAction.Bag bag = createBag(input); + this.service.check(bag); + assertThat(bag.getSchemaValidationResult().isValid()).isFalse(); + bag.getSchemaValidationResult().getErrors().forEach(e->{ + assertThat(e.getRowNumber()).isGreaterThan(0); + assertThat(e.getColumnNumber()).isGreaterThan(0); + }); + } + + private Bag createBag(final Input input) { + final Bag bag = new Bag(input, new CreateReportInput()); + bag.setScenarioSelectionResult(new Result<>(createScenario(Helper.Simple.getSchemaLocation()))); + return bag; + } + + private ScenarioType createScenario(final URI schemafile) { + final ScenarioType t = new ScenarioType(); + final ValidateWithXmlSchema v = new ValidateWithXmlSchema(); + final ResourceType r = new ResourceType(); + r.setLocation(schemafile.getRawPath()); + r.setName("invoice"); + v.getResource().add(r); + t.setValidateWithXmlSchema(v); + t.initialize(this.repository, true); + return t; + } + + @Test + public void testSchemaReferences() { + final Schema reportInputSchema = this.repository.getReportInputSchema(); + assertThat(reportInputSchema).isNotNull(); + } + + @Test + public void testNoRepeatableRead() throws Exception { + try ( final InputStream inputStream = Simple.SIMPLE_VALID.toURL().openStream() ) { + final Bag bag = createBag(InputFactory.read(new StreamSource(inputStream))); + // don't read the real inputstream here! + bag.setParserResult(DocumentParseAction.parseDocument(InputFactory.read(Simple.SIMPLE_VALID.toURL()))); + this.service.check(bag); + assertThat(bag.getSchemaValidationResult()).isNotNull(); + assertThat(bag.getSchemaValidationResult().isValid()).isTrue(); + } + } + + @Test + public void testNoRepeatableReadBigFile() throws Exception { + try ( final InputStream inputStream = Simple.SIMPLE_VALID.toURL().openStream() ) { + final SourceInput input = (SourceInput) InputFactory.read(new StreamSource(inputStream)); + final Bag bag = createBag(input); + // set limit and length for serialization to 5 bytes + this.service.setInMemoryLimit(5L); + input.setLength(6L); + + bag.setParserResult(DocumentParseAction.parseDocument(InputFactory.read(Simple.SIMPLE_VALID.toURL()))); + this.service.check(bag); + assertThat(bag.getSchemaValidationResult()).isNotNull(); + assertThat(bag.getSchemaValidationResult().isValid()).isTrue(); + } + } + + @Test + public void testNoRepeatableReaderInput() throws Exception { + try ( final InputStream inputStream = Simple.SIMPLE_VALID.toURL().openStream(); + final Reader reader = new InputStreamReader(inputStream) ) { + final SourceInput input = (SourceInput) InputFactory.read(new StreamSource(reader)); + final Bag bag = createBag(input); + bag.setParserResult(DocumentParseAction.parseDocument(InputFactory.read(Simple.SIMPLE_VALID.toURL()))); + this.service.check(bag); + this.service.check(bag); + assertThat(bag.getSchemaValidationResult()).isNotNull(); + assertThat(bag.getSchemaValidationResult().isValid()).isTrue(); + } + } + + @Test + public void testNoRepeatableReaderInputBigFile() throws Exception { + try ( final InputStream inputStream = Simple.SIMPLE_VALID.toURL().openStream(); + final Reader reader = new InputStreamReader(inputStream) ) { + final SourceInput input = (SourceInput) InputFactory.read(new StreamSource(reader)); + final Bag bag = createBag(input); + // set limit and length for serialization to 5 bytes + this.service.setInMemoryLimit(5L); + bag.setParserResult(DocumentParseAction.parseDocument(InputFactory.read(Simple.SIMPLE_VALID.toURL()))); + this.service.check(bag); + this.service.check(bag); + assertThat(bag.getSchemaValidationResult()).isNotNull(); + assertThat(bag.getSchemaValidationResult().isValid()).isTrue(); + } + } + +} diff --git a/src/test/resources/examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL-invalid.xml b/src/test/resources/examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL-invalid.xml deleted file mode 100644 index 9cf75ea..0000000 --- a/src/test/resources/examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL-invalid.xml +++ /dev/null @@ -1,301 +0,0 @@ - - - - - - - urn:cen.eu:en16931:2017 - - urn:www.cenbii.eu:profile:bii04:ver2.0 - - 20170102 - 2017-02-16 - 2017-03-18 - 380 - 2017-02-16 - EUR - - RK20172013 - - 2017-02-14 - 2017-02-14 - - - - 20170205 - - - - - - UBL Platform - - - Readystreet 9a - Amsterdam - 9876 YZ - - NL - - - - - NL123456789B01 - - VAT - - - - UBL Ketentest BV - 12345678 - - - 06 987654321 - info@gbned.nl - - - - - - - - UBL Ready - - - Demostreet 1 - Arnhem - 1234 AB - - NL - - - - - - UBL Ready - - - John Doe - 070-1111111 - invoices@ublready.com - - - - - - 2017-02-16 - - - Stocklane 10 - Arnhem - 4321 BA - - NL - - - - - - - - 31 - - NL23ABNA0123456789 - - - ABNANL2A - - - - - - - Payments within 30 days. - - - - false - 64 - Invoice allowance (VAT low 6%) - 1 - 22 - 220 - - S - 6 - - VAT - - - - - false - 64 - Invoice allowance (VAT high 21%) - 1 - 18 - 180 - - S - 21 - - VAT - - - - - true - ZZZ - Handling costs - 10 - - S - 21 - - VAT - - - - - 48.00 - - 198 - 11.88 - - S - 6.00 - - VAT - - - - - 172 - 36.12 - - S - 21.00 - - VAT - - - - - - - 400.00 - 370.00 - 418.00 - 40.00 - 10.00 - 418.00 - - - - 5 - 1.00 - 50.00 - - Book The digital highway in Holland - The digital highway - - BK0232 - - - S - 6.00 - - VAT - - - - - 50.00 - 1.00 - - - - - 10 - 2.00 - 170.00 - - Book Coding UBL for orders and invoices - Coding UBL - - BK3025 - - - S - 6.00 - - VAT - - - - - 85.00 - 2.00 - - - - - 15 - 1.00 - 180.00 - - false - Price discount - 10 - 20.00 - 200 - - - Conversion softwarepackage to UBL - Conversion UBL - - SW4026 - - - S - 21.00 - - VAT - - - - - 200.00 - 1.00 - - - - diff --git a/src/test/resources/examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL.xml b/src/test/resources/examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL.xml deleted file mode 100644 index fd4d1d3..0000000 --- a/src/test/resources/examples/UBLReady/UBLReady_EU_UBL-NL_20170102_FULL.xml +++ /dev/null @@ -1,302 +0,0 @@ - - - - - - - urn:cen.eu:en16931:2017 - - urn:www.cenbii.eu:profile:bii04:ver2.0 - - 20170102 - 2017-02-16 - 2017-03-18 - 380 - 2017-02-16 - EUR - - RK20172013 - - 2017-02-14 - 2017-02-14 - - - - 20170205 - - - - - - UBL Platform - - - Readystreet 9a - Amsterdam - 9876 YZ - - NL - - - - - NL123456789B01 - - VAT - - - - UBL Ketentest BV - 12345678 - - - 06 987654321 - info@gbned.nl - - - - - - - - UBL Ready - - - Demostreet 1 - Arnhem - 1234 AB - - NL - - - - - - UBL Ready - - - John Doe - 070-1111111 - invoices@ublready.com - - - - - - 2017-02-16 - - - Stocklane 10 - Arnhem - 4321 BA - - NL - - - - - - - - 31 - - NL23ABNA0123456789 - - - ABNANL2A - - - - - - - Payments within 30 days. - - - - false - 64 - Invoice allowance (VAT low 6%) - 1 - 22 - 220 - - S - 6 - - VAT - - - - - false - 64 - Invoice allowance (VAT high 21%) - 1 - 18 - 180 - - S - 21 - - VAT - - - - - true - ZZZ - Handling costs - 10 - - S - 21 - - VAT - - - - - 48.00 - - 198 - 11.88 - - S - 6.00 - - VAT - - - - - 172 - 36.12 - - S - 21.00 - - VAT - - - - - - - 400.00 - 370.00 - 418.00 - 40.00 - 10.00 - 418.00 - - - - 5 - 1.00 - 50.00 - - Book The digital highway in Holland - The digital highway - - BK0232 - - - S - 6.00 - - VAT - - - - - 50.00 - 1.00 - - - - - 10 - 2.00 - 170.00 - - Book Coding UBL for orders and invoices - Coding UBL - - BK3025 - - - S - 6.00 - - VAT - - - - - 85.00 - 2.00 - - - - - 15 - 1.00 - 180.00 - - false - Price discount - 10 - 20.00 - 200 - - - Conversion softwarepackage to UBL - Conversion UBL - - SW4026 - - - S - 21.00 - - VAT - - - - - 200.00 - 1.00 - - - - - diff --git a/src/test/resources/examples/UBLReady/scenarios-2.xml b/src/test/resources/examples/invalid/scenarios-illforned.xml similarity index 52% rename from src/test/resources/examples/UBLReady/scenarios-2.xml rename to src/test/resources/examples/invalid/scenarios-illforned.xml index f2befec..e2e5e85 100644 --- a/src/test/resources/examples/UBLReady/scenarios-2.xml +++ b/src/test/resources/examples/invalid/scenarios-illforned.xml @@ -18,48 +18,42 @@ ~ under the License. --> - - XInneres + + HTML-TestSuite 2017-08-08 -

Prüft XInneres Nachrichten anhand der von uns offiziell herausgegebenen XML Schemata und Beispielen für mögliche weitergehende Prüfungen mit Schematron.

-

Prüft elektronische Rechnungen im Format UBL 2.1

+

Szenario für Tests

- UBL 2.1 Invoice - urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 - /invoice:Invoice + Simple + +

Nur Schemaprüfung.

+
+ http://www.xoev.de/de/validator/framework/1/createreportinput + http://validator.kosit.de/test-sample + http://validator.kosit.de/test-report + /test:simple - UBL 2.1 Invoice - resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd + Sample Schema + simple.xsd - - - BII Rules for Invoice - resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl - - - - - openPEPPOL Rules for Invoice - resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl - - Report für eRechnung - resources/eRechnung/report.xsl + report.xsl -
+ count(//cri:xmlSyntaxError) = 0 + + default - resources/eRechnung/default-report.xsl + report.xsl diff --git a/src/test/resources/examples/UBLReady/scenarios-1.xml b/src/test/resources/examples/invalid/scenarios.xml similarity index 64% rename from src/test/resources/examples/UBLReady/scenarios-1.xml rename to src/test/resources/examples/invalid/scenarios.xml index e6b6678..4dea43b 100644 --- a/src/test/resources/examples/UBLReady/scenarios-1.xml +++ b/src/test/resources/examples/invalid/scenarios.xml @@ -18,37 +18,35 @@ ~ under the License. --> - - XInneres + + HTML-TestSuite 2017-08-08 -

Prüft XInneres Nachrichten anhand der von uns offiziell herausgegebenen XML Schemata und Beispielen für mögliche weitergehende Prüfungen mit Schematron.

-

Prüft elektronische Rechnungen im Format UBL 2.1

+

Szenario für Tests

- UBL 2.1 Invoice - urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 - /invoice:Invoice + Simple - UBL 2.1 Invoice - resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd + Sample Schema + simple.xsd Report für eRechnung - - does-not-exist.xsl + report.xsl + count(//cri:xmlSyntaxError) = 0 + default - resources/eRechnung/report.xsl + report.xsl diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/CCTS_CCT_SchemaModule-2.1.xsd b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/CCTS_CCT_SchemaModule-2.1.xsd deleted file mode 100644 index 2bc034a..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/CCTS_CCT_SchemaModule-2.1.xsd +++ /dev/null @@ -1,769 +0,0 @@ - - - - - - - - - - - - - - - - UNDT000001 - CCT - Amount. Type - 1.0 - A number of monetary units specified in a currency where the unit of the currency is - explicit or implied. - - Amount - decimal - - - - - - - - UNDT000001-SC2 - SC - Amount Currency. Identifier - The currency of the amount. - Amount Currency - Identification - Identifier - string - Reference UNECE Rec 9, using 3-letter alphabetic codes. - - - - - - - UNDT000001-SC3 - SC - Amount Currency. Code List Version. Identifier - - The VersionID of the UN/ECE Rec9 code list. - Amount Currency - Code List Version - Identifier - string - - - - - - - - - - - - UNDT000002 - CCT - Binary Object. Type - 1.0 - A set of finite-length sequences of binary octets. - Binary Object - binary - - - - - - - - UNDT000002-SC2 - SC - Binary Object. Format. Text - The format of the binary content. - Binary Object - Format - Text - string - - - - - - - UNDT000002-SC3 - SC - Binary Object. Mime. Code - The mime type of the binary object. - Binary Object - Mime - Code - string - - - - - - - UNDT000002-SC4 - SC - Binary Object. Encoding. Code - Specifies the decoding algorithm of the binary object. - Binary Object - Encoding - Code - string - - - - - - - UNDT000002-SC5 - SC - Binary Object. Character Set. Code - The character set of the binary object if the mime type is text. - - Binary Object - Character Set - Code - string - - - - - - - UNDT000002-SC6 - SC - Binary Object. Uniform Resource. Identifier - - The Uniform Resource Identifier that identifies where the binary object is - located. - - Binary Object - Uniform Resource Identifier - Identifier - string - - - - - - - UNDT000002-SC7 - SC - Binary Object. Filename.Text - The filename of the binary object. - Binary Object - Filename - Text - string - - - - - - - - - - - - UNDT000007 - CCT - Code. Type - 1.0 - A character string (letters, figures, or symbols) that for brevity and/or languange - independence may be used to represent or replace a definitive value or text of an attribute together - with relevant supplementary information. - - Code - string - Should not be used if the character string identifies an instance of an object class or - an object in the real world, in which case the Identifier. Type should be used. - - - - - - - - - UNDT000007-SC2 - SC - Code List. Identifier - The identification of a list of codes. - Code List - Identification - Identifier - string - - - - - - - UNDT000007-SC3 - SC - Code List. Agency. Identifier - An agency that maintains one or more lists of codes. - Code List - Agency - Identifier - string - Defaults to the UN/EDIFACT data element 3055 code list. - - - - - - - UNDT000007-SC4 - SC - Code List. Agency Name. Text - The name of the agency that maintains the list of codes. - Code List - Agency Name - Text - string - - - - - - - UNDT000007-SC5 - SC - Code List. Name. Text - The name of a list of codes. - Code List - Name - Text - string - - - - - - - UNDT000007-SC6 - SC - Code List. Version. Identifier - The version of the list of codes. - Code List - Version - Identifier - string - - - - - - - UNDT000007-SC7 - SC - Code. Name. Text - The textual equivalent of the code content component. - Code - Name - Text - string - - - - - - - UNDT000007-SC8 - SC - Language. Identifier - The identifier of the language used in the code name. - Language - Identification - Identifier - string - - - - - - - UNDT000007-SC9 - SC - Code List. Uniform Resource. Identifier - The Uniform Resource Identifier that identifies where the code list is - located. - - Code List - Uniform Resource Identifier - Identifier - string - - - - - - - UNDT000007-SC10 - SC - Code List Scheme. Uniform Resource. Identifier - - The Uniform Resource Identifier that identifies where the code list scheme - is located. - - Code List Scheme - Uniform Resource Identifier - Identifier - string - - - - - - - - - - - - UNDT000008 - CCT - Date Time. Type - 1.0 - A particular point in the progression of time together with the relevant supplementary - information. - - Date Time - string - Can be used for a date and/or time. - - - - - - - - UNDT000008-SC1 - SC - Date Time. Format. Text - The format of the date time content - Date Time - Format - Text - string - - - - - - - - - - - - UNDT000011 - CCT - Identifier. Type - 1.0 - A character string to identify and distinguish uniquely, one instance of an object in - an identification scheme from all other objects in the same scheme together with relevant - supplementary information. - - Identifier - string - - - - - - - - UNDT000011-SC2 - SC - Identification Scheme. Identifier - The identification of the identification scheme. - Identification Scheme - Identification - Identifier - string - - - - - - - UNDT000011-SC3 - SC - Identification Scheme. Name. Text - The name of the identification scheme. - Identification Scheme - Name - Text - string - - - - - - - UNDT000011-SC4 - SC - Identification Scheme Agency. Identifier - - The identification of the agency that maintains the identification - scheme. - - Identification Scheme Agency - Identification - Identifier - string - Defaults to the UN/EDIFACT data element 3055 code list. - - - - - - - UNDT000011-SC5 - SC - Identification Scheme Agency. Name. Text - - The name of the agency that maintains the identification scheme. - - Identification Scheme Agency - Agency Name - Text - string - - - - - - - UNDT000011-SC6 - SC - Identification Scheme. Version. Identifier - - The version of the identification scheme. - Identification Scheme - Version - Identifier - string - - - - - - - UNDT000011-SC7 - SC - Identification Scheme Data. Uniform Resource. Identifier - - The Uniform Resource Identifier that identifies where the identification - scheme data is located. - - Identification Scheme Data - Uniform Resource Identifier - Identifier - string - - - - - - - UNDT000011-SC8 - SC - Identification Scheme. Uniform Resource. Identifier - - The Uniform Resource Identifier that identifies where the identification - scheme is located. - - Identification Scheme - Uniform Resource Identifier - Identifier - string - - - - - - - - - - - - UNDT000012 - CCT - Indicator. Type - 1.0 - A list of two mutually exclusive Boolean values that express the only possible states - of a Property. - - Indicator - string - - - - - - - - UNDT000012-SC2 - SC - Indicator. Format. Text - Whether the indicator is numeric, textual or binary. - Indicator - Format - Text - string - - - - - - - - - - - - UNDT000013 - CCT - Measure. Type - 1.0 - A numeric value determined by measuring an object along with the specified unit of - measure. - - Measure - decimal - - - - - - - - UNDT000013-SC2 - SC - Measure Unit. Code - The type of unit of measure. - Measure Unit - Code - Code - string - Reference UNECE Rec. 20 and X12 355 - - - - - - - UNDT000013-SC3 - SC - Measure Unit. Code List Version. Identifier - - The version of the measure unit code list. - Measure Unit - Code List Version - Identifier - string - - - - - - - - - - - - UNDT000014 - CCT - Numeric. Type - 1.0 - Numeric information that is assigned or is determined by calculation, counting, or - sequencing. It does not require a unit of quantity or unit of measure. - - Numeric - string - - - - - - - - UNDT000014-SC2 - SC - Numeric. Format. Text - Whether the number is an integer, decimal, real number or percentage. - - Numeric - Format - Text - string - - - - - - - - - - - - UNDT000018 - CCT - Quantity. Type - 1.0 - A counted number of non-monetary units possibly including fractions. - Quantity - decimal - - - - - - - - UNDT000018-SC2 - SC - Quantity. Unit. Code - The unit of the quantity - Quantity - Unit Code - Code - string - - - - - - - UNDT000018-SC3 - SC - Quantity Unit. Code List. Identifier - The quantity unit code list. - Quantity Unit - Code List - Identifier - string - - - - - - - UNDT000018-SC4 - SC - Quantity Unit. Code List Agency. Identifier - - The identification of the agency that maintains the quantity unit code - list - - Quantity Unit - Code List Agency - Identifier - string - Defaults to the UN/EDIFACT data element 3055 code list. - - - - - - - UNDT000018-SC5 - SC - Quantity Unit. Code List Agency Name. Text - - The name of the agency which maintains the quantity unit code list. - - Quantity Unit - Code List Agency Name - Text - string - - - - - - - - - - - - UNDT000019 - CCT - Text. Type - 1.0 - A character string (i.e. a finite set of characters) generally in the form of words of - a language. - - Text - string - - - - - - - - UNDT000019-SC2 - SC - Language. Identifier - The identifier of the language used in the content component. - - Language - Identification - Identifier - string - - - - - - - UNDT000019-SC3 - SC - Language. Locale. Identifier - The identification of the locale of the language. - Language - Locale - Identifier - string - - - - - - - diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonAggregateComponents-2.1.xsd b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonAggregateComponents-2.1.xsd deleted file mode 100644 index dc2e4c2..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonAggregateComponents-2.1.xsd +++ /dev/null @@ -1,4166 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonBasicComponents-2.1.xsd b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonBasicComponents-2.1.xsd deleted file mode 100644 index 435dd83..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonBasicComponents-2.1.xsd +++ /dev/null @@ -1,5394 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonExtensionComponents-2.1.xsd b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonExtensionComponents-2.1.xsd deleted file mode 100644 index 5ea3a39..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonExtensionComponents-2.1.xsd +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - - - - - - - - A container for all extensions present in the document. - - - - - - - A container for all extensions present in the document. - - - - - - - A single extension for private use. - - - - - - - - - A single extension for private use. - - - - - - - A single extension for private use. - - - - - - - An identifier for the Extension assigned by the creator of the extension. - - - - - - - A name for the Extension assigned by the creator of the extension. - - - - - - - An agency that maintains one or more Extensions. - - - - - - - The name of the agency that maintains the Extension. - - - - - - - The version of the Extension. - - - - - - - A URI for the Agency that maintains the Extension. - - - - - - - A URI for the Extension. - - - - - - - A code for reason the Extension is being included. - - - - - - - A description of the reason for the Extension. - - - - - - - The definition of the extension content. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonSignatureComponents-2.1.xsd b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonSignatureComponents-2.1.xsd deleted file mode 100644 index 027ae35..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonSignatureComponents-2.1.xsd +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CoreComponentParameters-2.1.xsd b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CoreComponentParameters-2.1.xsd deleted file mode 100644 index fbda5b8..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CoreComponentParameters-2.1.xsd +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-ExtensionContentDataType-2.1.xsd b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-ExtensionContentDataType-2.1.xsd deleted file mode 100644 index 9df0f4d..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-ExtensionContentDataType-2.1.xsd +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - Any element in any namespace other than the UBL extension - namespace is allowed to be the apex element of an extension. - Only those elements found in the UBL schemas and in the - trees of schemas imported in this module are validated. - Any element for which there is no schema declaration in any - of the trees of schemas passes validation and is not - treated as a schema constraint violation. - - - - - - - - \ No newline at end of file diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-QualifiedDataTypes-2.1.xsd b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-QualifiedDataTypes-2.1.xsd deleted file mode 100644 index 2d53c97..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-QualifiedDataTypes-2.1.xsd +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureAggregateComponents-2.1.xsd b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureAggregateComponents-2.1.xsd deleted file mode 100644 index bea5510..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureAggregateComponents-2.1.xsd +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - This is a single digital signature as defined by the W3C specification. - - - - - - - \ No newline at end of file diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureBasicComponents-2.1.xsd b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureBasicComponents-2.1.xsd deleted file mode 100644 index 0858978..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureBasicComponents-2.1.xsd +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-UnqualifiedDataTypes-2.1.xsd b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-UnqualifiedDataTypes-2.1.xsd deleted file mode 100644 index 8864e6e..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-UnqualifiedDataTypes-2.1.xsd +++ /dev/null @@ -1,554 +0,0 @@ - - - - - - - - - - UBLUDT000001 - UDT - Amount. Type - 1.0 - A number of monetary units specified using a given unit of currency. - Amount - - - - - - - - UNDT000001-SC2 - SC - Amount. Currency. Identifier - The currency of the amount. - Amount Currency - Identification - Identifier - string - Reference UNECE Rec 9, using 3-letter alphabetic codes. - - - - - - - - - - - UBLUDT000002 - UDT - Binary Object. Type - 1.0 - A set of finite-length sequences of binary octets. - Binary Object - binary - - - - - - - - UNDT000002-SC3 - SC - Binary Object. Mime. Code - The mime type of the binary object. - Binary Object - Mime - Code - string - - - - - - - - - - - UBLUDT000003 - UDT - Graphic. Type - 1.0 - A diagram, graph, mathematical curve, or similar representation. - Graphic - binary - - - - - - - - UNDT000003-SC3 - SC - Graphic. Mime. Code - The mime type of the graphic object. - Graphic - Mime - Code - normalizedString - - - - - - - - - - - UBLUDT000004 - UDT - Picture. Type - 1.0 - A diagram, graph, mathematical curve, or similar representation. - Picture - binary - - - - - - - - UNDT000004-SC3 - SC - Picture. Mime. Code - The mime type of the picture object. - Picture - Mime - Code - normalizedString - - - - - - - - - - - UBLUDT000005 - UDT - Sound. Type - 1.0 - An audio representation. - Sound - binary - - - - - - - - UNDT000005-SC3 - SC - Sound. Mime. Code - The mime type of the sound object. - Sound - Mime - Code - normalizedString - - - - - - - - - - - UBLUDT000006 - UDT - Video. Type - 1.0 - A video representation. - Video - binary - - - - - - - - UNDT000006-SC3 - SC - Video. Mime. Code - The mime type of the video object. - Video - Mime - Code - normalizedString - - - - - - - - - - - UBLUDT000007 - UDT - Code. Type - 1.0 - A character string (letters, figures, or symbols) that for brevity and/or language - independence may be used to represent or replace a definitive value or text of an attribute, - together with relevant supplementary information. - - Code - string - Other supplementary components in the CCT are captured as part of the token and name for - the schema module containing the code list and thus, are not declared as attributes. - - - - - - - - - - - - UBLUDT000008 - UDT - Date Time. Type - 1.0 - A particular point in the progression of time, together with relevant supplementary - information. - - Date Time - string - Can be used for a date and/or time. - - - - - - - - - - - UBLUDT000009 - UDT - Date. Type - 1.0 - One calendar day according the Gregorian calendar. - Date - string - - - - - - - - - - - UBLUDT0000010 - UDT - Time. Type - 1.0 - An instance of time that occurs every day. - Time - string - - - - - - - - - - - UBLUDT0000011 - UDT - Identifier. Type - 1.0 - A character string to identify and uniquely distinguish one instance of an object in an - identification scheme from all other objects in the same scheme, together with relevant - supplementary information. - - Identifier - string - Other supplementary components in the CCT are captured as part of the token and name for - the schema module containing the identifier list and thus, are not declared as attributes. - - - - - - - - - - - - UBLUDT0000012 - UDT - Indicator. Type - 1.0 - A list of two mutually exclusive Boolean values that express the only possible states - of a property. - - Indicator - string - - - - - - - - - - - UBLUDT0000013 - UDT - Measure. Type - 1.0 - A numeric value determined by measuring an object using a specified unit of measure. - - Measure - Type - decimal - - - - - - - - UNDT000013-SC2 - SC - Measure. Unit. Code - The type of unit of measure. - Measure Unit - Code - Code - normalizedString - Reference UNECE Rec. 20 and X12 355 - - - - - - - - - - - UBLUDT0000014 - UDT - Numeric. Type - 1.0 - Numeric information that is assigned or is determined by calculation, counting, or - sequencing. It does not require a unit of quantity or unit of measure. - - Numeric - string - - - - - - - - - - - UBLUDT0000015 - UDT - 1.0 - Value. Type - Numeric information that is assigned or is determined by calculation, counting, or - sequencing. It does not require a unit of quantity or unit of measure. - - Value - string - - - - - - - - - - - UBLUDT0000016 - UDT - 1.0 - Percent. Type - Numeric information that is assigned or is determined by calculation, counting, or - sequencing and is expressed as a percentage. It does not require a unit of quantity or unit of - measure. - - Percent - string - - - - - - - - - - - UBLUDT0000017 - UDT - 1.0 - Rate. Type - A numeric expression of a rate that is assigned or is determined by calculation, - counting, or sequencing. It does not require a unit of quantity or unit of measure. - - Rate - string - - - - - - - - - - - UBLUDT0000018 - UDT - Quantity. Type - 1.0 - A counted number of non-monetary units, possibly including a fractional part. - - Quantity - decimal - - - - - - - - - - - UBLUDT0000019 - UDT - Text. Type - 1.0 - A character string (i.e. a finite set of characters), generally in the form of words of - a language. - - Text - string - - - - - - - - - - - UBLUDT0000020 - UDT - Name. Type - 1.0 - A character string that constitutes the distinctive designation of a person, place, - thing or concept. - - Name - string - - - - - - - diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv132-2.1.xsd b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv132-2.1.xsd deleted file mode 100644 index 1d09373..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv132-2.1.xsd +++ /dev/null @@ -1,499 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv141-2.1.xsd b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv141-2.1.xsd deleted file mode 100644 index a0a098a..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv141-2.1.xsd +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-xmldsig-core-schema-2.1.xsd b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-xmldsig-core-schema-2.1.xsd deleted file mode 100644 index 8d19821..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-xmldsig-core-schema-2.1.xsd +++ /dev/null @@ -1,332 +0,0 @@ - - - - - - - - - ]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-CreditNote-2.1.xsd b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-CreditNote-2.1.xsd deleted file mode 100644 index eec54a0..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-CreditNote-2.1.xsd +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd deleted file mode 100644 index c1ae3f2..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl deleted file mode 100644 index 18c3d1e..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl +++ /dev/null @@ -1,1383 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / - - - - - - *: - - [namespace-uri()=' - - '] - - - - [ - - ] - - - - / - - @ - - - @*[local-name()=' - - ' and namespace-uri()=' - - '] - - - - - - - - - / - - - [ - - ] - - - - /@ - - - - - - - / - - - [ - - ] - - - - /@ - - - - - - - - - - - - - - - - - - - - - - - - . - - - - - U - - U - - - - U. - - n - - - - U. - - _ - - _ - - - - - - - - - - - - - - - - - - - - - - - UBL-T10 - UBL-T10 - - - - - - - - CodesT10 - CodesT10 - - - - - - - - BIIRULES T10 bound to UBL - - - - - - - - - - - - - - BII2-T10-R025 - fatal - - - - [BII2-T10-R025]-Each document level allowance or charge details MUST have an allowance - and charge reason text - - - - - - - - - - - BII2-T10-R043 - fatal - - - - [BII2-T10-R043]-Document level allowances and charges details MUST have allowance and - charge VAT category if the invoice has a VAT total amount - - - - - - - - - - - - - - - - - BII2-T10-R001 - fatal - - - - [BII2-T10-R001]-An invoice MUST have a customization identifier - - - - - - - - - - BII2-T10-R002 - fatal - - - - [BII2-T10-R002]-An invoice MUST have a business profile identifier - - - - - - - - - - BII2-T10-R003 - fatal - - - - [BII2-T10-R003]-An invoice MUST have an invoice identifier - - - - - - - - - - BII2-T10-R004 - fatal - - - - [BII2-T10-R004]-An invoice MUST have an invoice issue date - - - - - - - - - - BII2-T10-R005 - fatal - - - - [BII2-T10-R005]-An invoice MUST specify the currency code for the document - - - - - - - - - - BII2-T10-R006 - fatal - - - - [BII2-T10-R006]-An invoice MUST have a seller name and/or a seller identifier - - - - - - - - - - BII2-T10-R008 - fatal - - - - [BII2-T10-R008]-An invoice MUST have a buyer name and/or a buyer identifier - - - - - - - - - - BII2-T10-R010 - fatal - - - - [BII2-T10-R010]-An invoice MUST have the sum of line amounts - - - - - - - - - - BII2-T10-R011 - fatal - - - - [BII2-T10-R011]-An invoice MUST have the invoice total without VAT - - - - - - - - - - BII2-T10-R012 - fatal - - - - [BII2-T10-R012]-An invoice MUST have the invoice total with VAT (value of purchase) - - - - - - - - - - - BII2-T10-R013 - fatal - - - - [BII2-T10-R013]-An invoice MUST have the amount due for payment - - - - - - - - - - BII2-T10-R014 - fatal - - - - [BII2-T10-R014]-An invoice MUST have at least one invoice line - - - - - - - - - - BII2-T10-R015 - fatal - - - - [BII2-T10-R015]-An invoice MUST specify the VAT total amount, if there are VAT line - amounts - - - - - - - - - - - BII2-T10-R026 - fatal - - - - [BII2-T10-R026]-An invoice MUST contain VAT category details unless VAT total amount is - omitted. - - - - - - - - - - - BII2-T10-R035 - fatal - - - - [BII2-T10-R035]-Invoice total with VAT MUST NOT be negative - - - - - - - - - - BII2-T10-R037 - fatal - - - - [BII2-T10-R037]-Amount due for payment in an invoice MUST NOT be negative - - - - - - - - - - BII2-T10-R044 - fatal - - - - [BII2-T10-R044]-A seller VAT identifier MUST be provided if the invoice has a VAT total - amount - - - - - - - - - - - BII2-T10-R047 - fatal - - - - [BII2-T10-R047]-A buyer VAT identifier MUST be present if the VAT category code is - reverse VAT - - - - - - - - - - - BII2-T10-R048 - fatal - - - - [BII2-T10-R048]-An invoice with a VAT category code of reverse charge MUST NOT contain - other VAT categories. - - - - - - - - - - - BII2-T10-R058 - fatal - - - - [BII2-T10-R058]-Invoice total without VAT MUST be equal to the sum of VAT category - taxable amounts - - - - - - - - - - - - - - - - - BII2-T10-R017 - fatal - - - - [BII2-T10-R017]-Each invoice line MUST have an invoice line identifier - - - - - - - - - - BII2-T10-R018 - fatal - - - - [BII2-T10-R018]-Each invoice line MUST have an invoiced quantity - - - - - - - - - - BII2-T10-R019 - fatal - - - - [BII2-T10-R019]-Each invoice line MUST have a quantity unit of measure - - - - - - - - - - BII2-T10-R020 - fatal - - - - [BII2-T10-R020]-Each invoice line MUST have an invoice line net amount - - - - - - - - - - BII2-T10-R021 - fatal - - - - [BII2-T10-R021]-Each invoice line MUST have an invoice line item name and/or the invoice - line item identifier - - - - - - - - - - - BII2-T10-R032 - fatal - - - - [BII2-T10-R032]-A scheme identifier for the invoice line item registered identifier MUST - be provided if invoice line item registered identifiers are used to identify a product.(e.g. - GTIN) - - - - - - - - - - - BII2-T10-R033 - fatal - - - - [BII2-T10-R033]-A scheme identifier for a invoice line item commodity classification MUST - be provided if invoice line item commodity classification are used to classify an invoice line - item (e.g. CPV or UNSPSC) - - - - - - - - - - - BII2-T10-R034 - fatal - - - - [BII2-T10-R034]-Invoice line item net price MUST NOT be negative - - - - - - - - - - BII2-T10-R046 - fatal - - - - [BII2-T10-R046]-Each invoice line MUST be categorized with the invoice line VAT category - if the invoice has a VAT total amount - - - - - - - - - - - - - - - - - BII2-T10-R023 - fatal - - - - [BII2-T10-R023]-Each invoice period information MUST have an invoice period start date - - - - - - - - - - - BII2-T10-R024 - fatal - - - - [BII2-T10-R024]-Each invoice period information MUST have an invoice period end date - - - - - - - - - - - BII2-T10-R031 - fatal - - - - [BII2-T10-R031]-An invoice period end date MUST be later or equal to an invoice period - start date - - - - - - - - - - - - - - - - - BII2-T10-R039 - fatal - - - - [BII2-T10-R039]-An account identifier MUST be present if payment means type is funds - transfer - - - - - - - - - - - BII2-T10-R040 - fatal - - - - [BII2-T10-R040]-A sellers financial institution identifier MUST be provided if the scheme - of the account identifier is IBAN and the payment means is international bank transfer - - - - - - - - - - - BII2-T10-R041 - fatal - - - - [BII2-T10-R041]-A payment means MUST specify the payment means type - - - - - - - - - - BII2-T10-R042 - fatal - - - - [BII2-T10-R042]-A sellers financial institution identifier scheme MUST be BIC if the - scheme of the account identifier is IBAN and the payment means type is international account - transfer - - - - - - - - - - - - - - - - - BII2-T10-R051 - fatal - - - - [BII2-T10-R051]-Sum of line amounts MUST equal the invoice line net amounts - - - - - - - - - - BII2-T10-R052 - fatal - - - - [BII2-T10-R052]-An invoice total without VAT MUST equal the sum of line amounts plus the - sum of charges on document level minus the sum of allowances on document level - - - - - - - - - - - BII2-T10-R053 - fatal - - - - [BII2-T10-R053]-An invoice total with VAT MUST equal the invoice total without VAT plus - the VAT total amount and the rounding of invoice total - - - - - - - - - - - BII2-T10-R054 - fatal - - - - [BII2-T10-R054]-The sum of allowances at document level MUST be equal to the sum of - document level allowance amounts - - - - - - - - - - - BII2-T10-R055 - fatal - - - - [BII2-T10-R055]-The sum of charges at document level MUST be equal to the sum of document - level charge amounts - - - - - - - - - - - BII2-T10-R056 - fatal - - - - [BII2-T10-R056]-Amount due for payment MUST be equal to the invoice total amount with VAT - minus the paid amounts - - - - - - - - - - - - - - - - - BII2-T10-R027 - fatal - - - - [BII2-T10-R027]-Each VAT category details MUST have a VAT category taxable amount - - - - - - - - - - - BII2-T10-R028 - fatal - - - - [BII2-T10-R028]-Each VAT category details MUST have a VAT category tax amount - - - - - - - - - - BII2-T10-R029 - fatal - - - - [BII2-T10-R029]-Every VAT category details MUST be defined through a VAT category code - - - - - - - - - - - BII2-T10-R030 - fatal - - - - [BII2-T10-R030]-The VAT category percentage MUST be provided if the VAT category code is - standard. - - - - - - - - - - - BII2-T10-R045 - fatal - - - - [BII2-T10-R045]-A VAT exemption reason MUST be provided if the VAT category code is - exempt or reverse charge. - - - - - - - - - - - - - - - - - BII2-T10-R049 - fatal - - - - [BII2-T10-R049]-The invoice total without VAT MUST be equal to the VAT category taxable - amount if the VAT category code is reverse charge - - - - - - - - - - - BII2-T10-R050 - fatal - - - - [BII2-T10-R050]-The VAT category tax amount MUST be zero if the VAT category code is - reverse charge (since there is only one VAT category allowed it follows that the invoice tax - total for reverse charge invoices is zero) - - - - - - - - - - - - - - - - - - - - - - - - CL-T10-R001 - fatal - - - - [CL-T10-R001]-An Invoice MUST be coded with the InvoiceTypeCode code list UNCL D1001 BII2 - subset - - - - - - - - - - - - - - - - - CL-T10-R002 - fatal - - - - [CL-T10-R002]-DocumentCurrencyCode MUST be coded using ISO code list 4217 - - - - - - - - - - - - - - - - CL-T10-R003 - fatal - - - - [CL-T10-R003]-currencyID MUST be coded using ISO code list 4217 - - - - - - - - - - - - - - - - CL-T10-R004 - fatal - - - - [CL-T10-R004]-Country codes in an invoice MUST be coded using ISO code list 3166-1 - - - - - - - - - - - - - - - - - CL-T10-R006 - fatal - - - - [CL-T10-R006]-Payment means in an invoice MUST be coded using UNCL 4461 BII2 subset - - - - - - - - - - - - - - - - - CL-T10-R007 - fatal - - - - [CL-T10-R007]-Invoice tax categories MUST be coded using UNCL 5305 code list BII2 - subset - - - - - - - - - - - - - - - - - CL-T10-R008 - fatal - - - - [CL-T10-R008]-For Mime code in attribute use MIMEMediaType. - - - - - - - - - - - - - - - - CL-T10-R010 - warning - - - - [CL-T10-R010]-Coded allowance and charge reasons SHOULD belong to the UNCL 4465 code list - BII2 subset - - - - - - - - - - - diff --git a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl b/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl deleted file mode 100644 index 8b1dc3b..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl +++ /dev/null @@ -1,1243 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / - - - - - - *: - - [namespace-uri()=' - - '] - - - - [ - - ] - - - - / - - @ - - - @*[local-name()=' - - ' and namespace-uri()=' - - '] - - - - - - - - - / - - - [ - - ] - - - - /@ - - - - - - - / - - - [ - - ] - - - - /@ - - - - - - - - - - - - - - - - - - - - - - - - . - - - - - U - - U - - - - U. - - n - - - - U. - - _ - - _ - - - - - - - - - - - - - - - - - - - - - - - UBL-T10 - UBL-T10 - - - - - - - - CodesT10 - CodesT10 - - - - - - - - OPENPEPPOL T10 bound to UBL - - - - - - - - - - - - - - EUGEN-T10-R012 - fatal - - - - [EUGEN-T10-R012]-An allowance percentage MUST NOT be negative. - - - - - - - - - - EUGEN-T10-R022 - fatal - - - - [EUGEN-T10-R022]-An allowance or charge amount MUST NOT be negative. - - - - - - - - - - EUGEN-T10-R052 - fatal - - - - [EUGEN-T10-R052]-Document level amounts cannot have more than 2 decimals - - - - - - - - - - - - - - - - EUGEN-T10-R029 - fatal - - - - [EUGEN-T10-R029]-An allowance charge reason code MUST have a list identifier attribute - 'UNCL4465'. - - - - - - - - - - - - - - - - - EUGEN-T10-R027 - fatal - - - - [EUGEN-T10-R027]-A country identification code MUST have a list identifier attribute - 'ISO3166-1:Alpha2'. - - - - - - - - - - - - - - - - - EUGEN-T10-R026 - fatal - - - - [EUGEN-T10-R026]-A currency code element MUST have a list identifier attribute - 'ISO4217'. - - - - - - - - - - - - - - - - - EUGEN-T10-R036 - fatal - - - - [EUGEN-T10-R036]-An invoice MUST have a buyer name - - - - - - - - - - EUGEN-T10-R038 - fatal - - - - [EUGEN-T10-R038]-An invoice MUST have a buyer postal address - - - - - - - - - - EUGEN-T10-R040 - warning - - - - [EUGEN-T10-R040]-A customer SHOULD provide information about its legal entity - information - - - - - - - - - - - - - - - - - EUGEN-T10-R034 - fatal - - - - [EUGEN-T10-R034]-An delivery location identifier MUST have a scheme identifier - attribute. - - - - - - - - - - - - - - - - - EUGEN-T10-R033 - fatal - - - - [EUGEN-T10-R033]-A document type code MUST have a list identifier attribute 'UNCL1001'. - - - - - - - - - - - - - - - - - EUGEN-T10-R023 - fatal - - - - [EUGEN-T10-R023]-An endpoint identifier MUST have a scheme identifier attribute. - - - - - - - - - - - - - - - - - EUGEN-T10-R031 - fatal - - - - [EUGEN-T10-R031]-A financial account identifier MUST have a scheme identifier - attribute. - - - - - - - - - - - - - - - - - EUGEN-T10-R044 - fatal - - - - [EUGEN-T10-R044]-If the tax currency code is different from the document currency code, - the tax exchange rate MUST be provided - - - - - - - - - - - EUGEN-T10-R047 - warning - - - - [EUGEN-T10-R047]- An invoice should not contain empty elements - - - - - - - - - - EUGEN-T10-R053 - fatal - - - - [EUGEN-T10-R053]- An invoice must have an Invoice type code - - - - - - - - - - - - - - - - EUGEN-T10-R025 - fatal - - - - [EUGEN-T10-R025]-An invoice type code MUST have a list identifier attribute 'UNCL1001'. - - - - - - - - - - - - - - - - - EUGEN-T10-R054 - warning - - - - [EUGEN-T10-R054]-A party legal entity company identifier SHOULD have a scheme identifier - attribute. - - - - - - - - - - - - - - - - - EUGEN-T10-R024 - fatal - - - - [EUGEN-T10-R024]-A party identifier MUST have a scheme identifier attribute. - - - - - - - - - - - - - - - - EUGEN-T10-R004 - warning - - - - [EUGEN-T10-R004]-If the payment means are international account transfer and the account - id is IBAN then the financial institution should be identified by using the BIC id. - - - - - - - - - - - - - - - - - EUGEN-T10-R028 - fatal - - - - [EUGEN-T10-R028]-A payment means code MUST have a list identifier attribute 'UNCL4461'. - - - - - - - - - - - - - - - - - EUGEN-T10-R035 - fatal - - - - [EUGEN-T10-R035]-An invoice MUST have a seller name - - - - - - - - - - EUGEN-T10-R037 - fatal - - - - [EUGEN-T10-R037]-An invoice MUST have a seller postal address - - - - - - - - - - EUGEN-T10-R039 - warning - - - - [EUGEN-T10-R039]-A supplier SHOULD provide information about its legal entity - information - - - - - - - - - - - EUGEN-T10-R041 - warning - - - - [EUGEN-T10-R041]-The VAT identifier for the supplier SHOULD be prefixed with country code - for companies with VAT registration in EU countries - - - - - - - - - - - - - - - - - EUGEN-T10-R008 - fatal - - - - [EUGEN-T10-R008]-For each tax subcategory the category ID and the applicable tax - percentage MUST be provided. - - - - - - - - - - - - - - - - - EUGEN-T10-R032 - fatal - - - - [EUGEN-T10-R032]-A tax category identifier MUST have a scheme identifier attribute - 'UNCL5305'. - - - - - - - - - - - - - - - - - EUGEN-T10-R045 - fatal - - - - [EUGEN-T10-R045]-Tax exchange rate MUST specify the calculation rate and the operator - code. - - - - - - - - - - - - - - - - - EUGEN-T10-R043 - fatal - - - - [EUGEN-T10-R043]-The total tax amount MUST equal the sum of tax amounts per category. - - - - - - - - - - - EUGEN-T10-R049 - fatal - - - - [EUGEN-T10-R049]- Total tax amount cannot have more than 2 decimals. - - - - - - - - - - - - - - - - EUGEN-T10-R050 - fatal - - - - [EUGEN-T10-R050]- Tax subtotal amounts cannot have more than 2 decimals. - - - - - - - - - - EUGEN-T10-R051 - fatal - - - - [EUGEN-T10-R051]-Document level amounts cannot have more than 2 decimals - - - - - - - - - - EUGEN-T10-R042 - fatal - - - - [EUGEN-T10-R042]-The tax amount per category MUST be the taxable amount multiplied by the - category percentage. - - - - - - - - - - - EUGEN-T10-R046 - fatal - - - - [EUGEN-T10-R046]-If the tax currency code is different from the document currency code, - each tax subtotal has to include the tax amount in both currencies - - - - - - - - - - - - - - - - - EUGEN-T10-R030 - fatal - - - - [EUGEN-T10-R030]-A unit code attribute MUST have a unit code list identifier attribute - 'UNECERec20'. - - - - - - - - - - - - - - - - - EUGEN-T10-R048 - fatal - - - - [EUGEN-T10-R048]-Document level amounts cannot have more than 2 decimals - - - - - - - - - - - - - - - - - - - - - - - OP-T10-R001 - fatal - - - - [OP-T10-R001]-Contract document type code MUST be coded using UNCL 1001 list BII2 - subset. - - - - - - - - - - - - - - - - - OP-T10-R002 - fatal - - - - [OP-T10-R002]-An Endpoint Identifier Scheme MUST be from the list of PEPPOL Party - Identifiers described in the "PEPPOL Policy for using Identifiers". - - - - - - - - - - - - - - - - - OP-T10-R003 - fatal - - - - [OP-T10-R003]-An Party Identifier Scheme MUST be from the list of PEPPOL Party - Identifiers described in the "PEPPOL Policy for using Identifiers". - - - - - - - - - - - - - - - - - OP-T10-R004 - fatal - - - - [OP-T10-R004]-A payee account identifier scheme MUST be from the Account ID PEPPOL code - list - - - - - - - - - - - - - - - - - OP-T10-R006 - fatal - - - - [OP-T10-R006]-Unit code MUST be coded according to the UN/ECE Recommendation 20 - - - - - - - - - - - - - - - - - OP-T10-R008 - fatal - - - - [OP-T10-R008]-A Party Company Identifier Scheme MUST be from the list of PEPPOL Party - Identifiers described in the "PEPPOL Policy for using Identifiers". - - - - - - - - - - - - - - - - - OP-T10-R009 - fatal - - - - [OP-T10-R009]-TaxCurrencyCode MUST be coded using ISO code list 4217 - - - - - - - - - - - - - - - - OP-T10-R010 - fatal - - - - [OP-T10-R010]-SourceCurrencyCode MUST be coded using ISO code list 4217 - - - - - - - - - - - - - - - - OP-T10-R011 - fatal - - - - [OP-T10-R011]-TargetCurrencyCode MUST be coded using ISO code list 4217 - - - - - - - - - - diff --git a/src/test/resources/examples/repository/resources/eRechnung/default-report.xsl b/src/test/resources/examples/repository/resources/eRechnung/default-report.xsl deleted file mode 100644 index 413a4d7..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/default-report.xsl +++ /dev/null @@ -1,756 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - false - false - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Unexpected result from schematron validation - there is no - svrl:schematron-output element! - - - - - - - - - - - - - - - - - - - - - - - error - warning - information - warning - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Dies ist das zentrale Template des Skripts. Angewandt auf ein - report-Dokument ergänzt es dieses um eine Handlungsempfehlung in Form eines - accept - oder reject Elements. - - - - - - - - reject - reject - accept - - - - - - - - - - - Ermittelt für eine während der Validierung ausgegebene Fehlernachricht deren - Fehlerlevel (error, warning, information) gemäß der - benutzerspezifischen Qualifizierung. - - Jede Fehlernachricht hat im Rahmen der Validierung ein solches Fehlerlevel - erhalten (siehe Attribut @level). Im Regelfall entspricht die - benutzerspezifische Qualifizierung unverändert diesem Level. Nutzer können jedoch im - Rahmen der Bewertung eigene Qualifizierungen vereinbaren und in dem als Parameter - - übergebenen - assessment - Element für bestimmte, anhand des Fehlercodes identifizierten Fehlermeldungen eine - eigene Qualifizierung als customLevel festlegen. - - Dies kann z. B. genutzt werden, um einen error, der ansonsten zur - Rückweisung der Nachricht führen würde, zumindest zeitweilig als - warning - zu qualifizieren, so dass eine entsprechende - Dokumenteninstanz trotz einer Warnung angenommen und verarbeitet würde. - - Die Funktion prüft für eine Fehlernachricht, ob deren @code Attribut - Bestandteil der für ein bestimmtes customLevel des - - Parameters angegebenen Fehlercodes ist. - Falls ja, dann gilt das jeweilige customLevel. Andernfalls wird der im - Rahmen der Validierung ermittelte Fehlerlevel unverändert übernommen. - - - Eine im Rahmen der Validierung ausgegebene - Fehlernachricht - - - - - - - - - - - - - - - - - - - - - - - - - - - Generiert das head Element eines eingebetteten HTML Dokuments, - welches den Prüf- und Bewertungsbericht visualisiert und die Handlungsempfehlung - begründet - - - - - - Prüfbericht - - - - - -

Prüfbericht

- - - - - - - - - - - - - - - - - - -
- - - - - Generiert am Beginn eines eingebetteten HTML Dokuments, welches den Prüf- und - Bewertungsbericht visualisiert und die Handlungsempfehlung begründet, eine Übersicht - mit Metadaten des geprüften Dokuments. - - - - - - - - - - - - Generiert am Ende eines eingebetteten HTML Dokuments, welches den Prüf- und - Bewertungsbericht visualisiert und die Handlungsempfehlung begründet, eine Übersicht - mit Metadaten zum Prüfmodul. - - - - -

- Dieser Prüfbericht wurde erstellt mit - - . -

-
- - - - Generiert in dem eingebetetteten HTML Dokument eine Tabelle mit den während der - Validierung ausgegebenen Daten. - - - - -

Übersicht der Validierungsergebnisse:

- - - - - - - - - - - - - - - - - - - - -
PrüfschrittFehlerWarnungenInformationen
- - ( - - ) - - - - - - -
- -

Validierungsergebnisse im Detail:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PosCodeAdj. Grad (Grad)Text
- - - - - - - - - - -
- - Pfad: - - - Zeile: - - - Spalte: - -
-
- - - - Generiert in dem eingebetteten HTML Dokument eine Aussage zur Konformität des - geprüften Dokuments zu den formalen Vorgaben. - - - - - - - - -

- Konformitätsprüfung: - Das geprüfte Dokument enthält - - - weder Fehler noch Warnungen. Es ist konform zu den formalen Vorgaben. - - - - nicht konform - zu den formalen Vorgaben. - - -

-
- -

- Konformitätsprüfung: - Das geprüfte Dokument entspricht keinen zulässigen Dokumenttyp und ist damit - nicht konform - zu den formalen Vorgaben. -

-
-
- -
- - - - Generiert in dem eingebetteten HTML Dokument die Aussage zur - Handlungsempfehlung. - - - - - - - - -

Bewertung: Es wird empfohlen das Dokument zurückzuweisen.

-
- -

Bewertung: Es wird empfohlen das Dokument anzunehmen und weiter zu verarbeiten.

-
- -

Bewertung: Es wird empfohlen das Dokument anzunehmen und zu verarbeiten, da die - vorhandenen Fehler derzeit toleriert werden. -

-
- -

Bewertung: Es wird empfohlen das Dokument zurückzuweisen.

-
-
-
- - - - -

- Inhalt des Rechnungsdokuments: -

- - -
-
- - - - Eine Element wird als eine Zeile in einer Tabelle visualisiert. Die erste Spalte - enthält die Zeilennummer, die zweite Attribute und Text des Elements - - - - - - - - - - - - - - - - - - - - - - Ein Textbereich (in der Zeile des Elements) - - - -
- -
-
- - -
- [ … ] -
-
- - - - - - Ein Attributbereich (in der Zeile des Elements) - - - -
- -
-
- - -
\ No newline at end of file diff --git a/src/test/resources/examples/repository/resources/eRechnung/report.xsl b/src/test/resources/examples/repository/resources/eRechnung/report.xsl deleted file mode 100644 index bf1dafe..0000000 --- a/src/test/resources/examples/repository/resources/eRechnung/report.xsl +++ /dev/null @@ -1,607 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Unexpected result from schematron validation - there is no svrl:schematron-output element! - - - - - - - - - - - - - - - - - error - warning - information - warning - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - step_ - - - - - - - - - - message_ - - - - - - - - - - - - - - - Dies ist das zentrale Template des Skripts. Angewandt auf ein - validationReport-Dokument, und unter Nutzung des Parameters wird eine Handlungsempfehlung in Form eines - accept oder reject Elements erstellt, welches eine - Begründung der jeweiligen Empfehlung enthalten kann. - Das Template realisiert eine Funktion f:validationReport, assessment → - suggestion - - - - - - - - - - - - - - - - - - - - - Ermittelt für eine während der Validierung ausgegebene Fehlernachricht deren - Fehlerlevel (error, warning, information) gemäß der - benutzerspezifischen Qualifizierung. - Jede Fehlernachricht hat im Rahmen der Validierung ein solches Fehlerlevel - erhalten (siehe Attribut @level). Im Regelfall entspricht die - benutzerspezifische Qualifizierung unverändert diesem Level. Nutzer können jedoch im - Rahmen der Bewertung eigene Qualifizierungen vereinbaren und in dem als Parameter - übergebenen assessment - Element für bestimmte, anhand des Fehlercodes identifizierten Fehlermeldungen eine - eigene Qualifizierung als customLevel festlegen. - Dies kann z. B. genutzt werden, um einen error, der ansonsten zur - Rückweisung der Nachricht führen würde, zumindest zeitweilig als - warning zu qualifizieren, so dass eine entsprechende - Dokumenteninstanz trotz einer Warnung angenommen und verarbeitet würde. - Die Funktion prüft für eine Fehlernachricht, ob deren @code Attribut - Bestandteil der für ein bestimmtes customLevel des Parameters angegebenen Fehlercodes ist. - Falls ja, dann gilt das jeweilige customLevel. Andernfalls wird der im - Rahmen der Validierung ermittelte Fehlerlevel unverändert übernommen. - - Eine im Rahmen der Validierung ausgegebene - Fehlernachricht - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Generiert das head Element eines eingebetteten HTML Dokuments, - welches den Prüf- und Bewertungsbericht visualisiert und die Handlungsempfehlung - begründet - - - - - Pruefbericht der KoSIT - - - - - - - Generiert die Überschrift des eines eingebetteten HTML Dokuments, welches den - Prüf- und Bewertungsbericht visualisiert und die Handlungsempfehlung - begründet - - - -

Prüfbericht der KoSIT

-
- - - - Generiert am Beginn eines eingebetteten HTML Dokuments, welches den Prüf- und - Bewertungsbericht visualisiert und die Handlungsempfehlung begründet, eine Übersicht - mit Metadaten des geprüften Dokuments. - - - -

- Angaben zum geprüften Dokument -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Prüfbericht Nr. - -
Dokument: - -
Szenario: - -
Zeitpunkt: - -
Validierungsschritte:FehlerWarnungInformation
- - - - - - - - - -
-
- - - - Generiert am Ende eines eingebetteten HTML Dokuments, welches den Prüf- und - Bewertungsbericht visualisiert und die Handlungsempfehlung begründet, eine Übersicht - mit Metadaten zum Prüfmodul. - - - -

- Erstellt mit: - - für das InstructionSet - - - - vom - - . -

-
- - - - Generiert in dem eingebetetteten HTML Dokument eine Tabelle mit den während der - Validierung ausgegebenen Daten. - - - - - - - - - - -
-
- - - - Generiert in der HTML-Tabelle der Validierungsnachtichten in dem eingebetteten - HTML Dokument dn Tabellenkopf - - - - - - Pos - Code - CustomLevel (Level) - Step - Text - - - - - - - Generiert in der HTML-Tabelle der Validierungsnachtichten in dem eingebetteten - HTML Dokument eine oder mehrere Zeilen pro Validierungsnachricht - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Generiert in dem eingebetteten HTML Dokument eine Aussage zur Konformität des - geprüften Dokuments zu den formalen Vorgaben. - - - - - -

- Konformitätsprüfung: - Das geprüfte Dokument enthält - - - weder Fehler noch Warnungen. Es ist konform zu den formalen Vorgaben. - - - - nicht konform - zu den formalen Vorgaben. - - -

-
- - - - Generiert in dem eingebetteten HTML Dokument die Aussage zur - Handlungsempfehlung. - - - - - -

- Bewertung: - - - Es wird empfohlen das Dokument anzunehmen un weiter zu verarbeiten. - - - Es wird empfohlen das Dokument anzunehmen und zu verarbeiten, da die vorhandenen Fehler derzeit toleriert werden. - - - Es wird empfohlen das Dokument zurückzuweisen. - - -

-
- - -
\ No newline at end of file diff --git a/src/test/resources/examples/simple/input/simple.xml b/src/test/resources/examples/simple/input/simple.xml index 63032b1..4f0df5a 100644 --- a/src/test/resources/examples/simple/input/simple.xml +++ b/src/test/resources/examples/simple/input/simple.xml @@ -2,4 +2,14 @@ asldkfj + + + + + + +
some data
+ + +
\ No newline at end of file diff --git a/src/test/resources/examples/simple/repository/simple.xsd b/src/test/resources/examples/simple/repository/simple.xsd index b7f2b68..30ba1f4 100644 --- a/src/test/resources/examples/simple/repository/simple.xsd +++ b/src/test/resources/examples/simple/repository/simple.xsd @@ -1,7 +1,6 @@ + targetNamespace="http://validator.kosit.de/test-sample" elementFormDefault="qualified"> @@ -9,6 +8,7 @@ + - \ No newline at end of file + \ No newline at end of file diff --git a/src/test/resources/invalid/scenarios-illformed.xml b/src/test/resources/invalid/scenarios-illformed.xml deleted file mode 100644 index b7d5569..0000000 --- a/src/test/resources/invalid/scenarios-illformed.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - XInneres - 2017-08-08 - -

Prüft XInneres Nachrichten anhand der von uns offiziell herausgegebenen XML Schemata und Beispielen für mögliche weitergehende Prüfungen mit Schematron.

-

Prüft elektronische Rechnungen im Format UBL 2.1

-
- - - XMeld 2.1 - http://www.osci.de/xmeld21 - /xmeld:* - - - XML Schema von XMeld 2.1 (aggregiert) - resources/xmeld21/xmeld-nachrichten.xsd - - - - - XInneres Prüfregeln - resources/xmeld21/xinneres-pruefregeln.xsl - - - - - Default Report - resources/default/report.xsl - - - - - - UBL 2.1 Invoice - urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 - /invoice:Invoice - - - - UBL 2.1 Invoice - resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd - - - - - BII Rules for Invoice - resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/BIIRULES-UBL-T10.xsl - - - - - openPEPPOL Rules for Invoice - resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/OPENPEPPOL-UBL-T10.xsl - - - - - Report für eRechnung - - resources/eRechnung/report-erechnung.xsl - - EUGEN-T110-R019 - - - - -
diff --git a/src/test/resources/invalid/scenarios-invalid.xml b/src/test/resources/invalid/scenarios-invalid.xml deleted file mode 100644 index 9ef90e1..0000000 --- a/src/test/resources/invalid/scenarios-invalid.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - XInneres - 2017-08-08 - -

Prüft XInneres Nachrichten anhand der von uns offiziell herausgegebenen XML Schemata und Beispielen für - mögliche weitergehende Prüfungen mit Schematron. -

-

Prüft elektronische Rechnungen im Format UBL 2.1

-
- - - XMeld 2.1 - http://www.osci.de/xmeld21 - /xmeld:* - - - - XInneres Prüfregeln - resources/xmeld21/xinneres-pruefregeln.xsl - - - - - Default Report - resources/default/report.xsl - - - - - - UBL 2.1 Invoice - urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 - /invoice:Invoice - - - - UBL 2.1 Invoice - resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd - - - - - BII Rules for Invoice - resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/BIIRULES-UBL-T10.xsl - - - - - openPEPPOL Rules for Invoice - resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/OPENPEPPOL-UBL-T10.xsl - - - - - Report für eRechnung - - resources/eRechnung/report-erechnung.xsl - - EUGEN-T110-R019 - - - - -
diff --git a/src/test/resources/simple/main.xsd b/src/test/resources/loading/main.xsd similarity index 100% rename from src/test/resources/simple/main.xsd rename to src/test/resources/loading/main.xsd diff --git a/src/test/resources/loading/resources/reference.xsd b/src/test/resources/loading/resources/reference.xsd new file mode 100644 index 0000000..6f92671 --- /dev/null +++ b/src/test/resources/loading/resources/reference.xsd @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/simple/resources/reference.xsd b/src/test/resources/simple/resources/reference.xsd deleted file mode 100644 index 4c55ec8..0000000 --- a/src/test/resources/simple/resources/reference.xsd +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/test/resources/valid/report.xml b/src/test/resources/valid/report.xml deleted file mode 100644 index ce52c82..0000000 --- a/src/test/resources/valid/report.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - Prüfmodul der KoSIT POC - - - 2017-08-17T12:00:00 - - - - fake - 0x0c - - ABHanAZR_AllesKorrekt.xml - - - - UBL 2.1 Invoice - urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 - /invoice:Invoice - - - UBL 2.1 Invoice - resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd - - - - - BII Rules for Invoice - resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/BIIRULES-UBL-T10.xsl - - - - - openPEPPOL Rules for Invoice - resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/OPENPEPPOL-UBL-T10.xsl - - - - - Report für eRechnung - resources/eRechnung/report-erechnung.xsl - - - - - - 123 - ABC GmbH - - - - - - UBL 2.1 Invoice - resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd - - - - - - - openPEPPOL Rules for Invoice - ../resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/OPENPEPPOL-UBL-T10.xsl - - [EUGEN-T110-R025]-UBLVersionID must be 2.1 - - - - - - EUGEN-T110-R024 - - - ... - - - - - - diff --git a/src/test/resources/valid/scenarios.xml b/src/test/resources/valid/scenarios.xml deleted file mode 100644 index 426e90c..0000000 --- a/src/test/resources/valid/scenarios.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - XInneres - 2017-08-08 - -

Prüft XInneres Nachrichten anhand der von uns offiziell herausgegebenen XML Schemata und Beispielen für mögliche weitergehende Prüfungen mit Schematron.

-

Prüft elektronische Rechnungen im Format UBL 2.1

-
- - - XMeld 2.1 - http://www.osci.de/xmeld21 - /xmeld:* - - - XML Schema von XMeld 2.1 (aggregiert) - resources/xmeld21/xmeld-nachrichten.xsd - - - - - XInneres Prüfregeln - resources/xmeld21/xinneres-pruefregeln.xsl - - - - - Default Report - resources/default/report.xsl - - - - - - UBL 2.1 Invoice - urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 - /invoice:Invoice - - - - UBL 2.1 Invoice - resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd - - - - - BII Rules for Invoice - resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/BIIRULES-UBL-T10.xsl - - - - - openPEPPOL Rules for Invoice - resources/eRechnung/BIS2.0-VA-V3.4.0/XSLT/OPENPEPPOL-UBL-T10.xsl - - - - - Report für eRechnung - - resources/eRechnung/report-erechnung.xsl - - EUGEN-T110-R019 - - - - - - default - resources/eRechnung/report.xsl - - - -