From 79920244518aac7f1070babc48e46aad6c8472fd Mon Sep 17 00:00:00 2001 From: renzo <36152255+rkottmann@users.noreply.github.com> Date: Thu, 20 Dec 2018 01:52:42 +0100 Subject: [PATCH 01/12] Grammar --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index bb237a2..04c9faf 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,7 @@ Fach- bzw. Standardspezifische Prüfkonfigurationen sind in eigene Module bzw. R ## Prüfkonfiguration XRechnung -Eine eigenständige Konfiguration für den Standard XRechnung wird ebenfalls auf [GitHub bereitgestellt](https://github.com/itplr-kosit/validator-configuration-xrechnung) ([Releases](https://github.com/itplr-kosit/validator-configuration-xrechnung/releases)). Diese enthält alle notwendigen Resourcen zu der Norm EN16931 (XML-Schema und [Schematron Regeln] (https://github.com/CenPC434/validation) u.a.) und die Resourcen des Standards -[XRechnung](http://www.xoev.de/de/xrechnung) in ihren aktuellen Entwurfsversionen. +Eine eigenständige Konfiguration für den Standard [XRechnung](http://www.xoev.de/de/xrechnung) wird ebenfalls auf [GitHub bereitgestellt](https://github.com/itplr-kosit/validator-configuration-xrechnung) ([Releases](https://github.com/itplr-kosit/validator-configuration-xrechnung/releases)). Diese enthält alle notwendigen Ressourcen zu der Norm EN16931 (XML-Schema und [Schematron Regeln] (https://github.com/CenPC434/validation) u.a.) und die [XRechnung Schematron Regeln](https://github.com/itplr-kosit/xrechnung-schematron) in ihren aktuellen Versionen. Der geregelte Betrieb dieser Konfiguration wird im Rahmen des Betriebs des Standards XRechnung erfolgen. From 066974886b335cedeb3502f572388ec28583fc20 Mon Sep 17 00:00:00 2001 From: apenski Date: Thu, 7 Feb 2019 15:29:31 +0100 Subject: [PATCH 02/12] #19 Sequentialisierung der Verarbeitung (#21) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dateien werden erst gelesen, wenn sie verarbeitet werden. Ergebnisse von vorherigen Läufen werden nicht mehr Speicher gehalten bis alle Dateien verarbeitet sind --- .../cmd/CommandLineApplication.java | 18 ++++++--- .../validationtool/cmd/InternalCheck.java | 38 ++++++++----------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java index eb89024..1ce602d 100644 --- a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java +++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java @@ -28,10 +28,15 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.List; import java.util.stream.Collectors; -import org.apache.commons.cli.*; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.DefaultParser; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; import org.apache.commons.lang3.StringUtils; import lombok.extern.slf4j.Slf4j; @@ -151,9 +156,12 @@ public class CommandLineApplication { final Collection targets = determineTestTargets(cmd); start = System.currentTimeMillis(); - final List input = targets.stream().map(InputFactory::read).collect(Collectors.toList()); - boolean result = check.checkInput(input); - log.info("Processing {} object(s) completed in {}ms", input.size(), System.currentTimeMillis() - start); + for (Path p : targets) { + final Input input = InputFactory.read(p); + check.checkInput(input); + } + boolean result = check.printAndEvaluate(); + log.info("Processing {} object(s) completed in {}ms", targets.size(), System.currentTimeMillis() - start); return result ? 0 : 1; } catch (Exception e) { diff --git a/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java b/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java index 471f7c7..06a45f4 100644 --- a/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java +++ b/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java @@ -19,16 +19,12 @@ package de.kosit.validationtool.cmd; +import lombok.extern.slf4j.Slf4j; + import de.kosit.validationtool.api.CheckConfiguration; import de.kosit.validationtool.api.Input; import de.kosit.validationtool.impl.DefaultCheck; -import de.kosit.validationtool.impl.model.Result; import de.kosit.validationtool.impl.tasks.CheckAction; -import lombok.extern.slf4j.Slf4j; - -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; /** * Simple Erweiterung der Klasse {@link DefaultCheck} um das Ergebnis der Assertion-Prüfung auszwerten und auszugeben. @@ -39,12 +35,16 @@ import java.util.stream.Collectors; @Slf4j class InternalCheck extends DefaultCheck { + private int checkAssertions = 0; + + private int failedAssertions = 0; + /** * Erzeugt eine neue Instanz mit der angegebenen Konfiguration. * * @param configuration die Konfiguration */ - public InternalCheck(CheckConfiguration configuration) { + InternalCheck(CheckConfiguration configuration) { super(configuration); } @@ -54,24 +54,16 @@ class InternalCheck extends DefaultCheck { * @param input die Prüflinge * @return false wenn es Assertion-Fehler gibt, sonst true */ - public boolean checkInput(List input) { - List results = new ArrayList<>(); - input.forEach(i -> { - CheckAction.Bag bag = new CheckAction.Bag(i, createReport()); - runCheckInternal(bag); - results.add(bag); - }); - - return printAndEvaluate(results); - + void checkInput(Input input) { + CheckAction.Bag bag = new CheckAction.Bag(input, createReport()); + runCheckInternal(bag); + if (bag.getAssertionResult() != null) { + checkAssertions += bag.getAssertionResult().getObject(); + failedAssertions += bag.getAssertionResult().getErrors().size(); + } } - private boolean printAndEvaluate(List results) { - final List> asserts = results.stream().filter(r -> r.getAssertionResult() != null) - .map(CheckAction.Bag::getAssertionResult).collect(Collectors.toList()); - int checkAssertions = asserts.stream().mapToInt(e -> e.getObject()).sum(); - int failedAssertions = asserts.stream().mapToInt(e -> e.getErrors().size()).sum(); - + public boolean printAndEvaluate() { if (failedAssertions > 0) { log.error("Assertion check failed.\n\nAssertions run: {}, Assertions failed: {}\n", checkAssertions, failedAssertions); } else if (checkAssertions > 0) { From 70bbcf25891437dcdf35dba5e1fe337d31f28eb2 Mon Sep 17 00:00:00 2001 From: "Andreas Penski (init)" Date: Fri, 8 Feb 2019 07:50:31 +0100 Subject: [PATCH 03/12] (chore) Erstellung der alten Dist-Zips wiederhergestellt --- dist/assembly-full.xml | 56 ----------- dist/assembly-standalone.xml | 36 ------- dist/pom.xml | 135 --------------------------- pom.xml | 41 ++++++-- src/assembly/assembly-full.xml | 56 +++++++++++ src/assembly/assembly-standalone.xml | 46 +++++++++ 6 files changed, 135 insertions(+), 235 deletions(-) delete mode 100644 dist/assembly-full.xml delete mode 100644 dist/assembly-standalone.xml delete mode 100644 dist/pom.xml create mode 100644 src/assembly/assembly-full.xml create mode 100644 src/assembly/assembly-standalone.xml diff --git a/dist/assembly-full.xml b/dist/assembly-full.xml deleted file mode 100644 index 221a6d3..0000000 --- a/dist/assembly-full.xml +++ /dev/null @@ -1,56 +0,0 @@ - - full - - dir - zip - - false - - - ${project.parent.basedir} - / - - LICENSE* - NOTICE* - - - - - - - / - false - runtime - ${artifact.artifactId}-${artifact.baseVersion}-${artifact.classifier}.${artifact.extension} - - ${project.groupId}:validationtool:jar:*:standalone - ${project.groupId}:validationtool:jar:*:full - ${project.groupId}:validationtool:jar:*:sources - - - - / - false - runtime - ${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension} - - ${project.groupId}:validationtool - - - - /libs - false - runtime - ${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension} - - ${project.groupId}:validationtool - - - - - \ No newline at end of file diff --git a/dist/assembly-standalone.xml b/dist/assembly-standalone.xml deleted file mode 100644 index 9b625cf..0000000 --- a/dist/assembly-standalone.xml +++ /dev/null @@ -1,36 +0,0 @@ - - standalone - - dir - zip - - false - - - ${project.parent.basedir} - / - - LICENSE* - NOTICE* - - - - - - - / - false - runtime - ${artifact.artifactId}-${artifact.baseVersion}-${artifact.classifier}.${artifact.extension} - - ${project.groupId}:validationtool:jar:*:standalone - ${project.groupId}:validationtool:jar:*:sources - - - - \ No newline at end of file diff --git a/dist/pom.xml b/dist/pom.xml deleted file mode 100644 index 24e5ef0..0000000 --- a/dist/pom.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - - - 4.0.0 - - de.kosit - validationtool-base - 1.0.2-SNAPSHOT - ../ - - validationtool-dist - pom - KoSIT XML Prüftool Distribution - KoSIT XML Prüftool zur Prüfung von XML Dateien gegenüber definierten Szenarien. - - - - UTF-8 - - - - - de.kosit - validationtool - ${project.version} - - - de.kosit - validationtool - ${project.version} - standalone - - - de.kosit - validationtool - ${project.version} - sources - - - de.kosit - validationtool - ${project.version} - full - - - - - - - - maven-assembly-plugin - 3.1.0 - - - standalone - package - - single - - - - assembly-standalone.xml - - true - true - target/ - target/assembly/standalone - - - - full - package - - single - - - - assembly-full.xml - - true - true - target/ - target/assembly/full - - - - - - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index 724d50c..9caa98d 100644 --- a/pom.xml +++ b/pom.xml @@ -191,6 +191,38 @@ + + standalone_dist + package + + single + + + + src/assembly/assembly-standalone.xml + + true + true + target/ + target/assembly/standalone + + + + full_dist + package + + single + + + + src/assembly/assembly-full.xml + + true + true + target/ + target/assembly/full + + @@ -298,14 +330,7 @@ - - org.apache.maven.plugins - maven-release-plugin - 2.5.3 - - v@{project.version} - - + org.apache.maven.plugins maven-release-plugin diff --git a/src/assembly/assembly-full.xml b/src/assembly/assembly-full.xml new file mode 100644 index 0000000..353f67f --- /dev/null +++ b/src/assembly/assembly-full.xml @@ -0,0 +1,56 @@ + + + + full + + dir + zip + + false + + + ${project.basedir} + / + + LICENSE* + NOTICE* + + + + ${project.build.directory} + / + + validationtool-*.jar + + + + + + + /libs + false + runtime + ${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension} + + + + \ No newline at end of file diff --git a/src/assembly/assembly-standalone.xml b/src/assembly/assembly-standalone.xml new file mode 100644 index 0000000..55eeb08 --- /dev/null +++ b/src/assembly/assembly-standalone.xml @@ -0,0 +1,46 @@ + + + + standalone + + dir + zip + + false + + + ${project.basedir} + / + + LICENSE* + NOTICE* + + + + ${project.build.directory} + / + + validationtool-*standalone.jar + + + + \ No newline at end of file From ccfe53b7ac2cd61caadb416832c375a5458784fd Mon Sep 17 00:00:00 2001 From: "Andreas Penski (init)" Date: Fri, 8 Feb 2019 07:55:12 +0100 Subject: [PATCH 04/12] (chore) release plugin config erweitert --- pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pom.xml b/pom.xml index 9caa98d..835a668 100644 --- a/pom.xml +++ b/pom.xml @@ -344,6 +344,8 @@ https://github.com/itplr-kosit/validationtool.git + scm:git:https://github.com/itplr-kosit/validationtool.git + v1.0.0 \ No newline at end of file From 72c7d4247d5a7fe52ee950b75ec94b953d0bf127 Mon Sep 17 00:00:00 2001 From: "Andreas Penski (init)" Date: Fri, 8 Feb 2019 08:11:04 +0100 Subject: [PATCH 05/12] (fix) build with case-sensitive filesystem --- .../java/de/kosit/validationtool/impl/VersioningTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/de/kosit/validationtool/impl/VersioningTest.java b/src/test/java/de/kosit/validationtool/impl/VersioningTest.java index 8e53959..7aa765a 100644 --- a/src/test/java/de/kosit/validationtool/impl/VersioningTest.java +++ b/src/test/java/de/kosit/validationtool/impl/VersioningTest.java @@ -34,7 +34,7 @@ import de.kosit.validationtool.model.scenarios.Scenarios; /** * Testet die Versionierung von Scenario-Dateien aka Konfigurationsdaten. - * + * * @author Andreas Penski */ public class VersioningTest { @@ -45,7 +45,7 @@ public class VersioningTest { private static final URL NEW_FEATURE = VersioningTest.class.getResource("/examples/versioning/scenarios-newfeature.xml"); - private static final URL NEW_VERSION = VersioningTest.class.getResource("/examples/versioning/scenarios-newVersion.xml"); + private static final URL NEW_VERSION = VersioningTest.class.getResource("/examples/versioning/scenarios-newversion.xml"); @Rule public ExpectedException exception = ExpectedException.none(); From 842239b33635e602f6013c41d05ba9481f295502 Mon Sep 17 00:00:00 2001 From: "Andreas Penski (init)" Date: Fri, 8 Feb 2019 08:32:26 +0100 Subject: [PATCH 06/12] [maven-release-plugin] prepare release v1.0.2 --- pom.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 835a668..851b1e8 100644 --- a/pom.xml +++ b/pom.xml @@ -18,9 +18,7 @@ ~ under the License. --> - + 4.0.0 3.0 @@ -29,7 +27,7 @@ KoSIT XML Prüftool Implementierung de.kosit - 1.0.2-SNAPSHOT + 1.0.2 validationtool KoSIT XML Prüftool zur Prüfung von XML Dateien gegenüber definierten Szenarien. @@ -345,7 +343,7 @@ https://github.com/itplr-kosit/validationtool.git scm:git:https://github.com/itplr-kosit/validationtool.git - v1.0.0 + v1.0.2 \ No newline at end of file From aacbce522bdf7ed9970f0aeb0c528885ad464438 Mon Sep 17 00:00:00 2001 From: "Andreas Penski (init)" Date: Fri, 8 Feb 2019 08:32:36 +0100 Subject: [PATCH 07/12] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 851b1e8..c64e2f1 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ KoSIT XML Prüftool Implementierung de.kosit - 1.0.2 + 1.0.3-SNAPSHOT validationtool KoSIT XML Prüftool zur Prüfung von XML Dateien gegenüber definierten Szenarien. @@ -343,7 +343,7 @@ https://github.com/itplr-kosit/validationtool.git scm:git:https://github.com/itplr-kosit/validationtool.git - v1.0.2 + v1.0.0 \ No newline at end of file From 34d79d5e2cb1ac0b5830f012f4bf3efaf8d649af Mon Sep 17 00:00:00 2001 From: apenski <19796680+apenski@users.noreply.github.com> Date: Wed, 13 Feb 2019 08:19:02 +0100 Subject: [PATCH 08/12] Improve memory effeciency (#22) #20 Use s9api only for internal processing; Improve memory effeciency --- pom.xml | 13 +---- .../de/kosit/validationtool/api/Check.java | 36 +++++++++++-- .../validationtool/api/InputFactory.java | 9 +++- .../cmd/CheckAssertionAction.java | 42 +++++++-------- .../cmd/CommandLineApplication.java | 8 ++- .../cmd/ExtractHtmlContentAction.java | 14 ++--- .../validationtool/cmd/InternalCheck.java | 9 ++-- .../validationtool/cmd/PrintMemoryStats.java | 52 +++++++++++++++++++ .../validationtool/cmd/PrintReportAction.java | 18 +++---- .../cmd/SerializeReportAction.java | 24 ++++----- .../validationtool/impl/DefaultCheck.java | 26 +++++----- .../impl/ScenarioRepository.java | 47 +++++++++++------ .../impl/tasks/CheckAction.java | 16 +++--- .../impl/tasks/CreateReportAction.java | 26 +++++++--- .../impl/tasks/DocumentParseAction.java | 47 ++++++++--------- .../tasks/SchematronValidationAction.java | 22 ++++---- .../cmd/CheckAssertionActionTest.java | 2 +- .../cmd/CommandlineApplicationTest.java | 16 ++++-- .../cmd/ExtractHtmlActionTest.java | 2 +- .../cmd/PrintReportActionTest.java | 2 +- .../cmd/SerializeReportActionTest.java | 19 +++---- .../validationtool/impl/DefaultCheckTest.java | 31 ++++++++--- .../impl/DocumentParserTest.java | 7 +-- .../de/kosit/validationtool/impl/Helper.java | 33 ++++++------ .../impl/ScenarioRepositoryTest.java | 5 +- .../impl/SchemaValidatorActionTest.java | 2 - 26 files changed, 326 insertions(+), 202 deletions(-) create mode 100644 src/main/java/de/kosit/validationtool/cmd/PrintMemoryStats.java diff --git a/pom.xml b/pom.xml index c64e2f1..16b9273 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ KoSIT XML Prüftool Implementierung de.kosit - 1.0.3-SNAPSHOT + 1.1.0-SNAPSHOT validationtool KoSIT XML Prüftool zur Prüfung von XML Dateien gegenüber definierten Szenarien. @@ -49,7 +49,7 @@ UTF-8 0.7.9 1.16.16 - 9.7.0-15 + 9.9.1-1 1.7.25 @@ -128,15 +128,6 @@ UTF-8 - - org.apache.maven.plugins - maven-surefire-plugin - 2.20 - - - always - - maven-jar-plugin 2.3.1 diff --git a/src/main/java/de/kosit/validationtool/api/Check.java b/src/main/java/de/kosit/validationtool/api/Check.java index ae9d953..60bec51 100644 --- a/src/main/java/de/kosit/validationtool/api/Check.java +++ b/src/main/java/de/kosit/validationtool/api/Check.java @@ -24,6 +24,9 @@ import java.util.stream.Collectors; import org.w3c.dom.Document; +import net.sf.saxon.dom.NodeOverNodeInfo; +import net.sf.saxon.s9api.XdmNode; + /** * Zentrale Schnittstellendefinition für das Prüf-Tool. * @@ -33,21 +36,46 @@ public interface Check { /** * Führt die konfigurierte Prüfung für die übergebene Resource aus. - * + * + * @param input die Resource / XML-Datei, die geprüft werden soll. + * @return ein Ergebnis-{@link Document} + * @deprecated use {@link #checkInput(Input)} + */ + @Deprecated + default Document check(Input input) { + final XdmNode node = checkInput(input); + // readonly view of the document!!! + return (Document) NodeOverNodeInfo.wrap(node.getUnderlyingNode()); + } + + /** + * Führt die konfigurierte Prüfung für die übergebene Resource aus. + * * @param input die Resource / XML-Datei, die geprüft werden soll. * @return ein Ergebnis-{@link Document} */ - Document check(Input input); - + XdmNode checkInput(Input input); /** * Führt eine Prüfung im Batch-Mode durch. Die Default-Implementierung führt die Prüfung sequentiell aus. * * @param input die Eingabe * @return Liste mit Ergebnis-Dokumenten + * @deprecated use {@link #checkInput(List)} */ + @Deprecated default List check(List input) { - return input.stream().map(i -> check(i)).collect(Collectors.toList()); + return input.stream().map(this::check).collect(Collectors.toList()); + } + + /** + * Führt eine Prüfung im Batch-Mode durch. Die Default-Implementierung führt die Prüfung sequentiell aus. + * + * @param input die Eingabe + * @return Liste mit Ergebnis-Dokumenten + */ + default List checkInput(List input) { + return input.stream().map(this::checkInput).collect(Collectors.toList()); } } diff --git a/src/main/java/de/kosit/validationtool/api/InputFactory.java b/src/main/java/de/kosit/validationtool/api/InputFactory.java index 66d4c4e..a7824b6 100644 --- a/src/main/java/de/kosit/validationtool/api/InputFactory.java +++ b/src/main/java/de/kosit/validationtool/api/InputFactory.java @@ -21,7 +21,12 @@ package de.kosit.validationtool.api; import static org.apache.commons.lang3.StringUtils.isNotEmpty; -import java.io.*; +import java.io.BufferedInputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; @@ -51,7 +56,7 @@ public class InputFactory { private static final int DEFAULT_BUFFER_SIZE = 4096; - public static final String MESSAGE_OPEN_STREAM_ERROR = "Can not open stream from"; + private static final String MESSAGE_OPEN_STREAM_ERROR = "Can not open stream from"; @Getter private final String algorithm; diff --git a/src/main/java/de/kosit/validationtool/cmd/CheckAssertionAction.java b/src/main/java/de/kosit/validationtool/cmd/CheckAssertionAction.java index 006626d..a80dc31 100644 --- a/src/main/java/de/kosit/validationtool/cmd/CheckAssertionAction.java +++ b/src/main/java/de/kosit/validationtool/cmd/CheckAssertionAction.java @@ -19,24 +19,29 @@ package de.kosit.validationtool.cmd; -import de.kosit.validationtool.cmd.assertions.AssertionType; -import de.kosit.validationtool.cmd.assertions.Assertions; -import de.kosit.validationtool.impl.model.Result; -import de.kosit.validationtool.impl.tasks.CheckAction; -import lombok.AccessLevel; -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import net.sf.saxon.s9api.*; -import org.apache.commons.lang3.StringUtils; -import org.w3c.dom.Document; - -import javax.xml.transform.dom.DOMSource; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.apache.commons.lang3.StringUtils; + +import lombok.AccessLevel; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import de.kosit.validationtool.cmd.assertions.AssertionType; +import de.kosit.validationtool.cmd.assertions.Assertions; +import de.kosit.validationtool.impl.model.Result; +import de.kosit.validationtool.impl.tasks.CheckAction; + +import net.sf.saxon.s9api.Processor; +import net.sf.saxon.s9api.SaxonApiException; +import net.sf.saxon.s9api.XPathCompiler; +import net.sf.saxon.s9api.XPathSelector; +import net.sf.saxon.s9api.XdmNode; + /** * Überprüft den Report mittels bereitgestellter Assertions. Diese {@link CheckAction} dient der Überprüfung der von der * KoSIT bereitgestellten Prüfszenarien und den darin enthaltenen Artefakten. @@ -64,7 +69,7 @@ public class CheckAssertionAction implements CheckAction { final List toCheck = findAssertions(results.getName()); final List errors = new ArrayList<>(); if (toCheck != null && !toCheck.isEmpty()) { - final XdmNode node = loadDocument(results.getReport()); + final XdmNode node = results.getReport(); toCheck.forEach(a -> { if (!check(node, a)) { log.error("Assertion mismatch: {}", a.getValue()); @@ -86,15 +91,6 @@ public class CheckAssertionAction implements CheckAction { return getMapped().entrySet().stream().filter(e -> matches(e.getKey(), name)).map(Map.Entry::getValue).findFirst().orElse(null); } - private XdmNode loadDocument(Document d) { - DocumentBuilder documentBuilder = getProcessor().newDocumentBuilder(); - try { - return documentBuilder.build(new DOMSource(d)); - } catch (SaxonApiException e) { - log.error("Can not load result document. Therefore can not run defined assertions", e); - } - return null; - } private boolean check(XdmNode document, AssertionType assertion) { try { diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java index 1ce602d..dbe586b 100644 --- a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java +++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java @@ -77,6 +77,8 @@ public class CommandLineApplication { private static final Option CHECK_ASSERTIONS = Option.builder("c").longOpt("check-assertions").hasArg() .desc("Check the result using defined assertions").argName("assertions-file").build(); + private static final Option PRINT_MEM_STATS = Option.builder("m").longOpt("memory-stats").desc("Prints some memory stats").build(); + private CommandLineApplication() { // main class -> hide constructor } @@ -151,6 +153,9 @@ public class CommandLineApplication { Assertions assertions = loadAssertions(cmd.getOptionValue(CHECK_ASSERTIONS.getOpt())); check.getCheckSteps().add(new CheckAssertionAction(assertions, ObjectFactory.createProcessor())); } + if (cmd.hasOption(PRINT_MEM_STATS.getOpt())) { + check.getCheckSteps().add(new PrintMemoryStats()); + } log.info("Setup completed in {}ms\n", System.currentTimeMillis() - start); @@ -226,7 +231,7 @@ public class CommandLineApplication { try { return Files.list(d).filter(path -> path.toString().endsWith(".xml")).collect(Collectors.toList()); } catch (IOException e) { - throw new IllegalStateException("IOException while liste directory content. Can not determine test targets.", e); + throw new IllegalStateException("IOException while list directory content. Can not determine test targets.", e); } } @@ -293,6 +298,7 @@ public class CommandLineApplication { options.addOption(EXTRACT_HTML); options.addOption(DEBUG); options.addOption(CHECK_ASSERTIONS); + options.addOption(PRINT_MEM_STATS); return options; } } diff --git a/src/main/java/de/kosit/validationtool/cmd/ExtractHtmlContentAction.java b/src/main/java/de/kosit/validationtool/cmd/ExtractHtmlContentAction.java index 826e77c..fbdb8b5 100644 --- a/src/main/java/de/kosit/validationtool/cmd/ExtractHtmlContentAction.java +++ b/src/main/java/de/kosit/validationtool/cmd/ExtractHtmlContentAction.java @@ -23,15 +23,19 @@ import java.nio.file.Path; import java.util.HashMap; import java.util.Map; -import javax.xml.transform.dom.DOMSource; - import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import de.kosit.validationtool.impl.ContentRepository; import de.kosit.validationtool.impl.tasks.CheckAction; -import net.sf.saxon.s9api.*; +import net.sf.saxon.s9api.QName; +import net.sf.saxon.s9api.SaxonApiException; +import net.sf.saxon.s9api.Serializer; +import net.sf.saxon.s9api.XPathExecutable; +import net.sf.saxon.s9api.XPathSelector; +import net.sf.saxon.s9api.XdmItem; +import net.sf.saxon.s9api.XdmNode; /** * Extrahiert HTML-Dokumente aus dem Report und persistiert diese im konfigurierten Ausgabe-Verzeichnis. @@ -54,9 +58,7 @@ public class ExtractHtmlContentAction implements CheckAction { public void check(Bag results) { try { final XPathSelector selector = getSelector(); - DocumentBuilder documentBuilder = repository.getProcessor().newDocumentBuilder(); - - final XdmNode xdmSource = documentBuilder.build(new DOMSource(results.getReport())); + final XdmNode xdmSource = results.getReport(); selector.setContextItem(xdmSource); selector.forEach(m -> print(results.getName(), m)); diff --git a/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java b/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java index 06a45f4..fc835dc 100644 --- a/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java +++ b/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java @@ -26,6 +26,8 @@ import de.kosit.validationtool.api.Input; import de.kosit.validationtool.impl.DefaultCheck; import de.kosit.validationtool.impl.tasks.CheckAction; +import net.sf.saxon.s9api.XdmNode; + /** * Simple Erweiterung der Klasse {@link DefaultCheck} um das Ergebnis der Assertion-Prüfung auszwerten und auszugeben. * Diese Klasse stellt keine fachlicher Erweiterung des eigentlichen Prüfvorganges dar! @@ -54,16 +56,17 @@ class InternalCheck extends DefaultCheck { * @param input die Prüflinge * @return false wenn es Assertion-Fehler gibt, sonst true */ - void checkInput(Input input) { + public XdmNode checkInput(Input input) { CheckAction.Bag bag = new CheckAction.Bag(input, createReport()); - runCheckInternal(bag); + XdmNode result = runCheckInternal(bag); if (bag.getAssertionResult() != null) { checkAssertions += bag.getAssertionResult().getObject(); failedAssertions += bag.getAssertionResult().getErrors().size(); } + return result; } - public boolean printAndEvaluate() { + boolean printAndEvaluate() { if (failedAssertions > 0) { log.error("Assertion check failed.\n\nAssertions run: {}, Assertions failed: {}\n", checkAssertions, failedAssertions); } else if (checkAssertions > 0) { diff --git a/src/main/java/de/kosit/validationtool/cmd/PrintMemoryStats.java b/src/main/java/de/kosit/validationtool/cmd/PrintMemoryStats.java new file mode 100644 index 0000000..842a76f --- /dev/null +++ b/src/main/java/de/kosit/validationtool/cmd/PrintMemoryStats.java @@ -0,0 +1,52 @@ +/* + * 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.cmd; + +import java.text.NumberFormat; + +import lombok.extern.slf4j.Slf4j; + +/** + * + * Prints some memory usage information for debugging purposes. + * + * @author Andreas Penski + */ +@Slf4j +public class PrintMemoryStats implements de.kosit.validationtool.impl.tasks.CheckAction { + + private static final int BYTES_PER_K = 1024; + + @Override + public void check(final Bag results) { + final Runtime runtime = Runtime.getRuntime(); + long maxMemory = runtime.maxMemory(); + long allocatedMemory = runtime.totalMemory(); + long freeMemory = runtime.freeMemory(); + + NumberFormat format = NumberFormat.getInstance(); + final String freeStr = format.format(freeMemory / BYTES_PER_K); + final String allocStr = format.format(allocatedMemory / BYTES_PER_K); + final String maxStr = format.format(maxMemory / BYTES_PER_K); + final String totalFreeStr = format.format((freeMemory + (maxMemory - allocatedMemory)) / BYTES_PER_K); + log.info("free memory: {}MB; allocated memory: {}MB", freeStr, allocStr); + log.info("max memory: {}MB; total free memory: {}MB", maxStr, totalFreeStr); + } +} diff --git a/src/main/java/de/kosit/validationtool/cmd/PrintReportAction.java b/src/main/java/de/kosit/validationtool/cmd/PrintReportAction.java index 435cfcd..7d337d4 100644 --- a/src/main/java/de/kosit/validationtool/cmd/PrintReportAction.java +++ b/src/main/java/de/kosit/validationtool/cmd/PrintReportAction.java @@ -21,18 +21,14 @@ package de.kosit.validationtool.cmd; import java.io.StringWriter; -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - import lombok.extern.slf4j.Slf4j; import de.kosit.validationtool.impl.ObjectFactory; import de.kosit.validationtool.impl.tasks.CheckAction; +import net.sf.saxon.s9api.SaxonApiException; +import net.sf.saxon.s9api.Serializer; + /** * Gibt das Ergebnis-Document auf std-out aus. * @@ -44,13 +40,11 @@ public class PrintReportAction implements CheckAction { @Override public void check(Bag results) { try { - Transformer transformer = ObjectFactory.createTransformer(true); final StringWriter writer = new StringWriter(); - Result output = new StreamResult(writer); - Source input = new DOMSource(results.getReport()); - transformer.transform(input, output); + final Serializer serializer = ObjectFactory.createProcessor().newSerializer(writer); + serializer.serializeNode(results.getReport()); System.out.print(writer.toString()); - } catch (TransformerException e) { + } catch (SaxonApiException e) { log.error("Error while printing result to stdout", e); } } diff --git a/src/main/java/de/kosit/validationtool/cmd/SerializeReportAction.java b/src/main/java/de/kosit/validationtool/cmd/SerializeReportAction.java index 8896db7..9f5afed 100644 --- a/src/main/java/de/kosit/validationtool/cmd/SerializeReportAction.java +++ b/src/main/java/de/kosit/validationtool/cmd/SerializeReportAction.java @@ -19,18 +19,16 @@ package de.kosit.validationtool.cmd; -import de.kosit.validationtool.impl.ObjectFactory; -import de.kosit.validationtool.impl.tasks.CheckAction; +import java.nio.file.Path; + import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import java.nio.file.Path; +import de.kosit.validationtool.impl.ObjectFactory; +import de.kosit.validationtool.impl.tasks.CheckAction; + +import net.sf.saxon.s9api.SaxonApiException; +import net.sf.saxon.s9api.Serializer; /** * Schreibt das Prüfergebnis als XML-Dokument an eine definierte Stelle. @@ -48,11 +46,9 @@ public class SerializeReportAction implements CheckAction { final Path file = outputDirectory.resolve(results.getName() + "-report.xml"); try { log.info("Serializing result to {}", file.toAbsolutePath()); - Transformer transformer = ObjectFactory.createTransformer(true); - Result output = new StreamResult(file.toFile()); - Source input = new DOMSource(results.getReport()); - transformer.transform(input, output); - } catch (TransformerException e) { + final Serializer serializer = ObjectFactory.createProcessor().newSerializer(file.toFile()); + serializer.serializeNode(results.getReport()); + } catch (SaxonApiException e) { log.error("Can not serialize result report to {}", file.toAbsolutePath(), e); } } diff --git a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java index 28e6325..82b06ae 100644 --- a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java +++ b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java @@ -20,11 +20,7 @@ package de.kosit.validationtool.impl; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.stream.Collectors; - -import org.w3c.dom.Document; import lombok.Getter; import lombok.extern.slf4j.Slf4j; @@ -32,13 +28,20 @@ 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.impl.tasks.*; +import de.kosit.validationtool.impl.tasks.CheckAction; +import de.kosit.validationtool.impl.tasks.CreateReportAction; +import de.kosit.validationtool.impl.tasks.DocumentParseAction; +import de.kosit.validationtool.impl.tasks.ScenarioSelectionAction; +import de.kosit.validationtool.impl.tasks.SchemaValidationAction; +import de.kosit.validationtool.impl.tasks.SchematronValidationAction; +import de.kosit.validationtool.impl.tasks.ValidateReportInputAction; import de.kosit.validationtool.model.reportInput.CreateReportInput; import de.kosit.validationtool.model.reportInput.DocumentIdentificationType; import de.kosit.validationtool.model.reportInput.EngineType; import de.kosit.validationtool.model.reportInput.ProcessingError; import net.sf.saxon.s9api.Processor; +import net.sf.saxon.s9api.XdmNode; /** * Die Referenz-Implementierung für den Prüfprozess. Nach initialer Konfiguration ist diese Klasse threadsafe und kann @@ -95,26 +98,25 @@ public class DefaultCheck implements Check { } @Override - public Document check(Input input) { + public XdmNode checkInput(Input input) { CheckAction.Bag t = new CheckAction.Bag(input, createReport()); return runCheckInternal(t); } - protected Document runCheckInternal(CheckAction.Bag t) { + protected XdmNode runCheckInternal(CheckAction.Bag t) { long started = System.currentTimeMillis(); log.info("Checking content of {}", t.getInput().getName()); - Iterator it = checkSteps.iterator(); - - while (it.hasNext()) { - final CheckAction action = it.next(); + for (final CheckAction action : checkSteps) { + long start = System.currentTimeMillis(); if (!action.isSkipped(t)) { action.check(t); } + log.info("Step {} finished in {}ms", action.getClass().getSimpleName(), System.currentTimeMillis() - start); if (t.isStopped()) { final ProcessingError processingError = t.getReportInput().getProcessingError(); log.error("Error processing input {}: {}", t.getInput().getName(), - processingError != null ? processingError.getError().stream().collect(Collectors.joining("\n")) : ""); + processingError != null ? String.join("\n", processingError.getError()) : ""); break; } } diff --git a/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java b/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java index 9234a8e..6bf9a17 100644 --- a/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java +++ b/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java @@ -19,16 +19,14 @@ package de.kosit.validationtool.impl; +import static org.apache.commons.lang3.StringUtils.startsWith; + import java.net.MalformedURLException; import java.net.URI; +import java.util.Iterator; import java.util.List; import java.util.stream.Collectors; -import javax.xml.transform.dom.DOMSource; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; - import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; @@ -42,7 +40,13 @@ import de.kosit.validationtool.model.reportInput.XMLSyntaxError; import de.kosit.validationtool.model.scenarios.ScenarioType; import de.kosit.validationtool.model.scenarios.Scenarios; -import net.sf.saxon.s9api.*; +import net.sf.saxon.s9api.Processor; +import net.sf.saxon.s9api.QName; +import net.sf.saxon.s9api.SaxonApiException; +import net.sf.saxon.s9api.XPathSelector; +import net.sf.saxon.s9api.XdmNode; +import net.sf.saxon.s9api.XdmNodeKind; +import net.sf.saxon.s9api.XsltExecutable; /** * Repository for die aktiven Szenario einer Prüfinstanz. @@ -69,16 +73,28 @@ public class ScenarioRepository { @Getter(value = AccessLevel.PACKAGE) private Scenarios scenarios; - private static boolean isSupportedDocument(Document doc) { - final Element root = doc.getDocumentElement(); - return root.hasAttribute("frameworkVersion") && root.getAttribute("frameworkVersion").startsWith(SUPPORTED_MAJOR_VERSION) - && doc.getDocumentElement().getNamespaceURI().equals(SUPPORTED_MAJOR_VERSION_SCHEMA); + private static boolean isSupportedDocument(XdmNode doc) { + final XdmNode root = findRoot(doc); + final String frameworkVersion = root.getAttributeValue(new QName("frameworkVersion")); + return startsWith(frameworkVersion, SUPPORTED_MAJOR_VERSION) + && root.getNodeName().getNamespaceURI().equals(SUPPORTED_MAJOR_VERSION_SCHEMA); + } + + private static XdmNode findRoot(final XdmNode doc) { + final Iterator it = doc.children().iterator(); + while (it.hasNext()) { + final XdmNode node = it.next(); + if (node.getNodeKind() == XdmNodeKind.ELEMENT) { + return node; + } + } + throw new IllegalArgumentException("Kein root element gefunden"); } private static void checkVersion(URI scenarioDefinition) { DocumentParseAction p = new DocumentParseAction(); try { - final Result result = p.parseDocument(InputFactory.read(scenarioDefinition.toURL())); + final Result result = p.parseDocument(InputFactory.read(scenarioDefinition.toURL())); if (result.isValid() && !isSupportedDocument(result.getObject())) { throw new IllegalStateException(String.format( "Specified scenario configuration %s is not supported.%nThis version only supports definitions of '%s'", @@ -138,7 +154,7 @@ public class ScenarioRepository { * @param document das Eingabedokument * @return ein Ergebnis-Objekt zur weiteren Verarbeitung */ - public Result selectScenario(Document document) { + public Result selectScenario(XdmNode document) { Result result = new Result<>(); final List collect = scenarios.getScenario().stream().filter(s -> match(document, s)).collect(Collectors.toList()); if (collect.size() == 1) { @@ -152,13 +168,10 @@ public class ScenarioRepository { } - private boolean match(Document document, ScenarioType scenario) { + private boolean match(XdmNode document, ScenarioType scenario) { try { final XPathSelector selector = scenario.getSelector(); - DocumentBuilder documentBuilder = getProcessor().newDocumentBuilder(); - - final XdmNode xdmSource = documentBuilder.build(new DOMSource(document)); - selector.setContextItem(xdmSource); + selector.setContextItem(document); return selector.effectiveBooleanValue(); } catch (SaxonApiException e) { log.error("Error evaluating xpath expression", e); diff --git a/src/main/java/de/kosit/validationtool/impl/tasks/CheckAction.java b/src/main/java/de/kosit/validationtool/impl/tasks/CheckAction.java index ee8c24f..c569663 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/CheckAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/CheckAction.java @@ -19,17 +19,19 @@ package de.kosit.validationtool.impl.tasks; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import lombok.Getter; +import lombok.Setter; + import de.kosit.validationtool.api.Input; import de.kosit.validationtool.impl.model.Result; import de.kosit.validationtool.model.reportInput.CreateReportInput; import de.kosit.validationtool.model.reportInput.XMLSyntaxError; import de.kosit.validationtool.model.scenarios.ScenarioType; -import lombok.Getter; -import lombok.Setter; -import org.w3c.dom.Document; -import java.util.regex.Matcher; -import java.util.regex.Pattern; +import net.sf.saxon.s9api.XdmNode; /** * Interface, welches von allen Prüfschritten implementiert wird. Der Parameter vom Typ {@link Bag} dient dabei sowohl @@ -72,7 +74,7 @@ public interface CheckAction { private CreateReportInput reportInput; /** Das finale Ergebnis */ - private Document report; + private XdmNode report; private boolean finished; @@ -81,7 +83,7 @@ public interface CheckAction { /** Das zu prüfende Dokument */ private Input input; - private Result parserResult; + private Result parserResult; private Result assertionResult; diff --git a/src/main/java/de/kosit/validationtool/impl/tasks/CreateReportAction.java b/src/main/java/de/kosit/validationtool/impl/tasks/CreateReportAction.java index ed1b762..966859a 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/CreateReportAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/CreateReportAction.java @@ -27,11 +27,22 @@ import org.w3c.dom.Document; import lombok.RequiredArgsConstructor; -import de.kosit.validationtool.impl.*; +import de.kosit.validationtool.impl.CollectingErrorEventHandler; +import de.kosit.validationtool.impl.ConversionService; +import de.kosit.validationtool.impl.ObjectFactory; +import de.kosit.validationtool.impl.RelativeUriResolver; +import de.kosit.validationtool.impl.ScenarioRepository; import de.kosit.validationtool.impl.model.Result; import de.kosit.validationtool.model.scenarios.ScenarioType; -import net.sf.saxon.s9api.*; +import net.sf.saxon.s9api.DocumentBuilder; +import net.sf.saxon.s9api.Processor; +import net.sf.saxon.s9api.QName; +import net.sf.saxon.s9api.SaxonApiException; +import net.sf.saxon.s9api.XdmDestination; +import net.sf.saxon.s9api.XdmNode; +import net.sf.saxon.s9api.XsltExecutable; +import net.sf.saxon.s9api.XsltTransformer; /** * Erzeugt den Report auf Basis der gesammelten Informationen über den Prüfling. Sollte kein Szenario identifiziert @@ -59,10 +70,9 @@ public class CreateReportAction implements CheckAction { final DocumentBuilder documentBuilder = processor.newDocumentBuilder(); try { - final Document inputDoc = results.getParserResult().isValid() ? results.getParserResult().getObject() - : ObjectFactory.createDocumentBuilder(true).newDocument(); + final XdmNode parsedDocument = results.getParserResult().isValid() ? results.getParserResult().getObject() + : ObjectFactory.createProcessor().newDocumentBuilder().newBuildingContentHandler().getDocumentNode(); - final XdmNode parsedDocument = documentBuilder.build(new DOMSource(inputDoc)); final Document reportInput = conversionService.writeDocument(results.getReportInput()); final XdmNode root = documentBuilder.build(new DOMSource(reportInput)); final XsltTransformer transformer = getTransformation(results).load(); @@ -73,10 +83,10 @@ public class CreateReportAction implements CheckAction { transformer.setURIResolver(resolver); transformer.getUnderlyingController().setUnparsedTextURIResolver(resolver); transformer.setParameter(new QName("input-document"), parsedDocument); - Document result = ObjectFactory.createDocumentBuilder(false).newDocument(); - transformer.setDestination(new DOMDestination(result)); + final XdmDestination destination = new XdmDestination(); + transformer.setDestination(destination); transformer.transform(); - results.setReport(result); + results.setReport(destination.getXdmNode()); } catch (SaxonApiException e) { throw new IllegalStateException("Can not create final report", e); 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 874666c..9bc8313 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/DocumentParseAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/DocumentParseAction.java @@ -19,23 +19,26 @@ package de.kosit.validationtool.impl.tasks; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Collections; + +import javax.xml.transform.stream.StreamSource; + +import lombok.RequiredArgsConstructor; +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.model.Result; import de.kosit.validationtool.model.reportInput.ValidationResultsWellformedness; import de.kosit.validationtool.model.reportInput.XMLSyntaxError; import de.kosit.validationtool.model.reportInput.XMLSyntaxErrorSeverity; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.w3c.dom.Document; -import org.xml.sax.SAXException; -import javax.xml.parsers.DocumentBuilder; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Collections; +import net.sf.saxon.s9api.DocumentBuilder; +import net.sf.saxon.s9api.SaxonApiException; +import net.sf.saxon.s9api.XdmNode; /** * Setzt Parsing-Funktionalitäten um. Prüft auf well-formedness @@ -53,22 +56,18 @@ public class DocumentParseAction implements CheckAction { * @param content ein Dokument * @return Ergebnis des Parsings inklusive etwaiger Fehler */ - public Result parseDocument(Input content) { + public Result parseDocument(Input content) { if (content == null) { - throw new IllegalArgumentException("Url may not be null"); + throw new IllegalArgumentException("Input may not be null"); } - Result result; - CollectingErrorEventHandler errorHandler = new CollectingErrorEventHandler(); + Result result; try ( InputStream input = new ByteArrayInputStream(content.getContent()) ) { - DocumentBuilder db = ObjectFactory.createDocumentBuilder(false); - db.setErrorHandler(errorHandler); - Document doc = db.parse(input); - result = new Result<>(doc, errorHandler.getErrors()); - } catch (SAXException e) { - log.debug("SAXException while parsing {}", content.getName(), e); - result = new Result<>(errorHandler.getErrors()); - } catch (IOException e) { - log.debug("IOException while parsing {}", content, e); + final DocumentBuilder builder = ObjectFactory.createProcessor().newDocumentBuilder(); + builder.setLineNumbering(true); + XdmNode doc = builder.build(new StreamSource(input)); + result = new Result<>(doc, Collections.emptyList()); + } catch (SaxonApiException | IOException e) { + log.debug("Exception while parsing {}", content.getName(), e); XMLSyntaxError error = new XMLSyntaxError(); error.setSeverity(XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR); error.setMessage(String.format("IOException while reading resource %s", content.getName())); @@ -80,7 +79,7 @@ public class DocumentParseAction implements CheckAction { @Override public void check(Bag results) { - Result parserResult = parseDocument(results.getInput()); + Result parserResult = parseDocument(results.getInput()); ValidationResultsWellformedness v = new ValidationResultsWellformedness(); results.setParserResult(parserResult); v.getXmlSyntaxError().addAll(parserResult.getErrors()); diff --git a/src/main/java/de/kosit/validationtool/impl/tasks/SchematronValidationAction.java b/src/main/java/de/kosit/validationtool/impl/tasks/SchematronValidationAction.java index 51002f1..f9d38d1 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/SchematronValidationAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/SchematronValidationAction.java @@ -23,8 +23,6 @@ import java.net.URI; import java.util.List; import java.util.stream.Collectors; -import javax.xml.transform.dom.DOMSource; - import org.w3c.dom.Document; import lombok.RequiredArgsConstructor; @@ -37,7 +35,11 @@ import de.kosit.validationtool.model.reportInput.CreateReportInput; import de.kosit.validationtool.model.reportInput.ValidationResultsSchematron; import de.kosit.validationtool.model.scenarios.ScenarioType; -import net.sf.saxon.s9api.*; +import net.sf.saxon.s9api.DOMDestination; +import net.sf.saxon.s9api.Processor; +import net.sf.saxon.s9api.SaxonApiException; +import net.sf.saxon.s9api.XdmNode; +import net.sf.saxon.s9api.XsltTransformer; /** * Ausführung von konfigurierten Schematron Validierungen eines Szenarios. @@ -51,16 +53,14 @@ public class SchematronValidationAction implements CheckAction { private final URI repository; - private List validate(Document document, ScenarioType scenario) { + private List validate(XdmNode document, ScenarioType scenario) { return scenario.getSchematronValidations().stream().map(v -> validate(document, v)).collect(Collectors.toList()); } - private ValidationResultsSchematron validate(Document document, BaseScenario.Transformation validation) { - final DocumentBuilder documentBuilder = processor.newDocumentBuilder(); + private ValidationResultsSchematron validate(XdmNode document, BaseScenario.Transformation validation) { try { - final XdmNode root = documentBuilder.build(new DOMSource(document)); final XsltTransformer transformer = validation.getExecutable().load(); - //resolving nur relative zum Repository + // resolving nur relative zum Repository final RelativeUriResolver resolver = new RelativeUriResolver(repository); transformer.setURIResolver(resolver); CollectingErrorEventHandler e = new CollectingErrorEventHandler(); @@ -68,7 +68,7 @@ public class SchematronValidationAction implements CheckAction { Document result = ObjectFactory.createDocumentBuilder(false).newDocument(); transformer.setDestination(new DOMDestination(result)); - transformer.setInitialContextNode(root); + transformer.setInitialContextNode(document); transformer.transform(); ValidationResultsSchematron s = new ValidationResultsSchematron(); s.setResource(validation.getResourceType()); @@ -85,9 +85,9 @@ public class SchematronValidationAction implements CheckAction { @Override public void check(Bag results) { final CreateReportInput report = results.getReportInput(); - final List bla = validate(results.getParserResult().getObject(), + final List validationResult = validate(results.getParserResult().getObject(), results.getScenarioSelectionResult().getObject()); - report.getValidationResultsSchematron().addAll(bla); + report.getValidationResultsSchematron().addAll(validationResult); } @Override diff --git a/src/test/java/de/kosit/validationtool/cmd/CheckAssertionActionTest.java b/src/test/java/de/kosit/validationtool/cmd/CheckAssertionActionTest.java index 8292c76..6e24b3c 100644 --- a/src/test/java/de/kosit/validationtool/cmd/CheckAssertionActionTest.java +++ b/src/test/java/de/kosit/validationtool/cmd/CheckAssertionActionTest.java @@ -66,7 +66,7 @@ public class CheckAssertionActionTest { @Test public void testSimple() throws URISyntaxException { final CheckAction.Bag bag = new CheckAction.Bag(InputFactory.read(SAMPLE), new CreateReportInput()); - bag.setReport(Helper.load(SAMPLE_REPORT).getObject()); + bag.setReport(Helper.load(SAMPLE_REPORT)); final Assertions assertions = Helper.load(SAMPLE_ASSERTIONS, Assertions.class); CheckAssertionAction a = new CheckAssertionAction(assertions, ObjectFactory.createProcessor()); diff --git a/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java b/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java index 23c2fad..47c54a6 100644 --- a/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java +++ b/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java @@ -19,8 +19,14 @@ package de.kosit.validationtool.cmd; -import org.junit.Before; -import org.junit.Test; +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; import java.nio.file.Files; @@ -28,8 +34,8 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; -import static de.kosit.validationtool.impl.Helper.*; -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.Before; +import org.junit.Test; /** * Testet die Parameter des Kommandozeilen-Tools. @@ -146,7 +152,7 @@ public class CommandlineApplicationTest { Paths.get(SAMPLE).toString() }; CommandLineApplication.mainProgram(args); assertThat(commandLine.getErrorOutput()).contains(RESULT_OUTPUT); - assertThat(commandLine.getOutputLines()).contains(""); + assertThat(commandLine.getOutputLines().get(0)).contains(""); } @Test diff --git a/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java b/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java index 7e94140..9c308a1 100644 --- a/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java +++ b/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java @@ -64,7 +64,7 @@ public class ExtractHtmlActionTest { public void testSimple() throws IOException { CheckAction.Bag b = new CheckAction.Bag(InputFactory.read(REPORT)); assertThat(action.isSkipped(b)).isTrue(); - b.setReport(Helper.load(REPORT).getObject()); + b.setReport(Helper.load(REPORT)); action.check(b); assertThat(action.isSkipped(b)).isFalse(); action.check(b); diff --git a/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java b/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java index c817ac6..2b528c2 100644 --- a/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java +++ b/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java @@ -58,7 +58,7 @@ public class PrintReportActionTest { @Test public void testSimpleSerialize() { CheckAction.Bag b = new CheckAction.Bag(InputFactory.read(REPORT)); - b.setReport(Helper.load(REPORT).getObject()); + b.setReport(Helper.load(REPORT)); assertThat(action.isSkipped(b)).isFalse(); action.check(b); assertThat(b.isStopped()).isFalse(); diff --git a/src/test/java/de/kosit/validationtool/cmd/SerializeReportActionTest.java b/src/test/java/de/kosit/validationtool/cmd/SerializeReportActionTest.java index 89e51a3..12960c3 100644 --- a/src/test/java/de/kosit/validationtool/cmd/SerializeReportActionTest.java +++ b/src/test/java/de/kosit/validationtool/cmd/SerializeReportActionTest.java @@ -19,20 +19,21 @@ package de.kosit.validationtool.cmd; -import de.kosit.validationtool.api.InputFactory; -import de.kosit.validationtool.impl.Helper; -import de.kosit.validationtool.impl.tasks.CheckAction; -import org.apache.commons.io.FileUtils; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import static org.assertj.core.api.Assertions.assertThat; import java.io.IOException; import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; -import static org.assertj.core.api.Assertions.assertThat; +import org.apache.commons.io.FileUtils; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import de.kosit.validationtool.api.InputFactory; +import de.kosit.validationtool.impl.Helper; +import de.kosit.validationtool.impl.tasks.CheckAction; /** * @author Andreas Penski @@ -60,7 +61,7 @@ public class SerializeReportActionTest { public void testSimpleSerialize() { CheckAction.Bag b = new CheckAction.Bag(InputFactory.read(REPORT)); assertThat(action.isSkipped(b)).isTrue(); - b.setReport(Helper.load(REPORT).getObject()); + b.setReport(Helper.load(REPORT)); assertThat(action.isSkipped(b)).isFalse(); action.check(b); assertThat(b.isStopped()).isFalse(); diff --git a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java index f621163..cae8be6 100644 --- a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java +++ b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java @@ -19,11 +19,8 @@ package de.kosit.validationtool.impl; -import de.kosit.validationtool.api.CheckConfiguration; -import de.kosit.validationtool.api.Input; -import org.junit.Before; -import org.junit.Test; -import org.w3c.dom.Document; +import static de.kosit.validationtool.api.InputFactory.read; +import static org.assertj.core.api.Assertions.assertThat; import java.io.File; import java.net.URISyntaxException; @@ -32,8 +29,14 @@ import java.util.List; import java.util.stream.Collectors; import java.util.stream.IntStream; -import static de.kosit.validationtool.api.InputFactory.read; -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.Before; +import org.junit.Test; +import org.w3c.dom.Document; + +import de.kosit.validationtool.api.CheckConfiguration; +import de.kosit.validationtool.api.Input; + +import net.sf.saxon.s9api.XdmNode; /** * Test das Check-Interface @@ -60,12 +63,26 @@ public class DefaultCheckTest { @Test public void testHappyCase() throws Exception { + final XdmNode doc = implementation.checkInput(read(VALID_EXAMPLE)); + assertThat(doc).isNotNull(); + } + + @Test + public void testHappyCaseDocument() throws Exception { final Document doc = implementation.check(read(VALID_EXAMPLE)); assertThat(doc).isNotNull(); } @Test public void testMultipleCase() throws Exception { + final List input = IntStream.range(0, MULTI_COUNT).mapToObj(i -> read(VALID_EXAMPLE)).collect(Collectors.toList()); + final List docs = implementation.checkInput(input); + assertThat(docs).isNotNull(); + assertThat(docs).hasSize(MULTI_COUNT); + } + + @Test + public void testMultipleCaseDocument() throws Exception { final List input = IntStream.range(0, MULTI_COUNT).mapToObj(i -> read(VALID_EXAMPLE)).collect(Collectors.toList()); final List docs = implementation.check(input); assertThat(docs).isNotNull(); diff --git a/src/test/java/de/kosit/validationtool/impl/DocumentParserTest.java b/src/test/java/de/kosit/validationtool/impl/DocumentParserTest.java index f902bb7..3e54ee6 100644 --- a/src/test/java/de/kosit/validationtool/impl/DocumentParserTest.java +++ b/src/test/java/de/kosit/validationtool/impl/DocumentParserTest.java @@ -29,12 +29,13 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import org.w3c.dom.Document; import de.kosit.validationtool.impl.model.Result; import de.kosit.validationtool.impl.tasks.DocumentParseAction; import de.kosit.validationtool.model.reportInput.XMLSyntaxError; +import net.sf.saxon.s9api.XdmNode; + /** * @author Andreas Penski */ @@ -60,7 +61,7 @@ public class DocumentParserTest { @Test public void testSimple() throws IOException { - final Result result = parser.parseDocument(read(CONTENT)); + final Result result = parser.parseDocument(read(CONTENT)); assertThat(result).isNotNull(); assertThat(result.getObject()).isNotNull(); assertThat(result.getErrors()).isEmpty(); @@ -70,7 +71,7 @@ public class DocumentParserTest { @Test public void testIllformed() throws IOException { - final Result result = parser.parseDocument(read(ILLFORMED)); + final Result result = parser.parseDocument(read(ILLFORMED)); 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 fb03a4e..d717fbd 100644 --- a/src/test/java/de/kosit/validationtool/impl/Helper.java +++ b/src/test/java/de/kosit/validationtool/impl/Helper.java @@ -20,18 +20,17 @@ package de.kosit.validationtool.impl; import java.io.File; +import java.io.IOException; +import java.io.InputStream; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.nio.file.Paths; -import org.w3c.dom.Document; +import javax.xml.transform.stream.StreamSource; -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.DocumentParseAction; -import de.kosit.validationtool.model.reportInput.XMLSyntaxError; +import net.sf.saxon.s9api.SaxonApiException; +import net.sf.saxon.s9api.XdmNode; /** * Helferlein für Test-Artefakte @@ -50,36 +49,38 @@ public class Helper { public static final URI TEST_ROOT = Paths.get("src/test/resources").toUri(); - - public static final URI EXAMPLES_DIR = TEST_ROOT.resolve("examples/"); + 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 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 * * @param url die url die geladen werden soll * @return ein result objekt mit Dokument */ - public static Result load(URL url) { - DocumentParseAction a = new DocumentParseAction(); - CheckAction.Bag b = new CheckAction.Bag(InputFactory.read(url)); - a.check(b); - return b.getParserResult(); + public static XdmNode load(URL url) { + try ( InputStream input = url.openStream() ) { + return ObjectFactory.createProcessor().newDocumentBuilder().build(new StreamSource(input)); + } catch (SaxonApiException | IOException e) { + throw new IllegalStateException("Fehler beim Laden der XML-Datei", e); + + } + } public static T load(URL url, Class type) throws URISyntaxException { @@ -98,5 +99,5 @@ public class Helper { public static ContentRepository loadTestRepository() { return new ContentRepository(ObjectFactory.createProcessor(), new File("src/test/resources/examples/repository").toURI()); } -} +} diff --git a/src/test/java/de/kosit/validationtool/impl/ScenarioRepositoryTest.java b/src/test/java/de/kosit/validationtool/impl/ScenarioRepositoryTest.java index 76da77f..4e1492b 100644 --- a/src/test/java/de/kosit/validationtool/impl/ScenarioRepositoryTest.java +++ b/src/test/java/de/kosit/validationtool/impl/ScenarioRepositoryTest.java @@ -30,13 +30,14 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import org.w3c.dom.Document; import de.kosit.validationtool.impl.model.Result; import de.kosit.validationtool.impl.tasks.DocumentParseAction; import de.kosit.validationtool.model.scenarios.ScenarioType; import de.kosit.validationtool.model.scenarios.Scenarios; +import net.sf.saxon.s9api.XdmNode; + /** * Testet das {@link ScenarioRepository}. * @@ -94,7 +95,7 @@ public class ScenarioRepositoryTest { assertThat(scenario.isValid()).isFalse(); } - private Document load(URL url) throws IOException { + private XdmNode load(URL url) throws IOException { DocumentParseAction p = new DocumentParseAction(); return p.parseDocument(read(url)).getObject(); } diff --git a/src/test/java/de/kosit/validationtool/impl/SchemaValidatorActionTest.java b/src/test/java/de/kosit/validationtool/impl/SchemaValidatorActionTest.java index 55134e9..89d3a80 100644 --- a/src/test/java/de/kosit/validationtool/impl/SchemaValidatorActionTest.java +++ b/src/test/java/de/kosit/validationtool/impl/SchemaValidatorActionTest.java @@ -69,7 +69,6 @@ public class SchemaValidatorActionTest { @Test public void testSimple() { CheckAction.Bag bag = new CheckAction.Bag(InputFactory.read(VALID_EXAMPLE), new CreateReportInput()); - bag.setParserResult(Helper.load(VALID_EXAMPLE)); ScenarioType t = new ScenarioType(); ValidateWithXmlSchema v = new ValidateWithXmlSchema(); ResourceType r = new ResourceType(); @@ -88,7 +87,6 @@ public class SchemaValidatorActionTest { @Test public void testValidationFailure() throws MalformedURLException { CheckAction.Bag bag = new CheckAction.Bag(InputFactory.read(INVALID_EXAMPLE.toURL()), new CreateReportInput()); - bag.setParserResult(Helper.load(INVALID_EXAMPLE.toURL())); ScenarioType t = new ScenarioType(); ValidateWithXmlSchema v = new ValidateWithXmlSchema(); ResourceType r = new ResourceType(); From 87a05cb45666104439338aeadb3e730b17703741 Mon Sep 17 00:00:00 2001 From: Andreas Penski <> Date: Wed, 13 Feb 2019 08:39:37 +0100 Subject: [PATCH 09/12] #20 remove deprecatation hint We decided to keep the "Document"-versions of the API --- .../de/kosit/validationtool/api/Check.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/java/de/kosit/validationtool/api/Check.java b/src/main/java/de/kosit/validationtool/api/Check.java index 60bec51..c2d8629 100644 --- a/src/main/java/de/kosit/validationtool/api/Check.java +++ b/src/main/java/de/kosit/validationtool/api/Check.java @@ -27,21 +27,21 @@ import org.w3c.dom.Document; import net.sf.saxon.dom.NodeOverNodeInfo; import net.sf.saxon.s9api.XdmNode; + /** * Zentrale Schnittstellendefinition für das Prüf-Tool. - * + * * @author Andreas Penski */ public interface Check { /** - * Führt die konfigurierte Prüfung für die übergebene Resource aus. + * Führt die konfigurierte Prüfung für die übergebene Resource aus. Das Ergebnis-{@link Document} ist readonly. Soll es + * weiterverarbeitet werden, so muss es kopiert werden. * * @param input die Resource / XML-Datei, die geprüft werden soll. - * @return ein Ergebnis-{@link Document} - * @deprecated use {@link #checkInput(Input)} + * @return ein Ergebnis-{@link Document} (readonly) */ - @Deprecated default Document check(Input input) { final XdmNode node = checkInput(input); // readonly view of the document!!! @@ -57,13 +57,12 @@ public interface Check { XdmNode checkInput(Input input); /** - * Führt eine Prüfung im Batch-Mode durch. Die Default-Implementierung führt die Prüfung sequentiell aus. - * + * Führt eine Prüfung im Batch-Mode durch. Die Default-Implementierung führt die Prüfung sequentiell aus. Die Ergebnis + * -{@link Document Dokumente} sind readonly. Sollen sie weiterverarbeitet werden, so müssen Kopien erstellt werden. + * * @param input die Eingabe - * @return Liste mit Ergebnis-Dokumenten - * @deprecated use {@link #checkInput(List)} + * @return Liste mit Ergebnis-Dokumenten (readonly) */ - @Deprecated default List check(List input) { return input.stream().map(this::check).collect(Collectors.toList()); } From d1d3d25f367371840327db7bb038025718fb502a Mon Sep 17 00:00:00 2001 From: "Penski, Andreas" Date: Mon, 4 Mar 2019 08:42:21 +0100 Subject: [PATCH 10/12] #10 Daemon Mode umsetzen --- README.md | 8 +- pom.xml | 93 +- src/main/docker/daemon/Dockerfile | 8 + .../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 +++ .../config/resources/eRechnung/report.xsl | 631 ++ src/main/docker/daemon/config/scenarios.xml | 68 + src/main/docker/daemon/run.sh | 3 + .../de/kosit/validationtool/api/Input.java | 5 +- .../cmd/CommandLineApplication.java | 82 +- .../de/kosit/validationtool/cmd/Daemon.java | 197 + .../de/kosit/validationtool/cmd/Health.java | 117 + .../validationtool/impl/DefaultCheck.java | 11 +- .../impl/ScenarioRepository.java | 2 +- src/main/model/xsd/assertions.xsd | 2 +- .../de/kosit/validationtool/cmd/DaemonIT.java | 74 + .../resources/eRechnung/default-report.xsl | 2 +- .../repository/resources/eRechnung/report.xsl | 2 +- 35 files changed, 17482 insertions(+), 25 deletions(-) create mode 100644 src/main/docker/daemon/Dockerfile create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/CCTS_CCT_SchemaModule-2.1.xsd create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonAggregateComponents-2.1.xsd create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonBasicComponents-2.1.xsd create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonExtensionComponents-2.1.xsd create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonSignatureComponents-2.1.xsd create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CoreComponentParameters-2.1.xsd create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-ExtensionContentDataType-2.1.xsd create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-QualifiedDataTypes-2.1.xsd create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureAggregateComponents-2.1.xsd create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureBasicComponents-2.1.xsd create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-UnqualifiedDataTypes-2.1.xsd create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv132-2.1.xsd create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv141-2.1.xsd create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-xmldsig-core-schema-2.1.xsd create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-CreditNote-2.1.xsd create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl create mode 100644 src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl create mode 100644 src/main/docker/daemon/config/resources/eRechnung/default-report.xsl create mode 100644 src/main/docker/daemon/config/resources/eRechnung/report.xsl create mode 100644 src/main/docker/daemon/config/scenarios.xml create mode 100644 src/main/docker/daemon/run.sh create mode 100644 src/main/java/de/kosit/validationtool/cmd/Daemon.java create mode 100644 src/main/java/de/kosit/validationtool/cmd/Health.java create mode 100644 src/test/java/de/kosit/validationtool/cmd/DaemonIT.java diff --git a/README.md b/README.md index 04c9faf..f4a508f 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ CheckConfiguration config = new CheckConfiguration(); config.setScenarioDefinition(scenarios); //Instanziierung der DefaultCheck-Implementierung -Check check = new DefaultCheck(config); +Check implemenation = new DefaultCheck(config); ``` Weitere Konfigurationsoption ist der Pfad zum Repository. Standardmäßig wird das Repository relativ zur Szenarien-Defintion @@ -148,12 +148,12 @@ Check pruefer = new DefaultCheck(config); //einzelne Datei prüfen Input pruefKandidat = InputFactory.read(new File("rechnung.xml")); -Document report = pruefer.check(pruefKandidat); +Document report = pruefer.implemenation(pruefKandidat); //Batch-Prüfung List files = Files.list(Paths.get("rechnungen")).map(path -> path.toFile()).collect(Collectors.toList()); List toCheck = files.stream().map(InputFactory::read).collect(Collectors.toList()); -List reports = pruefer.check(toCheck); +List reports = pruefer.implemenation(toCheck); ``` @@ -284,7 +284,7 @@ verwiesen. insgesamt 310 prüfbaren Aussagen (Assertions) über die resultierenden Prüfberichte erstellt. * Durch diese Testsuite werden, ausgehend von dem Prüfbericht-Schemas alle möglichen Optionen und Auswahlmöglichkeiten mindestens je einmal positiv und einmal negativ getestet. -* Diese Zusicherungen können vom Prüftool selbst mittels des Schalter `--check-assertions` automatisch geprüft werden. +* Diese Zusicherungen können vom Prüftool selbst mittels des Schalter `--implemenation-assertions` automatisch geprüft werden. * Zudem wird die Integrität aller erstellten Prüfberichte automatisch gegen das Schema (XML Schema und Schematron-Regeln) des Prüfberichts getestet. * Für weitere Details siehe [xrechnung/test/readme.txt](configurations/xrechnung/test/readme.txt). diff --git a/pom.xml b/pom.xml index 16b9273..85bc38c 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,8 @@ ~ under the License. --> - + 4.0.0 3.0 @@ -26,7 +27,7 @@ KoSIT XML Prüftool Implementierung - de.kosit + de.kosit 1.1.0-SNAPSHOT validationtool @@ -51,6 +52,7 @@ 1.16.16 9.9.1-1 1.7.25 + localhost @@ -107,6 +109,12 @@ 1.3.2 test + + io.rest-assured + rest-assured + 3.3.0 + test + @@ -128,6 +136,7 @@ UTF-8 + maven-jar-plugin 2.3.1 @@ -215,6 +224,86 @@ + + io.fabric8 + docker-maven-plugin + 0.28.0 + + tcp://localhost:2375 + true + true + false + + + daemon + daemon + + daemon + + + + + ${project.build.directory}/validationtool-${project.version}-standalone.jar + validationtool-standalone.jar + + + + + + + + bridge + + + 8080:8080 + + + + + + + + + + + up + pre-integration-test + + build + start + + + + post + post-integration-test + + stop + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.22.1 + + + + integration-test + verify + + + + + -Ddaemon.port=8080 + -Ddaemon.host=http://localhost/ + + + + + + org.codehaus.mojo diff --git a/src/main/docker/daemon/Dockerfile b/src/main/docker/daemon/Dockerfile new file mode 100644 index 0000000..c95f712 --- /dev/null +++ b/src/main/docker/daemon/Dockerfile @@ -0,0 +1,8 @@ +FROM openjdk:8 + +RUN mkdir /opt/validationtool +ADD maven/validationtool-standalone.jar /opt/validationtool +ADD run.sh /opt/validationtool/ +ADD config/ /opt/validationtool/ +EXPOSE 8080 +ENTRYPOINT ["bash", "/opt/validationtool/run.sh" ] \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/CCTS_CCT_SchemaModule-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/CCTS_CCT_SchemaModule-2.1.xsd new file mode 100644 index 0000000..2bc034a --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/CCTS_CCT_SchemaModule-2.1.xsd @@ -0,0 +1,769 @@ + + + + + + + + + + + + + + + + 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/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonAggregateComponents-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonAggregateComponents-2.1.xsd new file mode 100644 index 0000000..59b826d --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonAggregateComponents-2.1.xsd @@ -0,0 +1,4166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonBasicComponents-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonBasicComponents-2.1.xsd new file mode 100644 index 0000000..6a00c5d --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonBasicComponents-2.1.xsd @@ -0,0 +1,5394 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonExtensionComponents-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonExtensionComponents-2.1.xsd new file mode 100644 index 0000000..2a9fc38 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonExtensionComponents-2.1.xsd @@ -0,0 +1,235 @@ + + + + + + + + + + + + + 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/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonSignatureComponents-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonSignatureComponents-2.1.xsd new file mode 100644 index 0000000..fa0f481 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CommonSignatureComponents-2.1.xsd @@ -0,0 +1,81 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CoreComponentParameters-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CoreComponentParameters-2.1.xsd new file mode 100644 index 0000000..fbda5b8 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-CoreComponentParameters-2.1.xsd @@ -0,0 +1,73 @@ + + + + + + diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-ExtensionContentDataType-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-ExtensionContentDataType-2.1.xsd new file mode 100644 index 0000000..3a8235b --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-ExtensionContentDataType-2.1.xsd @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + 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/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-QualifiedDataTypes-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-QualifiedDataTypes-2.1.xsd new file mode 100644 index 0000000..9f22f94 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-QualifiedDataTypes-2.1.xsd @@ -0,0 +1,78 @@ + + + + + + + + + + diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureAggregateComponents-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureAggregateComponents-2.1.xsd new file mode 100644 index 0000000..e58388c --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureAggregateComponents-2.1.xsd @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + This is a single digital signature as defined by the W3C specification. + + + + + + + \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureBasicComponents-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureBasicComponents-2.1.xsd new file mode 100644 index 0000000..76d1881 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-SignatureBasicComponents-2.1.xsd @@ -0,0 +1,83 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-UnqualifiedDataTypes-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-UnqualifiedDataTypes-2.1.xsd new file mode 100644 index 0000000..2480083 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-UnqualifiedDataTypes-2.1.xsd @@ -0,0 +1,554 @@ + + + + + + + + + + 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/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv132-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv132-2.1.xsd new file mode 100644 index 0000000..f08c7ba --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv132-2.1.xsd @@ -0,0 +1,499 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv141-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv141-2.1.xsd new file mode 100644 index 0000000..801bae9 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-XAdESv141-2.1.xsd @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-xmldsig-core-schema-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-xmldsig-core-schema-2.1.xsd new file mode 100644 index 0000000..b30b1d4 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/common/UBL-xmldsig-core-schema-2.1.xsd @@ -0,0 +1,332 @@ + + + + + + + + + ]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-CreditNote-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-CreditNote-2.1.xsd new file mode 100644 index 0000000..91d48d9 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-CreditNote-2.1.xsd @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd new file mode 100644 index 0000000..94ad2cc --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsdrt/maindoc/UBL-Invoice-2.1.xsd @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl new file mode 100644 index 0000000..b89fbc5 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsl/BIIRULES-UBL-T10.xsl @@ -0,0 +1,1383 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + / + + + + + + *: + + [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/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl new file mode 100644 index 0000000..65ca96d --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/UBL-2.1/xsl/OPENPEPPOL-UBL-T10.xsl @@ -0,0 +1,1243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + / + + + + + + *: + + [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/main/docker/daemon/config/resources/eRechnung/default-report.xsl b/src/main/docker/daemon/config/resources/eRechnung/default-report.xsl new file mode 100644 index 0000000..5b03f79 --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/default-report.xsl @@ -0,0 +1,756 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 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/main/docker/daemon/config/resources/eRechnung/report.xsl b/src/main/docker/daemon/config/resources/eRechnung/report.xsl new file mode 100644 index 0000000..7e3555c --- /dev/null +++ b/src/main/docker/daemon/config/resources/eRechnung/report.xsl @@ -0,0 +1,631 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/main/docker/daemon/config/scenarios.xml b/src/main/docker/daemon/config/scenarios.xml new file mode 100644 index 0000000..086a093 --- /dev/null +++ b/src/main/docker/daemon/config/scenarios.xml @@ -0,0 +1,68 @@ + + + + + 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

+
+ + + 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/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 + + + + + + default + resources/eRechnung/default-report.xsl + + + +
diff --git a/src/main/docker/daemon/run.sh b/src/main/docker/daemon/run.sh new file mode 100644 index 0000000..3daa916 --- /dev/null +++ b/src/main/docker/daemon/run.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +cd /opt/validationtool && java -jar validationtool-standalone.jar -s scenarios.xml -D \ No newline at end of file diff --git a/src/main/java/de/kosit/validationtool/api/Input.java b/src/main/java/de/kosit/validationtool/api/Input.java index db2dac5..69f9c22 100644 --- a/src/main/java/de/kosit/validationtool/api/Input.java +++ b/src/main/java/de/kosit/validationtool/api/Input.java @@ -19,10 +19,7 @@ package de.kosit.validationtool.api; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.RequiredArgsConstructor; +import lombok.*; /** * Eine Datei in eingelesener Form. diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java index dbe586b..09e4bbe 100644 --- a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java +++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java @@ -20,12 +20,12 @@ package de.kosit.validationtool.cmd; import java.io.IOException; -import java.net.MalformedURLException; import java.net.URI; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.stream.Collectors; @@ -37,6 +37,7 @@ import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import lombok.extern.slf4j.Slf4j; @@ -50,20 +51,21 @@ import de.kosit.validationtool.impl.ObjectFactory; /** * Commandline Version des Prüftools. Parsed die Kommandozeile und führt die konfigurierten Aktionen aus. - * + * * @author Andreas Penski */ @Slf4j public class CommandLineApplication { + private static final Option HELP = Option.builder("?").longOpt("help").argName("Help").desc("Displays this help").build(); + private static final Option SCENARIOS = Option.builder("s").required().longOpt("scenarios").hasArg() .desc("Location of scenarios.xml e.g.").build(); private static final Option REPOSITORY = Option.builder("r").longOpt("repository").hasArg() .desc("Directory containing scenario content").build(); - private static final Option PRINT = Option.builder("p").longOpt("print").desc("Prints the check result to stdout").build(); private static final Option OUTPUT = Option.builder("o").longOpt("output-directory") @@ -76,6 +78,17 @@ public class CommandLineApplication { private static final Option CHECK_ASSERTIONS = Option.builder("c").longOpt("check-assertions").hasArg() .desc("Check the result using defined assertions").argName("assertions-file").build(); + private static final Option SERVER = Option.builder("D").longOpt("daemon").desc("Starts a daemon listing for validation requests").build(); + + private static final Option HOST = Option.builder("H").longOpt("host").hasArg() + .desc("The hostname / IP address to bind the daemon. Default is localhost").build(); + + private static final Option PORT = Option.builder("P").longOpt("port").hasArg() + .desc("The port to bind the daemon. Default is 8080").build(); + + private static final Option WORKER_COUNT = Option.builder("T").longOpt("threads").hasArg().desc("Number of threads processing validation requests").build(); + public static final int DAEMON_SIGNAL = 100; + private static final Option PRINT_MEM_STATS = Option.builder("m").longOpt("memory-stats").desc("Prints some memory stats").build(); @@ -90,15 +103,19 @@ public class CommandLineApplication { */ public static void main(String[] args) { final int resultStatus = mainProgram(args); - System.exit(resultStatus); + if (DAEMON_SIGNAL != resultStatus) { + System.exit(resultStatus); + } } + /** * Hauptprogramm für die Kommandozeilen-Applikation. * * @param args die Eingabe-Argumente */ static int mainProgram(String[] args) { + int returnValue = 0; Options options = createOptions(); if (isHelpRequested(args)) { printHelp(options); @@ -106,10 +123,12 @@ public class CommandLineApplication { try { CommandLineParser parser = new DefaultParser(); final CommandLine cmd = parser.parse(options, args); - if (cmd.getArgList().isEmpty()) { + if (cmd.hasOption(SERVER.getOpt())) { + returnValue = startDaemonMode(cmd); + } else if (cmd.getArgList().isEmpty()) { printHelp(createOptions()); } else { - return processActions(cmd); + returnValue = processActions(cmd); } } catch (ParseException e) { log.error("Error processing command line arguments: " + e.getMessage()); @@ -119,6 +138,46 @@ public class CommandLineApplication { return 0; } + private static int determinePort(CommandLine cmd) { + int port = 8080; + if (checkOptionWithValue(PORT, cmd)) { + port = Integer.parseInt(cmd.getOptionValue(PORT.getOpt())); + } + return port; + } + + private static int determineThreads(CommandLine cmd) { + int threads = Runtime.getRuntime().availableProcessors(); + if (checkOptionWithValue(WORKER_COUNT, cmd)) { + threads = Integer.parseInt(cmd.getOptionValue(WORKER_COUNT.getOpt())); + } + return threads; + } + + private static String determineHost(CommandLine cmd) { + String host = "localhost"; + if (checkOptionWithValue(HOST, cmd)) { + host = cmd.getOptionValue(HOST.getOpt()); + } + return host; + } + + private static int startDaemonMode(CommandLine cmd) { + Option[] unavailable = new Option[]{PRINT, CHECK_ASSERTIONS, DEBUG, OUTPUT, EXTRACT_HTML}; + warnUnusedOptions(cmd, unavailable, true); + Daemon validDaemon = new Daemon(determineDefinition(cmd), determineRepository(cmd), determineHost(cmd), determinePort(cmd), determineThreads(cmd)); + validDaemon.startServer(); + return DAEMON_SIGNAL; + } + + private static void warnUnusedOptions(CommandLine cmd, Option[] unavailable, boolean daemon) { + Arrays.stream(cmd.getOptions()).filter(o -> ArrayUtils.contains(unavailable, o)).map(o -> "The option " + o.getLongOpt() + " is not available in daemon mode").forEach(log::error); + if (daemon && !cmd.getArgList().isEmpty()) { + log.info("Ignoring test targets in daemon mode"); + } + } + + private static boolean isHelpRequested(String[] args) { Options helpOptions = createHelpOptions(); try { @@ -137,6 +196,8 @@ public class CommandLineApplication { try { long start = System.currentTimeMillis(); + Option[] unavailable = new Option[]{HOST, PORT, WORKER_COUNT}; + warnUnusedOptions(cmd, unavailable, false); CheckConfiguration d = new CheckConfiguration(determineDefinition(cmd)); d.setScenarioRepository(determineRepository(cmd)); InternalCheck check = new InternalCheck(d); @@ -149,6 +210,7 @@ public class CommandLineApplication { if (cmd.hasOption(PRINT.getOpt())) { check.getCheckSteps().add(new PrintReportAction()); } + if (cmd.hasOption(CHECK_ASSERTIONS.getOpt())) { Assertions assertions = loadAssertions(cmd.getOptionValue(CHECK_ASSERTIONS.getOpt())); check.getCheckSteps().add(new CheckAssertionAction(assertions, ObjectFactory.createProcessor())); @@ -236,7 +298,7 @@ public class CommandLineApplication { } - private static URI determineRepository(CommandLine cmd) throws MalformedURLException { + private static URI determineRepository(CommandLine cmd) { if (checkOptionWithValue(REPOSITORY, cmd)) { Path d = Paths.get(cmd.getOptionValue(REPOSITORY.getOpt())); if (Files.isDirectory(d)) { @@ -249,7 +311,7 @@ public class CommandLineApplication { return null; } - private static URI determineDefinition(CommandLine cmd) throws MalformedURLException { + private static URI determineDefinition(CommandLine cmd) { checkOptionWithValue(SCENARIOS, cmd); Path f = Paths.get(cmd.getOptionValue(SCENARIOS.getOpt())); if (Files.isRegularFile(f)) { @@ -291,6 +353,9 @@ public class CommandLineApplication { private static Options createOptions() { Options options = new Options(); options.addOption(HELP); + options.addOption(SERVER); + options.addOption(HOST); + options.addOption(PORT); options.addOption(SCENARIOS); options.addOption(REPOSITORY); options.addOption(PRINT); @@ -299,6 +364,7 @@ public class CommandLineApplication { options.addOption(DEBUG); options.addOption(CHECK_ASSERTIONS); options.addOption(PRINT_MEM_STATS); + options.addOption(WORKER_COUNT); return options; } } diff --git a/src/main/java/de/kosit/validationtool/cmd/Daemon.java b/src/main/java/de/kosit/validationtool/cmd/Daemon.java new file mode 100644 index 0000000..7f05c09 --- /dev/null +++ b/src/main/java/de/kosit/validationtool/cmd/Daemon.java @@ -0,0 +1,197 @@ +package de.kosit.validationtool.cmd; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.net.URI; +import java.util.concurrent.Executors; +import java.util.concurrent.atomic.AtomicLong; + +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.w3c.dom.Document; + +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +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.model.scenarios.Scenarios; + +/** + * HTTP-Daemon für die Bereitstellung der Prüf-Funktionalität via http. + * + * @author Roula Antoun + */ +@RequiredArgsConstructor +@Setter +@Getter +@Slf4j +class Daemon { + + /** + * Wir benötigen einen Handler, der zur Verarbeitung von HTTP-Anforderungen aufgerufen wird um hier die Verarbeitung des + * POST Request zu realisieren. + */ + @Slf4j + private static class HttpServerHandler implements HttpHandler { + + private static final AtomicLong counter = new AtomicLong(0); + + private final Check implemenation; + + HttpServerHandler(Check check) { + this.implemenation = check; + } + + /** + * Methode, die eine gegebene Anforderung verarbeitet und eine entsprechende Antwort generiert + * + * @param httpExchange kapselt eine empfangene HTTP-Anforderung und eine Antwort, die in einem Exchange generiert werden + * soll. + */ + @Override + public void handle(HttpExchange httpExchange) throws IOException { + try { + String requestMethod = httpExchange.getRequestMethod(); + if (requestMethod.equals("POST")) { + InputStream inputStream = httpExchange.getRequestBody(); + Input serverInput = InputFactory.read(inputStream, "Prüfling" + counter.incrementAndGet()); + + int contentLength = serverInput.getContent().length; + if (contentLength != 0) { + writeOutputstreamArray(httpExchange, implemenation.check(serverInput)); + } else { + writeError(httpExchange, 400, "XML-Inhalt erforderlich!"); + } + } else { + writeError(httpExchange, 405, "Es ist nur die POST-Methode erlaubt!"); + } + } catch (TransformerException 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); + } + } + + } + + /** + * Wir benötigen einen Handler, der zur Verarbeitung von HTTP-Anforderungen aufgerufen wird , und hier für Verarbeitung + * das GET Request um Health-Endpunkt zu erstellen. Die Klasse HealthHandler implementiert diese Schnittstelle + */ + @Slf4j + static class HealthHandler implements HttpHandler { + + private final Scenarios scenarios; + + HealthHandler(Scenarios scenarios) { + this.scenarios = scenarios; + } + + @Override + public void handle(HttpExchange httpExchange) throws IOException { + Health health = new Health(scenarios); + Document doc = health.writeHealthXml(); + try { + writeOutputstreamArray(httpExchange, doc); + } catch (TransformerException e) { + writeError(httpExchange, 500, e.getMessage()); + log.error("Fehler beim Erzeugen der Status-Information", e); + } + } + } + + private final URI scenarioDefinition; + + private final URI repository; + + private final String hostName; + + private final int port; + + private final int threadCount; + + /** + * Methode, die die Antwort als String-Text schreibt + * + * @param httpExchange um den Antwort Body zu erhalten + * @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 { + httpExchange.sendResponseHeaders(rCode, response.length()); + OutputStream os = httpExchange.getResponseBody(); + os.write(response.getBytes()); + os.close(); + } + + /** + * Methode, die die Antwort als String-Text schreibt + * + * @param httpExchange um den Antwort Body zu erhalten + * @param doc der Report + */ + private static void writeOutputstreamArray(HttpExchange httpExchange, Document doc) throws IOException, TransformerException { + final byte[] bytes = serialize(doc); + OutputStream os = httpExchange.getResponseBody(); + httpExchange.getResponseHeaders().add("Content-Type", "application/xml"); + httpExchange.sendResponseHeaders(200, bytes.length); + os.write(bytes); + os.close(); + log.debug("Xml File erzeugen ist Fertig "); + } + + /** + * Methode zum Serialisieren des Dokuments. + * + * @param report Vom Typ Dokument, aka Report . + */ + private static byte[] serialize(Document report) throws TransformerException { + + try ( ByteArrayOutputStream bArrayOS = new ByteArrayOutputStream() ) { + DOMSource source = new DOMSource(report); + StreamResult streamResult = new StreamResult(bArrayOS); + Transformer transformer = ObjectFactory.createTransformer(true); + transformer.transform(source, streamResult); + return bArrayOS.toByteArray(); + } catch (IOException e) { + log.error("Report {}", e.getMessage(), e); + throw new IllegalStateException(e); + } + } + + /** + * Methode zum Starten des Servers + */ + void startServer() { + CheckConfiguration config = new CheckConfiguration(scenarioDefinition); + config.setScenarioRepository(repository); + HttpServer server = null; + try { + server = HttpServer.create(new InetSocketAddress(hostName, port), 0); + DefaultCheck check = new DefaultCheck(config); + server.createContext("/", new HttpServerHandler(check)); + server.createContext("/health", new HealthHandler(check.getRepository().getScenarios())); + server.setExecutor(Executors.newFixedThreadPool(threadCount)); + server.start(); + log.info("Server ist erfolgreich gestartet"); + } catch (IOException e) { + log.error("Fehler beim HttpServer erstellen!", e.getMessage(), e); + } + } +} diff --git a/src/main/java/de/kosit/validationtool/cmd/Health.java b/src/main/java/de/kosit/validationtool/cmd/Health.java new file mode 100644 index 0000000..e3056a6 --- /dev/null +++ b/src/main/java/de/kosit/validationtool/cmd/Health.java @@ -0,0 +1,117 @@ +package de.kosit.validationtool.cmd; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; + +import lombok.extern.slf4j.Slf4j; + +import de.kosit.validationtool.model.scenarios.Scenarios; + +/** + * Klasse zur Erzeugung Health Xml , die optiamle Status. + * + * @author Roula Antoun + */ +@Slf4j +class Health { + + private final long freeMemory; + + private final long maxMemory; + + private final long totalMemory; + + private final Scenarios scenarios; + + Health(Scenarios scenarios) { + + Runtime runtime = Runtime.getRuntime(); + freeMemory = runtime.freeMemory(); + maxMemory = runtime.maxMemory(); + totalMemory = runtime.totalMemory(); + this.scenarios = scenarios; + } + + /** + * Methode, die schreibt das Health Xml für optimale Status + * + */ + Document writeHealthXml() { + DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder dBuilder; + Document doc = null; + try { + dBuilder = dbFactory.newDocumentBuilder(); + doc = dBuilder.newDocument(); + Element rootElement = doc.createElementNS("https://localhost:8080/Health", "Health"); + doc.appendChild(rootElement); + rootElement.appendChild(getMemory(doc, freeMemory, maxMemory, totalMemory)); + rootElement.appendChild(getState(doc)); + rootElement.appendChild(getScenario(doc, scenarios)); + } catch (ParserConfigurationException e) { + log.error("Fehler beim Schreiben der Status-Informationen", e); + } + return doc; + } + + /** + * Methode, die schreibt das System Status Node im Xml File + * + * @param doc Vom Typ Dokument. + * + */ + private Node getState(Document doc) { + Element state = doc.createElement("state"); + state.setAttribute("indicator", "OK"); + Element stateNode = doc.createElement("message"); + stateNode.appendChild(doc.createTextNode("System is up and running normally")); + state.appendChild(stateNode); + return state; + } + + /** + * Methode, die schreibt das Scnarios Information Node im Xml File + * + * @param doc Vom Typ Dokument . + * @param scenarios Vom Typ {@link Scenarios} das verwendete scenario. + * + */ + private Node getScenario(Document doc, Scenarios scenarios) { + Element scenario = doc.createElement("scenario"); + Element scenarioNameNode = doc.createElement("name"); + scenarioNameNode.appendChild(doc.createTextNode(scenarios.getName())); + scenario.appendChild(scenarioNameNode); + return scenario; + } + + /** + * Methode, die schreibt das Scnarios Information Node im Xml File + * + * @param doc Vom Typ Dokument . + * @param freeMemory Vom Typ long , der freier Speicher. + * @param maxMemory Vom Typ long , der maximaler Speicher + * @param totalMemory Vom Typ long , der Gesamte speicher. + * + */ + private static Node getMemory(Document doc, long freeMemory, long maxMemory, long totalMemory) { + Element memory = doc.createElement("memoryState"); + String freeM = Long.toString(freeMemory); + Element freeMNode = doc.createElement("freeMemory"); + freeMNode.appendChild(doc.createTextNode(freeM)); + memory.appendChild(freeMNode); + String maxM = Long.toString(maxMemory); + Element maxMNode = doc.createElement("maxMemory"); + maxMNode.appendChild(doc.createTextNode(maxM)); + memory.appendChild(maxMNode); + String totalM = Long.toString(totalMemory); + Element totalMNode = doc.createElement("totalMemory"); + totalMNode.appendChild(doc.createTextNode(totalM)); + memory.appendChild(totalMNode); + return memory; + } +} diff --git a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java index 82b06ae..81d15db 100644 --- a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java +++ b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java @@ -21,6 +21,10 @@ package de.kosit.validationtool.impl; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; + +import de.kosit.validationtool.model.scenarios.Scenarios; +import org.w3c.dom.Document; import lombok.Getter; import lombok.extern.slf4j.Slf4j; @@ -46,7 +50,7 @@ import net.sf.saxon.s9api.XdmNode; /** * Die Referenz-Implementierung für den Prüfprozess. Nach initialer Konfiguration ist diese Klasse threadsafe und kann * in Server-Umgebungen eingesetzt werden - * + * * @author Andreas Penski */ @Slf4j @@ -56,6 +60,7 @@ public class DefaultCheck implements Check { private static final String ENGINE_VERSION = "1.0.0"; + @Getter private ScenarioRepository repository; @Getter @@ -63,12 +68,13 @@ public class DefaultCheck implements Check { private ConversionService conversionService; + @Getter private List checkSteps; /** * Erzeugt eine neue Instanz mit der angegebenen Konfiguration. - * + * * @param configuration die Konfiguration */ public DefaultCheck(CheckConfiguration configuration) { @@ -135,5 +141,4 @@ public class DefaultCheck implements Check { transporter.getReportInput().setDocumentIdentification(i); return true; } - } diff --git a/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java b/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java index 6bf9a17..0622e10 100644 --- a/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java +++ b/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java @@ -70,7 +70,7 @@ public class ScenarioRepository { private XsltExecutable noScenarioReport; - @Getter(value = AccessLevel.PACKAGE) + @Getter private Scenarios scenarios; private static boolean isSupportedDocument(XdmNode doc) { diff --git a/src/main/model/xsd/assertions.xsd b/src/main/model/xsd/assertions.xsd index e7d5e73..4a5bdcc 100644 --- a/src/main/model/xsd/assertions.xsd +++ b/src/main/model/xsd/assertions.xsd @@ -28,7 +28,7 @@ In diesem Dokument werden zum Test einer Prüftoolkonfiguration Zusicherungen zu einzelnen Prüfberichten beschrieben. Ein - solches Dokument kann der Kommandozeilenversion des Prüftools über --check-assertions übergeben werden. + solches Dokument kann der Kommandozeilenversion des Prüftools über --implemenation-assertions übergeben werden. diff --git a/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java b/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java new file mode 100644 index 0000000..0201c62 --- /dev/null +++ b/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java @@ -0,0 +1,74 @@ +package de.kosit.validationtool.cmd; + +import static io.restassured.RestAssured.given; + +import java.io.IOException; +import java.io.InputStream; + +import org.junit.Before; +import org.junit.Test; + +import io.restassured.RestAssured; + +/** + * Testet the Daemon-Mode input , Methoden , Output Content-Type and the success case + * + * @author Roula Antoun + */ +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() { + final String port = System.getProperty("daemon.port"); + if (port != null) { + RestAssured.port = Integer.valueOf(port); + } + final String baseHost = System.getProperty("daemon.host"); + if (baseHost != null) { + RestAssured.baseURI = baseHost; + } + + } + + @Test + public void makeSureThatSuccessTest() throws IOException { + try ( InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) { + given().contentType(APPLICATION_XML).body(io).when().post("/").then().statusCode(200); + } + } + + @Test + public void NoInputTest() { + given().body("").contentType(APPLICATION_XML).when().post("/").then().statusCode(400); + } + + @Test + public void internalServerErrorTest() throws IOException { + try ( InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(INVALID_XML) ) { + given().contentType(APPLICATION_XML).body(io).when().post("/").then().statusCode(200); + } + } + + @Test + public void methodNotAllowedTest() { + given().when().get("/").then().statusCode(405); + given().when().put("/").then().statusCode(405); + given().when().patch("/").then().statusCode(405); + given().when().delete("/").then().statusCode(405); + given().when().head("/").then().statusCode(405); + given().when().options("/").then().statusCode(405); + } + + @Test + public void xmlResultTest() throws IOException { + try ( InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) { + given().body(io).when().post("/").then().contentType(APPLICATION_XML).and().statusCode(200); + } + } +} diff --git a/src/test/resources/examples/repository/resources/eRechnung/default-report.xsl b/src/test/resources/examples/repository/resources/eRechnung/default-report.xsl index 1d3b383..413a4d7 100644 --- a/src/test/resources/examples/repository/resources/eRechnung/default-report.xsl +++ b/src/test/resources/examples/repository/resources/eRechnung/default-report.xsl @@ -104,7 +104,7 @@ - + diff --git a/src/test/resources/examples/repository/resources/eRechnung/report.xsl b/src/test/resources/examples/repository/resources/eRechnung/report.xsl index f4f03fb..bf1dafe 100644 --- a/src/test/resources/examples/repository/resources/eRechnung/report.xsl +++ b/src/test/resources/examples/repository/resources/eRechnung/report.xsl @@ -87,7 +87,7 @@ - + From 70149817bf488d62ddb1cb6075cf596faed73a1f Mon Sep 17 00:00:00 2001 From: "Penski, Andreas" Date: Wed, 6 Mar 2019 14:26:05 +0100 Subject: [PATCH 11/12] #11 jdk11 support --- .gitlab-ci.yml | 29 ++ pom.xml | 446 ++++++++++++------ src/main/docker/daemon/Dockerfile | 2 +- src/main/docker/daemon/Dockerfile-java8 | 8 + .../docker/daemon/Dockerfile-java8-jdk-jaxb | 8 + src/main/docker/daemon/run.sh | 2 +- .../validationtool/api/InputFactory.java | 3 + .../cmd/CheckAssertionAction.java | 2 +- .../cmd/CommandLineApplication.java | 2 +- .../de/kosit/validationtool/cmd/Daemon.java | 5 +- .../cmd/ExtractHtmlContentAction.java | 2 +- .../validationtool/cmd/PrintMemoryStats.java | 2 +- .../validationtool/cmd/PrintReportAction.java | 2 +- .../cmd/SerializeReportAction.java | 2 +- .../impl/tasks/DocumentParseAction.java | 5 +- .../de/kosit/validationtool/cmd/DaemonIT.java | 16 +- .../cmd/PrintReportActionTest.java | 4 +- 17 files changed, 391 insertions(+), 149 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 src/main/docker/daemon/Dockerfile-java8 create mode 100644 src/main/docker/daemon/Dockerfile-java8-jdk-jaxb diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..da97003 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,29 @@ +image: maven:latest + +variables: + MAVEN_CLI_OPTS: " --batch-mode -Dmaven.repo.local=repository -Dfile.encoding=UTF-8" + +cache: + paths: + - repository + +build-validator: + stage: build + script: + - mvn $MAVEN_CLI_OPTS -Pjava-11,java-8,gitlab verify + + artifacts: + name: build-results + paths: + - target/*.jar + reports: + junit: + - target/surefire-reports/*.xml + - target/failsafe-reports/*.xml + +#deploy: +# stage: deploy +# script: +# - mvn $MAVEN_CLI_OPTS deploy +# only: +# - master diff --git a/pom.xml b/pom.xml index 85bc38c..a4d0d04 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 3.0 + 3.3.9 KoSIT XML Prüftool Implementierung @@ -48,8 +48,8 @@ UTF-8 - 0.7.9 - 1.16.16 + 0.8.3 + 1.18.6 9.9.1-1 1.7.25 localhost @@ -77,6 +77,7 @@ commons-cli commons-cli 1.4 + true org.slf4j @@ -90,6 +91,11 @@ commons-lang3 3.5 + + org.glassfish.jaxb + jaxb-runtime + 2.3.2 + org.assertj assertj-core @@ -102,7 +108,6 @@ 4.12 test - org.apache.commons commons-io @@ -112,7 +117,7 @@ io.rest-assured rest-assured - 3.3.0 + 3.2.0 test @@ -129,7 +134,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.8.0 1.8 1.8 @@ -138,57 +143,65 @@ - maven-jar-plugin - 2.3.1 - - - simplelogger.properties - de/kosit/validationtool/cmd/** - - + org.apache.maven.plugins + maven-shade-plugin + 3.2.1 + + + jdk11+ + package + + shade + + + validationtool-${project.version}-standalone + + + de.kosit.validationtool.cmd.CommandLineApplication + + + META-INF/TE-050AC.SF + + + + + + jdk8 + package + + shade + + + validationtool-${project.version}-java8-standalone + + + org.glassfish.jaxb:jaxb-runtime + com.sun.istack:istack-commons-runtime + com.sun.xml.fastinfoset:FastInfoset + jakarta.activation:jakarta.activation-api + jakarta.xml.bind:jakarta.xml.bind-api + org.jvnet.staxex:stax-ex + org.glassfish.jaxb:txw2 + + + + + de.kosit.validationtool.cmd.CommandLineApplication + + + + META-INF/TE-050AC.SF + + + + + + org.apache.maven.plugins maven-assembly-plugin - - standalone - package - - single - - - - - - de.kosit.validationtool.cmd.CommandLineApplication - - - - - src/main/assembly/assembly-standalone.xml - - - - - full - package - - single - - - - - - de.kosit.validationtool.cmd.CommandLineApplication - - - - - src/main/assembly/assembly-full.xml - - - standalone_dist package @@ -224,85 +237,6 @@ - - io.fabric8 - docker-maven-plugin - 0.28.0 - - tcp://localhost:2375 - true - true - false - - - daemon - daemon - - daemon - - - - - ${project.build.directory}/validationtool-${project.version}-standalone.jar - validationtool-standalone.jar - - - - - - - - bridge - - - 8080:8080 - - - - - - - - - - - up - pre-integration-test - - build - start - - - - post - post-integration-test - - stop - - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - 2.22.1 - - - - integration-test - verify - - - - - -Ddaemon.port=8080 - -Ddaemon.host=http://localhost/ - - - - - @@ -329,7 +263,7 @@ org.jvnet.jaxb2.maven2 maven-jaxb2-plugin - 0.13.2 + 0.14.0 @@ -420,6 +354,254 @@ + + + + java-8 + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.22.1 + + + test-java8 + + integration-test + verify + + + + + -Ddaemon.port=8081 + -Ddaemon.host=http://${docker.host} + + ${project.build.directory}/failsafe-reports/failsafe-summary-java8.xml + + + + test-java-8-jdk-jaxb + + integration-test + verify + + + + + -Ddaemon.port=8082 + -Ddaemon.host=http://${docker.host} + + ${project.build.directory}/failsafe-reports/failsafe-summary-java8-jdk-jaxb.xml + + + + + + + + io.fabric8 + docker-maven-plugin + 0.28.0 + + tcp://${docker.host}:2375 + true + true + false + validator-%n-%t-%i-java8 + + + + + up8 + pre-integration-test + + build + start + + + + + daemon8 + daemon8 + + daemon + Dockerfile-java8 + + + + + + ${project.build.directory}/validationtool-${project.version}-standalone.jar + + validationtool-standalone.jar + + + + + + + + bridge + + + 8081:8080 + + + + + + + + daemon8-jdk-jaxb + daemon8-jdk-jaxb + + daemon + Dockerfile-java8-jdk-jaxb + + + + + + ${project.build.directory}/validationtool-${project.version}-java8-standalone.jar + + validationtool-standalone.jar + + + + + + + + bridge + + + 8082:8080 + + + + + + + + + + + down8 + post-integration-test + + stop + + + + + + + + + + java-11 + + true + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.22.1 + + + test-jdk11 + + integration-test + verify + + + + + -Ddaemon.port=8080 + -Ddaemon.host=http://${docker.host} + + + + + + + + io.fabric8 + docker-maven-plugin + 0.28.0 + + tcp://${docker.host}:2375 + true + true + false + validator-%n-%t-%i-java8 + + + + up11 + pre-integration-test + + build + start + + + + + daemon11 + daemon11 + + daemon + + + + + + ${project.build.directory}/validationtool-${project.version}-standalone.jar + + validationtool-standalone.jar + + + + + + + + bridge + + + 8080:8080 + + + + + + + + + + + down11 + post-integration-test + + stop + + + + + + + + + + gitlab + + host.docker.internal + + + https://github.com/itplr-kosit/validationtool.git scm:git:https://github.com/itplr-kosit/validationtool.git diff --git a/src/main/docker/daemon/Dockerfile b/src/main/docker/daemon/Dockerfile index c95f712..fc4bcec 100644 --- a/src/main/docker/daemon/Dockerfile +++ b/src/main/docker/daemon/Dockerfile @@ -1,4 +1,4 @@ -FROM openjdk:8 +FROM openjdk:11 RUN mkdir /opt/validationtool ADD maven/validationtool-standalone.jar /opt/validationtool diff --git a/src/main/docker/daemon/Dockerfile-java8 b/src/main/docker/daemon/Dockerfile-java8 new file mode 100644 index 0000000..c95f712 --- /dev/null +++ b/src/main/docker/daemon/Dockerfile-java8 @@ -0,0 +1,8 @@ +FROM openjdk:8 + +RUN mkdir /opt/validationtool +ADD maven/validationtool-standalone.jar /opt/validationtool +ADD run.sh /opt/validationtool/ +ADD config/ /opt/validationtool/ +EXPOSE 8080 +ENTRYPOINT ["bash", "/opt/validationtool/run.sh" ] \ No newline at end of file diff --git a/src/main/docker/daemon/Dockerfile-java8-jdk-jaxb b/src/main/docker/daemon/Dockerfile-java8-jdk-jaxb new file mode 100644 index 0000000..c95f712 --- /dev/null +++ b/src/main/docker/daemon/Dockerfile-java8-jdk-jaxb @@ -0,0 +1,8 @@ +FROM openjdk:8 + +RUN mkdir /opt/validationtool +ADD maven/validationtool-standalone.jar /opt/validationtool +ADD run.sh /opt/validationtool/ +ADD config/ /opt/validationtool/ +EXPOSE 8080 +ENTRYPOINT ["bash", "/opt/validationtool/run.sh" ] \ No newline at end of file diff --git a/src/main/docker/daemon/run.sh b/src/main/docker/daemon/run.sh index 3daa916..3726133 100644 --- a/src/main/docker/daemon/run.sh +++ b/src/main/docker/daemon/run.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -cd /opt/validationtool && java -jar validationtool-standalone.jar -s scenarios.xml -D \ No newline at end of file +cd /opt/validationtool && java -jar validationtool-standalone.jar -s scenarios.xml -D -H 0.0.0.0 \ No newline at end of file diff --git a/src/main/java/de/kosit/validationtool/api/InputFactory.java b/src/main/java/de/kosit/validationtool/api/InputFactory.java index a7824b6..ba04e55 100644 --- a/src/main/java/de/kosit/validationtool/api/InputFactory.java +++ b/src/main/java/de/kosit/validationtool/api/InputFactory.java @@ -28,6 +28,7 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URL; +import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; import java.security.DigestInputStream; @@ -226,6 +227,8 @@ public class InputFactory { byte[] hash = digest.digest(); log.debug("Generated hashcode for {} is {}", name, DatatypeConverter.printHexBinary(hash)); out.flush(); + log.info(new String(out.toByteArray(), Charset.forName("utf8")).substring(0, + out.toByteArray().length < 100 ? out.toByteArray().length : 100)); return new Input(out.toByteArray(), name, hash, digest.getAlgorithm()); } catch (IOException e) { throw new IllegalArgumentException(MESSAGE_OPEN_STREAM_ERROR + name, e); diff --git a/src/main/java/de/kosit/validationtool/cmd/CheckAssertionAction.java b/src/main/java/de/kosit/validationtool/cmd/CheckAssertionAction.java index a80dc31..79d4d24 100644 --- a/src/main/java/de/kosit/validationtool/cmd/CheckAssertionAction.java +++ b/src/main/java/de/kosit/validationtool/cmd/CheckAssertionAction.java @@ -50,7 +50,7 @@ import net.sf.saxon.s9api.XdmNode; */ @Slf4j @RequiredArgsConstructor -public class CheckAssertionAction implements CheckAction { +class CheckAssertionAction implements CheckAction { private final Assertions assertions; diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java index 09e4bbe..91cb851 100644 --- a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java +++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java @@ -135,7 +135,7 @@ public class CommandLineApplication { printHelp(options); } } - return 0; + return returnValue; } private static int determinePort(CommandLine cmd) { diff --git a/src/main/java/de/kosit/validationtool/cmd/Daemon.java b/src/main/java/de/kosit/validationtool/cmd/Daemon.java index 7f05c09..0bfaf87 100644 --- a/src/main/java/de/kosit/validationtool/cmd/Daemon.java +++ b/src/main/java/de/kosit/validationtool/cmd/Daemon.java @@ -68,6 +68,7 @@ class Daemon { @Override public void handle(HttpExchange httpExchange) throws IOException { try { + log.debug("Incoming request"); String requestMethod = httpExchange.getRequestMethod(); if (requestMethod.equals("POST")) { InputStream inputStream = httpExchange.getRequestBody(); @@ -82,7 +83,7 @@ class Daemon { } else { writeError(httpExchange, 405, "Es ist nur die POST-Methode erlaubt!"); } - } catch (TransformerException e) { + } catch (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); } @@ -189,7 +190,7 @@ class Daemon { server.createContext("/health", new HealthHandler(check.getRepository().getScenarios())); server.setExecutor(Executors.newFixedThreadPool(threadCount)); server.start(); - log.info("Server ist erfolgreich gestartet"); + log.info("Server unter Port {} ist erfolgreich gestartet", port); } catch (IOException e) { log.error("Fehler beim HttpServer erstellen!", e.getMessage(), e); } diff --git a/src/main/java/de/kosit/validationtool/cmd/ExtractHtmlContentAction.java b/src/main/java/de/kosit/validationtool/cmd/ExtractHtmlContentAction.java index fbdb8b5..9124649 100644 --- a/src/main/java/de/kosit/validationtool/cmd/ExtractHtmlContentAction.java +++ b/src/main/java/de/kosit/validationtool/cmd/ExtractHtmlContentAction.java @@ -44,7 +44,7 @@ import net.sf.saxon.s9api.XdmNode; */ @RequiredArgsConstructor @Slf4j -public class ExtractHtmlContentAction implements CheckAction { +class ExtractHtmlContentAction implements CheckAction { private static final QName NAME_ATTRIBUTE = new QName("data-report-type"); diff --git a/src/main/java/de/kosit/validationtool/cmd/PrintMemoryStats.java b/src/main/java/de/kosit/validationtool/cmd/PrintMemoryStats.java index 842a76f..313acd7 100644 --- a/src/main/java/de/kosit/validationtool/cmd/PrintMemoryStats.java +++ b/src/main/java/de/kosit/validationtool/cmd/PrintMemoryStats.java @@ -30,7 +30,7 @@ import lombok.extern.slf4j.Slf4j; * @author Andreas Penski */ @Slf4j -public class PrintMemoryStats implements de.kosit.validationtool.impl.tasks.CheckAction { +class PrintMemoryStats implements de.kosit.validationtool.impl.tasks.CheckAction { private static final int BYTES_PER_K = 1024; diff --git a/src/main/java/de/kosit/validationtool/cmd/PrintReportAction.java b/src/main/java/de/kosit/validationtool/cmd/PrintReportAction.java index 7d337d4..2c3faa2 100644 --- a/src/main/java/de/kosit/validationtool/cmd/PrintReportAction.java +++ b/src/main/java/de/kosit/validationtool/cmd/PrintReportAction.java @@ -35,7 +35,7 @@ import net.sf.saxon.s9api.Serializer; * @author Andreas Penski */ @Slf4j -public class PrintReportAction implements CheckAction { +class PrintReportAction implements CheckAction { @Override public void check(Bag results) { diff --git a/src/main/java/de/kosit/validationtool/cmd/SerializeReportAction.java b/src/main/java/de/kosit/validationtool/cmd/SerializeReportAction.java index 9f5afed..1c26479 100644 --- a/src/main/java/de/kosit/validationtool/cmd/SerializeReportAction.java +++ b/src/main/java/de/kosit/validationtool/cmd/SerializeReportAction.java @@ -37,7 +37,7 @@ import net.sf.saxon.s9api.Serializer; */ @Slf4j @RequiredArgsConstructor -public class SerializeReportAction implements CheckAction { +class SerializeReportAction implements CheckAction { private final Path outputDirectory; 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 9bc8313..9a314a5 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/DocumentParseAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/DocumentParseAction.java @@ -70,7 +70,7 @@ public class DocumentParseAction implements CheckAction { log.debug("Exception while parsing {}", content.getName(), e); XMLSyntaxError error = new XMLSyntaxError(); error.setSeverity(XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR); - error.setMessage(String.format("IOException while reading resource %s", content.getName())); + error.setMessage(String.format("IOException while reading resource %s: %s", content.getName(), e.getMessage())); result = new Result<>(Collections.singleton(error)); } @@ -84,6 +84,9 @@ public class DocumentParseAction implements CheckAction { results.setParserResult(parserResult); v.getXmlSyntaxError().addAll(parserResult.getErrors()); results.getReportInput().setValidationResultsWellformedness(v); + if (parserResult.isInvalid()) { + log.info("Parsing war nicht erfolgreich: {} -> {}", parserResult.getObject(), parserResult.getErrors()); + } } } diff --git a/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java b/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java index 0201c62..52b521f 100644 --- a/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java +++ b/src/test/java/de/kosit/validationtool/cmd/DaemonIT.java @@ -5,10 +5,13 @@ import static io.restassured.RestAssured.given; import java.io.IOException; import java.io.InputStream; +import org.apache.commons.io.IOUtils; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import io.restassured.RestAssured; +import io.restassured.http.ContentType; /** * Testet the Daemon-Mode input , Methoden , Output Content-Type and the success case @@ -33,13 +36,13 @@ public class DaemonIT { if (baseHost != null) { RestAssured.baseURI = baseHost; } - + RestAssured.enableLoggingOfRequestAndResponseIfValidationFails(); } @Test public void makeSureThatSuccessTest() throws IOException { try ( InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) { - given().contentType(APPLICATION_XML).body(io).when().post("/").then().statusCode(200); + given().contentType(ContentType.XML).body(toContent(io)).when().post("/").then().statusCode(200); } } @@ -49,12 +52,17 @@ public class DaemonIT { } @Test + @Ignore // no default error report yet public void internalServerErrorTest() throws IOException { try ( InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(INVALID_XML) ) { - given().contentType(APPLICATION_XML).body(io).when().post("/").then().statusCode(200); + given().contentType(APPLICATION_XML).body(toContent(io)).when().post("/").then().statusCode(200); } } + private byte[] toContent(final InputStream io) throws IOException { + return IOUtils.toByteArray(io); + } + @Test public void methodNotAllowedTest() { given().when().get("/").then().statusCode(405); @@ -68,7 +76,7 @@ public class DaemonIT { @Test public void xmlResultTest() throws IOException { try ( InputStream io = DaemonIT.class.getClassLoader().getResourceAsStream(EXAMPLE_FILE) ) { - given().body(io).when().post("/").then().contentType(APPLICATION_XML).and().statusCode(200); + given().body(toContent(io)).when().post("/").then().contentType(APPLICATION_XML).and().statusCode(200); } } } diff --git a/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java b/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java index 2b528c2..e28b7ab 100644 --- a/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java +++ b/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java @@ -63,8 +63,8 @@ public class PrintReportActionTest { action.check(b); assertThat(b.isStopped()).isFalse(); assertThat(commandLine.getOutput()).isNotEmpty(); - assertThat(commandLine.getOutput()).startsWith(" Date: Mon, 25 Mar 2019 11:39:10 +0100 Subject: [PATCH 12/12] #9 Formatierungsregeln --- .gitignore | 3 +- .idea/checkstyle-idea.xml | 16 + .idea/compiler.xml | 13 + .idea/eclipseCodeFormatter.xml | 15 + .idea/encodings.xml | 7 + .idea/misc.xml | 83 ++++ .idea/saveactions_settings.xml | 22 + .idea/vcs.xml | 6 + .settings/org.eclipse.jdt.core.prefs | 419 ++++++++++++++++++ .settings/org.eclipse.jdt.ui.prefs | 127 ++++++ docs/contribute.md | 26 ++ .../api/CheckConfiguration.java | 12 +- .../validationtool/api/InputFactory.java | 8 +- .../validationtool/impl/DefaultCheck.java | 7 - .../impl/model/BaseScenario.java | 2 +- .../validationtool/impl/model/Result.java | 2 +- .../impl/tasks/DocumentParseAction.java | 2 +- .../tasks/SchematronValidationAction.java | 3 - 18 files changed, 746 insertions(+), 27 deletions(-) create mode 100644 .idea/checkstyle-idea.xml create mode 100644 .idea/compiler.xml create mode 100644 .idea/eclipseCodeFormatter.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/saveactions_settings.xml create mode 100644 .idea/vcs.xml create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 .settings/org.eclipse.jdt.ui.prefs create mode 100644 docs/contribute.md diff --git a/.gitignore b/.gitignore index 0f43236..6aaa9ee 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,7 @@ # Log file *.log .idea -.settings -*.iml +#*.iml # Package Files # *.jar diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..ef7efd6 --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..a26cfb6 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/eclipseCodeFormatter.xml b/.idea/eclipseCodeFormatter.xml new file mode 100644 index 0000000..fa47614 --- /dev/null +++ b/.idea/eclipseCodeFormatter.xml @@ -0,0 +1,15 @@ + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..67472d0 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..aebea3c --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/saveactions_settings.xml b/.idea/saveactions_settings.xml new file mode 100644 index 0000000..3b2acd8 --- /dev/null +++ b/.idea/saveactions_settings.xml @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..2f5e230 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,419 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=warning +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=warning +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.processAnnotations=disabled +org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=18 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=83 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=120 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=140 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=true +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..16bf637 --- /dev/null +++ b/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,127 @@ +cleanup.add_default_serial_version_id=false +cleanup.add_generated_serial_version_id=true +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=true +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=true +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=true +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=true +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=true +cleanup.use_this_for_non_static_field_access=true +cleanup.use_this_for_non_static_field_access_only_if_necessary=false +cleanup.use_this_for_non_static_method_access=true +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_initCleanUpProfile +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_initFormatterProfile +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com;lombok;de; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates=