From 9ff3cde6fa1c2b7bf8a73597ccf61d8a8525dc9d Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Mon, 10 Aug 2020 08:53:49 +0200
Subject: [PATCH 001/210] [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 46c1ff4..f7ef36f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
KoSIT XML Prüftool Implementierungde.kosit
- 1.3.1
+ 1.3.2-SNAPSHOTvalidationtoolKoSIT XML Validator against XSD and Schematron based on defined scenarios.
@@ -493,7 +493,7 @@
https://github.com/itplr-kosit/validationtool.gitscm:git:https://projekte.kosit.org/kosit/validator.git
- v1.3.1
+ v1.1.0
-
+4.0.0KoSIT XML Prüftool Implementierung
@@ -132,7 +132,7 @@
de.kosit.validationtoolpackaged-test-scenarios
- 1.0.0
+ 1.0.1test
@@ -430,6 +430,7 @@
truetrue
+
${jacocoFailsafe}-classpath
diff --git a/src/test/java/de/kosit/validationtool/impl/ContentRepositoryTest.java b/src/test/java/de/kosit/validationtool/impl/ContentRepositoryTest.java
index fe1959c..90a0355 100644
--- a/src/test/java/de/kosit/validationtool/impl/ContentRepositoryTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/ContentRepositoryTest.java
@@ -116,7 +116,7 @@ public class ContentRepositoryTest {
public void loadFromJar() throws URISyntaxException {
assert Helper.JAR_REPOSITORY != null;
this.repository = new ContentRepository(ResolvingMode.STRICT_RELATIVE.getStrategy(), Helper.JAR_REPOSITORY.toURI());
- final XsltExecutable xsltExecutable = this.repository.loadXsltScript(URI.create("resources/eRechnung/report.xsl"));
+ final XsltExecutable xsltExecutable = this.repository.loadXsltScript(URI.create("report.xsl"));
assertThat(xsltExecutable).isNotNull();
}
diff --git a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
index c3e5e1b..5215357 100644
--- a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
@@ -27,8 +27,10 @@ import static de.kosit.validationtool.impl.Helper.Simple.REJECTED;
import static de.kosit.validationtool.impl.Helper.Simple.SCHEMATRON_INVALID;
import static de.kosit.validationtool.impl.Helper.Simple.SIMPLE_VALID;
import static de.kosit.validationtool.impl.Helper.Simple.UNKNOWN;
+import static java.util.Objects.requireNonNull;
import static org.assertj.core.api.Assertions.assertThat;
+import java.net.URISyntaxException;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@@ -57,13 +59,22 @@ public class DefaultCheckTest {
// for checking certain error scenarios.
private DefaultCheck errorCheck;
+ private DefaultCheck jarScenarioCheck;
+
@Before
- public void setup() {
+ public void setup() throws URISyntaxException {
final Configuration validConfig = Configuration.load(Simple.SCENARIOS, Simple.REPOSITORY_URI).build();
this.validCheck = new DefaultCheck(validConfig);
final Configuration errorConfig = Configuration.load(Simple.ERROR_SCENARIOS, Simple.REPOSITORY_URI).build();
this.errorCheck = new DefaultCheck(errorConfig);
+
+ final Configuration jarConfig = Configuration
+ .load(requireNonNull(DefaultCheckTest.class.getClassLoader().getResource("simple/packaged/scenarios.xml")).toURI(),
+ requireNonNull(DefaultCheckTest.class.getClassLoader().getResource("simple/packaged/repository/")).toURI())
+ .build();
+
+ this.jarScenarioCheck = new DefaultCheck(jarConfig);
}
@Test
@@ -77,6 +88,17 @@ public class DefaultCheckTest {
assertThat(doc.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.ACCEPTABLE);
}
+ @Test
+ public void testJarCase() {
+ final Result doc = this.jarScenarioCheck.checkInput(read(SIMPLE_VALID));
+ assertThat(doc).isNotNull();
+ assertThat(doc.getReport()).isNotNull();
+ assertThat(doc.isAcceptable()).isTrue();
+ assertThat(doc.isSchematronValid()).isTrue();
+ assertThat(doc.isSchemaValid()).isTrue();
+ assertThat(doc.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.ACCEPTABLE);
+ }
+
@Test
public void testWithoutAcceptMatch() {
final Result doc = this.validCheck.checkInput(read(Simple.FOO));
diff --git a/src/test/java/de/kosit/validationtool/impl/Helper.java b/src/test/java/de/kosit/validationtool/impl/Helper.java
index 57a5a5a..88f048e 100644
--- a/src/test/java/de/kosit/validationtool/impl/Helper.java
+++ b/src/test/java/de/kosit/validationtool/impl/Helper.java
@@ -123,7 +123,7 @@ public class Helper {
public static final URI ASSERTIONS = EXAMPLES_DIR.resolve("assertions/tests-xrechnung.xml");
- public static final URL JAR_REPOSITORY = Helper.class.getClassLoader().getResource("xrechnung/repository/");
+ public static final URL JAR_REPOSITORY = Helper.class.getClassLoader().getResource("simple/packaged/repository/");
/**
* Lädt ein XML-Dokument von der gegebenen URL
From 73daeaded6849c784068c88b02aadd757cab96b5 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Wed, 12 Aug 2020 08:34:27 +0200
Subject: [PATCH 005/210] (chore) some cleanup
---
.gitlab-ci.yml | 2 +-
.../java/de/kosit/validationtool/impl/DefaultCheckTest.java | 6 ++++++
.../impl/tasks/SchemaValidatorActionTest.java | 2 ++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 49ee7c6..2985761 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -106,7 +106,7 @@ build-java-8-openj9:
- target/surefire-reports/*.xml
- target/failsafe-reports/*.xml
-build-java8-alpine:
+build-java8:
stage: build
image: maven:3-jdk-8-alpine
script:
diff --git a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
index 5215357..faba39e 100644
--- a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
@@ -85,6 +85,11 @@ public class DefaultCheckTest {
assertThat(doc.isAcceptable()).isTrue();
assertThat(doc.isSchematronValid()).isTrue();
assertThat(doc.isSchemaValid()).isTrue();
+ assertThat(doc.getFailedAsserts()).isEmpty();
+ assertThat(doc.getSchematronResult()).isNotEmpty();
+ assertThat(doc.getSchematronResult()).hasSize(1);
+ assertThat(doc.getSchematronResult().get(0).getActivePatterns()).isNotEmpty();
+ assertThat(doc.getSchematronResult().get(0).getFiredRules()).isNotEmpty();
assertThat(doc.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.ACCEPTABLE);
}
@@ -192,6 +197,7 @@ public class DefaultCheckTest {
assertThat(result.isSchemaValid()).isTrue();
assertThat(result.getFailedAsserts()).isNotEmpty();
assertThat(result.isSchematronValid()).isFalse();
+ assertThat(result.getSchematronResult().get(0).findFailedAssert("content-1")).isPresent();
assertThat(result.isProcessingSuccessful()).isTrue();
// acceptMatch overules schematron!!!
assertThat(result.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.ACCEPTABLE);
diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java b/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java
index a25ffe9..642df80 100644
--- a/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java
@@ -43,6 +43,7 @@ import org.xml.sax.SAXException;
import de.kosit.validationtool.api.Input;
import de.kosit.validationtool.api.InputFactory;
+import de.kosit.validationtool.api.XmlError.Severity;
import de.kosit.validationtool.impl.Helper;
import de.kosit.validationtool.impl.Helper.Simple;
import de.kosit.validationtool.impl.Scenario;
@@ -85,6 +86,7 @@ public class SchemaValidatorActionTest {
bag.getSchemaValidationResult().getErrors().forEach(e -> {
assertThat(e.getRowNumber()).isGreaterThan(0);
assertThat(e.getColumnNumber()).isGreaterThan(0);
+ assertThat(e.getSeverity()).isEqualTo(Severity.SEVERITY_ERROR);
});
}
From 03119dc7f335b6f97ccfb061fffbb64b18e6cb6c Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Wed, 12 Aug 2020 08:44:07 +0200
Subject: [PATCH 006/210] (chore) some cleanup
---
.../validationtool/config/SimpleConfigTest.java | 10 +---------
.../validationtool/config/TestScenarioFactory.java | 13 +++++++++++++
.../kosit/validationtool/impl/DefaultCheckTest.java | 2 ++
3 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java b/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java
index f4374ec..16e31a1 100644
--- a/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java
+++ b/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java
@@ -1,7 +1,6 @@
package de.kosit.validationtool.config;
-import static de.kosit.validationtool.config.ConfigurationBuilder.fallback;
-import static de.kosit.validationtool.config.TestScenarioFactory.createScenario;
+import static de.kosit.validationtool.config.TestScenarioFactory.createSimpleConfiguration;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
@@ -11,7 +10,6 @@ import de.kosit.validationtool.api.InputFactory;
import de.kosit.validationtool.api.Result;
import de.kosit.validationtool.impl.DefaultCheck;
import de.kosit.validationtool.impl.Helper.Simple;
-import de.kosit.validationtool.impl.ResolvingMode;
/**
* @author Andreas Penski
@@ -28,13 +26,7 @@ public class SimpleConfigTest {
assertThat(result).isNotNull();
}
- static ConfigurationBuilder createSimpleConfiguration() {
- return Configuration.create().name("Simple-API").with(createScenario()
- // .description("awesome api")
- ).with(fallback().name("default").source("report.xsl"))
- .resolvingMode(ResolvingMode.STRICT_RELATIVE).useRepository(Simple.REPOSITORY_URI);
- }
}
diff --git a/src/test/java/de/kosit/validationtool/config/TestScenarioFactory.java b/src/test/java/de/kosit/validationtool/config/TestScenarioFactory.java
index 61772d1..70ae5cc 100644
--- a/src/test/java/de/kosit/validationtool/config/TestScenarioFactory.java
+++ b/src/test/java/de/kosit/validationtool/config/TestScenarioFactory.java
@@ -1,16 +1,29 @@
package de.kosit.validationtool.config;
+import static de.kosit.validationtool.config.ConfigurationBuilder.fallback;
import static de.kosit.validationtool.config.ConfigurationBuilder.report;
import static de.kosit.validationtool.config.ConfigurationBuilder.scenario;
import static de.kosit.validationtool.config.ConfigurationBuilder.schema;
import java.net.URI;
+import java.util.Date;
+
+import de.kosit.validationtool.api.Configuration;
+import de.kosit.validationtool.impl.Helper.Simple;
+import de.kosit.validationtool.impl.ResolvingMode;
/**
* @author Andreas Penski
*/
public class TestScenarioFactory {
+ static ConfigurationBuilder createSimpleConfiguration() {
+ return Configuration.create().name("Simple-API").author("me").description("test desc").date(new Date())
+ .with(createScenario().description("awesome scenario")).with(fallback().name("default").source("report.xsl"))
+
+ .resolvingMode(ResolvingMode.STRICT_RELATIVE).useRepository(Simple.REPOSITORY_URI);
+ }
+
public static ScenarioBuilder createScenario() {
return scenario("simple").validate(schema("Sample Schema").schemaLocation(URI.create("simple.xsd")))
.with(report("Report für eRechnung").source("report.xsl")).acceptWith("count(//test:rejected) = 0")
diff --git a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
index faba39e..1d92e18 100644
--- a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
@@ -90,6 +90,8 @@ public class DefaultCheckTest {
assertThat(doc.getSchematronResult()).hasSize(1);
assertThat(doc.getSchematronResult().get(0).getActivePatterns()).isNotEmpty();
assertThat(doc.getSchematronResult().get(0).getFiredRules()).isNotEmpty();
+ assertThat(doc.getSchematronResult().get(0).hasFailedAsserts()).isFalse();
+ assertThat(doc.getSchematronResult().get(0).getFailedAsserts()).isEmpty();
assertThat(doc.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.ACCEPTABLE);
}
From d7beb1040418ae5cbeb9427532fd87482f55756c Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Wed, 12 Aug 2020 08:48:53 +0200
Subject: [PATCH 007/210] fix compile
---
.../kosit/validationtool/config/ConfigurationBuilderTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/test/java/de/kosit/validationtool/config/ConfigurationBuilderTest.java b/src/test/java/de/kosit/validationtool/config/ConfigurationBuilderTest.java
index 86df9be..eaee8d9 100644
--- a/src/test/java/de/kosit/validationtool/config/ConfigurationBuilderTest.java
+++ b/src/test/java/de/kosit/validationtool/config/ConfigurationBuilderTest.java
@@ -2,7 +2,7 @@ package de.kosit.validationtool.config;
import static de.kosit.validationtool.config.ConfigurationBuilder.report;
import static de.kosit.validationtool.config.ConfigurationBuilder.schematron;
-import static de.kosit.validationtool.config.SimpleConfigTest.createSimpleConfiguration;
+import static de.kosit.validationtool.config.TestScenarioFactory.createSimpleConfiguration;
import static org.assertj.core.api.Assertions.assertThat;
import java.net.URI;
From cc7bfb2250e0fb7ef5142d39e9d3f76c3ad626bc Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Wed, 12 Aug 2020 09:02:34 +0200
Subject: [PATCH 008/210] fix date conversion in ConfigurationBuilder
---
CHANGELOG.md | 2 ++
.../de/kosit/validationtool/config/ConfigurationBuilder.java | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8ee309e..5e45ded 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
+### Fixed
+- date conversion when using [ConfigurationBuilder#date(Date)](https://github.com/itplr-kosit/validator/blob/d7beb1040418ae5cbeb9427532fd87482f55756c/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java#L109)
## 1.3.1
### Fixed
diff --git a/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java b/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java
index ce199b3..3a0f64a 100644
--- a/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java
+++ b/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java
@@ -5,6 +5,7 @@ import static de.kosit.validationtool.impl.DateFactory.createTimestamp;
import java.net.URI;
import java.nio.file.Path;
import java.time.LocalDate;
+import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
@@ -107,7 +108,7 @@ public class ConfigurationBuilder {
* @return this
*/
public ConfigurationBuilder date(final Date date) {
- return date(date != null ? LocalDate.ofEpochDay(date.getTime()) : null);
+ return date(date != null ? date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null);
}
/**
From f9c6248513c32c84833e089a41540ab21d5de312 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Wed, 12 Aug 2020 10:13:56 +0200
Subject: [PATCH 009/210] javadoc translations
---
.../de/kosit/validationtool/api/Check.java | 33 ++++++++++---------
.../validationtool/impl/DefaultCheck.java | 10 +++---
2 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/src/main/java/de/kosit/validationtool/api/Check.java b/src/main/java/de/kosit/validationtool/api/Check.java
index 17053a2..dd0e6cf 100644
--- a/src/main/java/de/kosit/validationtool/api/Check.java
+++ b/src/main/java/de/kosit/validationtool/api/Check.java
@@ -26,18 +26,18 @@ import org.w3c.dom.Document;
/**
- * Zentrale Schnittstellendefinition für das Prüf-Tool.
+ * Main validator interface for checking incoming files.
*
* @author Andreas Penski
*/
public interface Check {
/**
- * 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.
+ * Checks an incoming xml {@link Input Inputs}. The result-{@link Document} is readonly. To change the this document you
+ * need to copy the nodes into an new {@link Document}.
*
- * @param input die Resource / XML-Datei, die geprüft werden soll.
- * @return ein Ergebnis-{@link Document} (readonly)
+ * @param input the resource / xml file to validate.
+ * @return a result-{@link Document} (readonly)
*/
default Document check(final Input input) {
final Result result = checkInput(input);
@@ -46,29 +46,30 @@ public interface Check {
}
/**
- * Führt die konfigurierte Prüfung für die übergebene Resource aus.
+ * Checks an incoming xml file.
*
- * @param input die Resource / XML-Datei, die geprüft werden soll.
- * @return ein Ergebnis-{@link Document}
+ * @param input the resource / xml file to validate.
+ * @return a {@link Result} object
*/
Result checkInput(Input input);
/**
- * 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 (readonly)
+ * Checks an incoming xml files in batch mode. Processing is sequential. The result-{@link Document Documents} are
+ * readonly. To change the this document you need to copy them into new {@link Document Documents}.
+ *
+ *
+ * @param input list of xml {@link Input Inputs}
+ * @return list of result-{@link Document Documents} (readonly)
*/
default List check(final List input) {
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.
+ * Checks an incoming xml files in batch mode. Processing is sequential.
*
- * @param input die Eingabe
- * @return Liste mit Ergebnis-Dokumenten
+ * @param input list of xml {@link Input Inputs}
+ * @return list of {@link Result}
*/
default List checkInput(final List input) {
return input.stream().map(this::checkInput).collect(Collectors.toList());
diff --git a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
index 3252d76..fc6a9d9 100644
--- a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
+++ b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
@@ -51,8 +51,8 @@ import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
import net.sf.saxon.s9api.Processor;
/**
- * Die Referenz-Implementierung für den Prüfprozess. Nach initialer Konfiguration ist diese Klasse threadsafe und kann
- * in Server-Umgebungen eingesetzt werden
+ * The reference implementation for the validation process. After initialisation, instances are threadsafe and should be
+ * reused since initializing saxon runtime objects is an rather heavyweight process.
*
* @author Andreas Penski
*/
@@ -68,9 +68,9 @@ public class DefaultCheck implements Check {
private final List checkSteps;
/**
- * Erzeugt eine neue Instanz mit der angegebenen Konfiguration.
+ * Creates a new instance for the {@link Configuration}.
*
- * @param configuration die Konfiguration
+ * @param configuration the Configuration
*/
public DefaultCheck(final Configuration configuration) {
this.configuration = configuration;
@@ -100,8 +100,6 @@ public class DefaultCheck implements Check {
return type;
}
-
-
@Override
public Result checkInput(final Input input) {
final CheckAction.Bag t = new CheckAction.Bag(input, createReport());
From a41336e9cfc3ae37d15d3d15ae065bb9029bb421 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Thu, 13 Aug 2020 10:04:34 +0200
Subject: [PATCH 010/210] support for XdmNode as Input cleanup
---
CHANGELOG.md | 7 +++
pom.xml | 26 ++++++++-
.../validationtool/api/InputFactory.java | 53 +++++++++++++++----
.../de/kosit/validationtool/api/Result.java | 2 +-
.../kosit/validationtool/daemon/Daemon.java | 15 +++---
.../validationtool/impl/DefaultCheck.java | 1 +
.../de/kosit/validationtool/impl/Printer.java | 21 ++++++++
.../impl/input/SourceInput.java | 45 +++++++++++-----
.../impl/input/XdmNodeInput.java | 34 ++++++++++++
.../impl/tasks/CheckAction.java | 2 +-
.../impl/tasks/DocumentParseAction.java | 20 +++++--
src/main/resources/gui/docs/configurations.md | 2 +-
.../validationtool/api/InputFactoryTest.java | 18 +++++--
.../validationtool/impl/DefaultCheckTest.java | 19 +++++++
14 files changed, 227 insertions(+), 38 deletions(-)
create mode 100644 src/main/java/de/kosit/validationtool/impl/Printer.java
create mode 100644 src/main/java/de/kosit/validationtool/impl/input/XdmNodeInput.java
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5e45ded..c394c53 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- date conversion when using [ConfigurationBuilder#date(Date)](https://github.com/itplr-kosit/validator/blob/d7beb1040418ae5cbeb9427532fd87482f55756c/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java#L109)
+### Added
+- read saxon XdmNode with InputFactory
+
+### Changed
+- InputFactory has methods to read any java.xml.transform.Source as Input not only StreamSources
+- InputFactory uses a generated UUID as name for SourceInput, if no "real" name can be derived
+
## 1.3.1
### Fixed
- `getFailedAsserts()` and `isSchematronValid()` in [DefaultResult.java](https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/impl/DefaultResult.java)
diff --git a/pom.xml b/pom.xml
index 0c0651b..ca017d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -426,7 +426,7 @@
java
- true
+ falsetruetrue
@@ -487,10 +487,34 @@
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.2.0
+
+ 8
+ none
+
+
+
+ attach-javadocs
+
+ jar
+
+
+
+
+
+
+
+
+
+
+
https://github.com/itplr-kosit/validationtool.gitscm:git:https://projekte.kosit.org/kosit/validator.git
diff --git a/src/main/java/de/kosit/validationtool/api/InputFactory.java b/src/main/java/de/kosit/validationtool/api/InputFactory.java
index b491cb2..c0035fd 100644
--- a/src/main/java/de/kosit/validationtool/api/InputFactory.java
+++ b/src/main/java/de/kosit/validationtool/api/InputFactory.java
@@ -29,6 +29,7 @@ import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
import java.nio.file.Path;
+import java.util.UUID;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
@@ -42,6 +43,9 @@ import de.kosit.validationtool.impl.input.ByteArrayInput;
import de.kosit.validationtool.impl.input.ResourceInput;
import de.kosit.validationtool.impl.input.SourceInput;
import de.kosit.validationtool.impl.input.StreamHelper;
+import de.kosit.validationtool.impl.input.XdmNodeInput;
+
+import net.sf.saxon.s9api.XdmNode;
/**
* Service zum Einlesen des Test-Objekts in den Speicher. Beim Einlesen wird gleichzeitig eine Prüfsumme ermittelt und
@@ -54,6 +58,11 @@ public class InputFactory {
static final String DEFAULT_ALGORITH = "SHA-256";
+ /**
+ * Pseudo hashcode algorithm name, which indicates, thate the hashcode of the {@link Input} is actually the name.
+ */
+ static final String PSEUDO_NAME_ALGORITHM = "NAME";
+
private static final String MESSAGE_OPEN_STREAM_ERROR = "Can not open stream from";
@Getter
@@ -164,15 +173,18 @@ public class InputFactory {
}
/**
- * Reads a test document from a {@link Source}.
- * Note: computing the hashcode is only supported for {@link StreamSource}. You can not directly use other {@link Source
- * Soures}. You need to supply the hashcode for identification then.
+ * Reads a test document from a {@link Source}. Note: computing the hashcode is only supported for {@link StreamSource}.
+ * You can not directly use other {@link Source Soures}. You need to supply the hashcode for identification then.
*
* @param source source
* @return an {@link Input}
*/
- public static Input read(final StreamSource source) {
- return read(source, DEFAULT_ALGORITH);
+ public static Input read(final Source source) {
+ if (source instanceof StreamSource) {
+ return read(source, source.getSystemId(), DEFAULT_ALGORITH);
+ }
+ final String name = UUID.randomUUID().toString();
+ return read(source, name, PSEUDO_NAME_ALGORITHM, name.getBytes());
}
/**
@@ -182,11 +194,16 @@ public class InputFactory {
* Soures}. You need to supply the hashcode for identification then.
*
* @param source source
- * @param digestAlgorithm the digest algorithm
+ * @param name the digest algorithm
* @return an {@link Input}
*/
- public static Input read(final StreamSource source, final String digestAlgorithm) {
- return read(source, digestAlgorithm, null);
+ public static Input read(final Source source, final String name) {
+ checkNotEmpty(name);
+ return read(source, name, PSEUDO_NAME_ALGORITHM, name.getBytes());
+ }
+
+ public static Input read(final Source source, final String name, final String digestAlgorithm) {
+ return read(source, name, digestAlgorithm, null);
}
/**
@@ -198,7 +215,12 @@ public class InputFactory {
*/
public static Input read(final Source source, final String digestAlgorithm, final byte[] hashcode) {
checkNull(source);
- return new SourceInput(source, source.getSystemId(), digestAlgorithm, hashcode);
+ return read(source, source.getSystemId(), digestAlgorithm, hashcode);
+ }
+
+ public static Input read(final Source source, final String name, final String digestAlgorithm, final byte[] hashcode) {
+ checkNull(source);
+ return new SourceInput(source, name, digestAlgorithm, hashcode);
}
/**
@@ -281,4 +303,17 @@ public class InputFactory {
return read(new StreamSource(inputStream, name), digestAlgorithm);
}
+ /**
+ * Reads a saxon {@link XdmNode} with a given name. Hashcode identification is based on the name of the supplied input.
+ * Now real hashcode is computed.
+ *
+ * @param node the node to read
+ * @param name the name of the {@link Input}
+ * @return an {@link Input} to validate
+ */
+ public static Input read(final XdmNode node, final String name) {
+ checkNull(node);
+ return new XdmNodeInput(node, name, PSEUDO_NAME_ALGORITHM, name.getBytes());
+ }
+
}
diff --git a/src/main/java/de/kosit/validationtool/api/Result.java b/src/main/java/de/kosit/validationtool/api/Result.java
index a32adb2..91617ae 100644
--- a/src/main/java/de/kosit/validationtool/api/Result.java
+++ b/src/main/java/de/kosit/validationtool/api/Result.java
@@ -9,7 +9,7 @@ import org.w3c.dom.Document;
import net.sf.saxon.s9api.XdmNode;
/**
- * API Rückgabe Objekt des Ergebnisses des Validierungsprozesses.
+ * API result object holding various information of the validation process results.
*
* @author Andreas Penski
*/
diff --git a/src/main/java/de/kosit/validationtool/daemon/Daemon.java b/src/main/java/de/kosit/validationtool/daemon/Daemon.java
index fa0dcbe..24da017 100644
--- a/src/main/java/de/kosit/validationtool/daemon/Daemon.java
+++ b/src/main/java/de/kosit/validationtool/daemon/Daemon.java
@@ -1,5 +1,6 @@
package de.kosit.validationtool.daemon;
+import static de.kosit.validationtool.impl.Printer.writeOut;
import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
import java.io.IOException;
@@ -10,7 +11,6 @@ import java.util.concurrent.Executors;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
-import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
@@ -48,7 +48,7 @@ public class Daemon {
* @param port the port to expose
* @param threadCount the number of working threads
*/
- public Daemon(String hostname, int port, int threadCount) {
+ public Daemon(final String hostname, final int port, final int threadCount) {
this.bindAddress = hostname;
this.port = port;
this.threadCount = threadCount;
@@ -73,17 +73,20 @@ public class Daemon {
server.setExecutor(createExecutor());
server.start();
log.info("Server {} started", server.getAddress());
+ if (!log.isInfoEnabled()) {
+ writeOut("Server {0} started", server.getAddress());
+ }
} catch (final IOException e) {
log.error("Error starting HttpServer for Valdidator: {}", e.getMessage(), e);
}
}
- private HttpHandler createRootHandler(Configuration config) {
- HttpHandler rootHandler;
+ private HttpHandler createRootHandler(final Configuration config) {
+ final HttpHandler rootHandler;
final DefaultCheck check = new DefaultCheck(config);
final CheckHandler checkHandler = new CheckHandler(check, config.getContentRepository().getProcessor());
- if (guiEnabled) {
- GuiHandler gui = new GuiHandler();
+ if (this.guiEnabled) {
+ final GuiHandler gui = new GuiHandler();
rootHandler = new RoutingHandler(checkHandler, gui);
} else {
rootHandler = checkHandler;
diff --git a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
index fc6a9d9..81baa2c 100644
--- a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
+++ b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
@@ -62,6 +62,7 @@ public class DefaultCheck implements Check {
@Getter
private final ConversionService conversionService;
+ @Getter
private final Configuration configuration;
@Getter
diff --git a/src/main/java/de/kosit/validationtool/impl/Printer.java b/src/main/java/de/kosit/validationtool/impl/Printer.java
new file mode 100644
index 0000000..3a1eb51
--- /dev/null
+++ b/src/main/java/de/kosit/validationtool/impl/Printer.java
@@ -0,0 +1,21 @@
+package de.kosit.validationtool.impl;
+
+import java.text.MessageFormat;
+
+/**
+ * Wrapper for {@link System Systems} printing capability.
+ *
+ * @author Andreas Penski
+ */
+public class Printer {
+
+ /**
+ * Writes to standard output channel.
+ *
+ * @param message the message with placeholders
+ * @param params the params.
+ */
+ public static void writeOut(final String message, final Object... params) {
+ System.out.println(MessageFormat.format(message, params));
+ }
+}
diff --git a/src/main/java/de/kosit/validationtool/impl/input/SourceInput.java b/src/main/java/de/kosit/validationtool/impl/input/SourceInput.java
index 5cd7753..637990c 100644
--- a/src/main/java/de/kosit/validationtool/impl/input/SourceInput.java
+++ b/src/main/java/de/kosit/validationtool/impl/input/SourceInput.java
@@ -1,9 +1,13 @@
package de.kosit.validationtool.impl.input;
+import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
+
import java.io.IOException;
import java.nio.charset.Charset;
+import javax.xml.bind.util.JAXBSource;
import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamSource;
import org.apache.commons.io.input.ReaderInputStream;
@@ -11,21 +15,23 @@ import org.apache.commons.io.input.ReaderInputStream;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
+import net.sf.saxon.om.TreeInfo;
+
/**
- * A validator {@link de.kosit.validationtool.api.Input} based on a {@link Source}.
+ * A validator {@link de.kosit.validationtool.api.Input} based on a {@link Source}.
*
* Note: The various implementations of {@link Source} varies wether the can be read twice or no. This implementation
* tries to handle this with respect document identification (hashcode).
*
- * This class is know to work with:
+ * This class is known to work with:
*
*
{@link StreamSource} - both {@link java.io.InputStream} based and {@link java.io.Reader} based
*
{@link javax.xml.transform.dom.DOMSource}
*
{@link javax.xml.bind.util.JAXBSource}
+ *
{@link TreeInfo}
*
*
* Other {@link Source Sources} may work as well, please try and let us know.
- *
*
* @author Andreas Penski
*/
@@ -51,28 +57,33 @@ public class SourceInput extends AbstractInput {
validate();
}
+ @Override
+ public String getName() {
+ return defaultIfBlank(this.name, this.source.getClass().getSimpleName());
+ }
+
private void validate() {
- if (!isHashcodeComputed() && isNotSupported()) {
+ if (!isHashcodeComputed() && !isHashcodeComputationSupported()) {
throw new IllegalStateException("Unsupported source. Only StreamSource supported yet");
}
if (!isHashcodeComputed() && ((StreamSource) this.source).getInputStream() == null) {
log.warn("No hashcode supplied, will wrap the reader using system default charset");
}
+ if (!(isTreeInfo() || isDomSource() || isStreamSource() || isJaxbSource())) {
+ log.warn("No known to be working Source implementation provided.");
+ }
}
@Override
public Source getSource() throws IOException {
- if (!isHashcodeComputed() && isNotSupported()) {
- throw new IllegalStateException("Unsupported source. Only InputStream-based StreamSource supported yet");
- }
if (isConsumed()) {
throw new IllegalStateException("A SourceInput can only read once");
}
return isHashcodeComputed() ? this.source : wrappedSource();
}
- private boolean isNotSupported() {
- return !isStreamSource();
+ private boolean isHashcodeComputationSupported() {
+ return isStreamSource();
}
private boolean isConsumed() throws IOException {
@@ -94,6 +105,18 @@ public class SourceInput extends AbstractInput {
return this.source instanceof StreamSource;
}
+ private boolean isDomSource() {
+ return this.source instanceof DOMSource;
+ }
+
+ public boolean isTreeInfo() {
+ return this.source instanceof TreeInfo;
+ }
+
+ private boolean isJaxbSource() {
+ return this.source instanceof JAXBSource;
+ }
+
private Source wrappedSource() {
Source result = this.source;
if (isStreamSource()) {
@@ -107,11 +130,9 @@ public class SourceInput extends AbstractInput {
return result;
}
-
-
@Override
public boolean supportsMultipleReads() {
- return false;
+ return isDomSource() || isTreeInfo();
}
}
diff --git a/src/main/java/de/kosit/validationtool/impl/input/XdmNodeInput.java b/src/main/java/de/kosit/validationtool/impl/input/XdmNodeInput.java
new file mode 100644
index 0000000..8780d3e
--- /dev/null
+++ b/src/main/java/de/kosit/validationtool/impl/input/XdmNodeInput.java
@@ -0,0 +1,34 @@
+package de.kosit.validationtool.impl.input;
+
+import javax.xml.transform.Source;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+
+import de.kosit.validationtool.api.Input;
+
+import net.sf.saxon.s9api.XdmNode;
+
+/**
+ * An {@link Input} implementation holding saxon's {@link XdmNode} object.
+ *
+ * @author Andreas Penski
+ */
+@RequiredArgsConstructor
+@Getter
+public class XdmNodeInput implements Input {
+
+ private final XdmNode node;
+
+ private final String name;
+
+ private final String digestAlgorithm;
+
+ private final byte[] hashCode;
+
+ @Override
+ public Source getSource() {
+ // usually not neccessary to be called.
+ return this.node.getUnderlyingNode();
+ }
+}
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 23d6476..a5b65aa 100644
--- a/src/main/java/de/kosit/validationtool/impl/tasks/CheckAction.java
+++ b/src/main/java/de/kosit/validationtool/impl/tasks/CheckAction.java
@@ -134,7 +134,7 @@ public interface CheckAction {
* Prüfschritt bedingt auszuführen.
*
* @param results die bisher gesammelten Information
- * @return true wenn der Schritt ausgelassen werden soll
+ * @return true wenn der Schritt ausgelassen werden soll
*/
default boolean isSkipped(final Bag results) {
return false;
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 c5559a7..89166a1 100644
--- a/src/main/java/de/kosit/validationtool/impl/tasks/DocumentParseAction.java
+++ b/src/main/java/de/kosit/validationtool/impl/tasks/DocumentParseAction.java
@@ -27,6 +27,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.api.Input;
+import de.kosit.validationtool.impl.input.XdmNodeInput;
import de.kosit.validationtool.impl.model.Result;
import de.kosit.validationtool.model.reportInput.ValidationResultsWellformedness;
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
@@ -47,6 +48,7 @@ import net.sf.saxon.s9api.XdmNode;
public class DocumentParseAction implements CheckAction {
private final Processor processor;
+
/**
* Parsed und überprüft ein übergebenes Dokument darauf ob es well-formed ist. Dies stellt den ersten
* Verarbeitungsschritt des Prüf-Tools dar. Diese Funktion verzichtet explizit auf die Validierung gegenüber einem
@@ -60,11 +62,17 @@ public class DocumentParseAction implements CheckAction {
throw new IllegalArgumentException("Input may not be null");
}
Result result;
+
try {
- final DocumentBuilder builder = this.processor.newDocumentBuilder();
- builder.setLineNumbering(true);
- final XdmNode doc = builder.build(content.getSource());
- result = new Result<>(doc, Collections.emptyList());
+ if (content instanceof XdmNodeInput && hasCompatibleConfiguration((XdmNodeInput) content)) {
+ // parsing not neccessary
+ result = new Result<>(((XdmNodeInput) content).getNode());
+ } else {
+ final DocumentBuilder builder = this.processor.newDocumentBuilder();
+ builder.setLineNumbering(true);
+ final XdmNode doc = builder.build(content.getSource());
+ result = new Result<>(doc, Collections.emptyList());
+ }
} catch (final SaxonApiException | IOException e) {
log.debug("Exception while parsing {}", content.getName(), e);
final XMLSyntaxError error = new XMLSyntaxError();
@@ -76,6 +84,10 @@ public class DocumentParseAction implements CheckAction {
return result;
}
+ private boolean hasCompatibleConfiguration(final XdmNodeInput content) {
+ return content.getNode().getProcessor().getUnderlyingConfiguration().isCompatible(this.processor.getUnderlyingConfiguration());
+ }
+
@Override
public void check(final Bag results) {
final Result parserResult = parseDocument(results.getInput());
diff --git a/src/main/resources/gui/docs/configurations.md b/src/main/resources/gui/docs/configurations.md
index 3e8678d..0f3b31e 100644
--- a/src/main/resources/gui/docs/configurations.md
+++ b/src/main/resources/gui/docs/configurations.md
@@ -11,5 +11,5 @@ Currently, there are two public third party validation configurations available.
* Source code is available on [GitHub](https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige)
* [Releases](https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige/releases) can also be downloaded
-For creating custom configurations see [configaration documentation](https://github.com/itplr-kosit/validator/blob/master/docs/configurations.md)
+For creating custom configurations see [configuration documentation](https://github.com/itplr-kosit/validator/blob/master/docs/configurations.md)
for details
\ No newline at end of file
diff --git a/src/test/java/de/kosit/validationtool/api/InputFactoryTest.java b/src/test/java/de/kosit/validationtool/api/InputFactoryTest.java
index fd1a209..55c294d 100644
--- a/src/test/java/de/kosit/validationtool/api/InputFactoryTest.java
+++ b/src/test/java/de/kosit/validationtool/api/InputFactoryTest.java
@@ -19,6 +19,7 @@
package de.kosit.validationtool.api;
+import static de.kosit.validationtool.impl.Helper.Simple.SIMPLE_VALID;
import static de.kosit.validationtool.impl.input.StreamHelper.drain;
import static org.assertj.core.api.Assertions.assertThat;
@@ -31,7 +32,6 @@ import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Paths;
-import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamSource;
@@ -188,8 +188,7 @@ public class InputFactoryTest {
final Document dom = NodeOverNodeInfo.wrap(handler.getDocumentNode().getUnderlyingNode()).getOwnerDocument();
final Input domInput = InputFactory.read(new DOMSource(dom), "MD5", "id".getBytes());
assertThat(domInput).isNotNull();
- final Source source = domInput.getSource();
- assertThat(source).isNotNull();
+ assertThat(domInput.getSource()).isNotNull();
final Result parsed = Helper.parseDocument(domInput);
assertThat(parsed.isValid()).isTrue();
@@ -197,4 +196,17 @@ public class InputFactoryTest {
assertThat(Helper.parseDocument(domInput).getObject()).isNotNull();
}
+ @Test
+ public void testXdmNode() throws Exception {
+ final XdmNode node = TestObjectFactory.createProcessor().newDocumentBuilder().build(new StreamSource(SIMPLE_VALID.toASCIIString()));
+ final Input nodeInput = InputFactory.read(node, "node test");
+ assertThat(nodeInput).isNotNull();
+ assertThat(nodeInput.getSource()).isNotNull();
+ final Result parsed = Helper.parseDocument(nodeInput);
+ assertThat(parsed.isValid()).isTrue();
+
+ // read twice
+ assertThat(Helper.parseDocument(nodeInput).getObject()).isNotNull();
+ }
+
}
diff --git a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
index 1d92e18..5217705 100644
--- a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
@@ -35,6 +35,8 @@ import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
+import javax.xml.transform.stream.StreamSource;
+
import org.junit.Before;
import org.junit.Test;
import org.w3c.dom.Document;
@@ -42,9 +44,12 @@ import org.w3c.dom.Document;
import de.kosit.validationtool.api.AcceptRecommendation;
import de.kosit.validationtool.api.Configuration;
import de.kosit.validationtool.api.Input;
+import de.kosit.validationtool.api.InputFactory;
import de.kosit.validationtool.api.Result;
import de.kosit.validationtool.impl.Helper.Simple;
+import net.sf.saxon.s9api.XdmNode;
+
/**
* Test das Check-Interface
*
@@ -238,4 +243,18 @@ public class DefaultCheckTest {
assertThat(result.getProcessingErrors()).hasSize(1);
}
+ @Test
+ public void testXdmNode() throws Exception {
+ XdmNode node = TestObjectFactory.createProcessor().newDocumentBuilder().build(new StreamSource(SIMPLE_VALID.toASCIIString()));
+ Input domInput = InputFactory.read(node, "node test");
+ Result result = this.validCheck.checkInput(domInput);
+ assertThat(result.isProcessingSuccessful()).isEqualTo(true);
+
+ // test compatible configuration
+ node = this.validCheck.getConfiguration().getContentRepository().getProcessor().newDocumentBuilder()
+ .build(new StreamSource(SIMPLE_VALID.toASCIIString()));
+ domInput = InputFactory.read(node, "node test");
+ result = this.validCheck.checkInput(domInput);
+ assertThat(result.isProcessingSuccessful()).isEqualTo(true);
+ }
}
From 46fff79fe2ceb2da1643cd14255507a7abe8e9ae Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Thu, 13 Aug 2020 15:11:46 +0200
Subject: [PATCH 011/210] #65 cli options for setting loglevel; defining a
default cli output
---
CHANGELOG.md | 2 +
.../cmd/CommandLineApplication.java | 390 +++---------------
.../cmd/CommandLineOptions.java | 97 +++++
.../validationtool/cmd/InternalCheck.java | 1 -
.../validationtool/cmd/PrintReportAction.java | 3 +-
.../kosit/validationtool/cmd/Validator.java | 331 +++++++++++++++
.../kosit/validationtool/cmd/report/Line.java | 2 +-
.../de/kosit/validationtool/impl/Printer.java | 10 +
.../cmd/CommandlineApplicationTest.java | 22 +-
9 files changed, 509 insertions(+), 349 deletions(-)
create mode 100644 src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java
create mode 100644 src/main/java/de/kosit/validationtool/cmd/Validator.java
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c394c53..c61706c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- read saxon XdmNode with InputFactory
+- [CLI] custom output without the various log messages
+- [CLI] options to set the log level (`-X` = full debug output, `-l ` set a specific level)
### Changed
- InputFactory has methods to read any java.xml.transform.Source as Input not only StreamSources
diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java
index 5421f71..38a8ded 100644
--- a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java
+++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java
@@ -19,188 +19,84 @@
package de.kosit.validationtool.cmd;
-import java.io.IOException;
-import java.net.URI;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.ArrayList;
+import static de.kosit.validationtool.cmd.CommandLineOptions.DAEMON_SIGNAL;
+import static de.kosit.validationtool.cmd.CommandLineOptions.HELP;
+import static de.kosit.validationtool.cmd.CommandLineOptions.createHelpOptions;
+import static de.kosit.validationtool.cmd.CommandLineOptions.createOptions;
+import static de.kosit.validationtool.cmd.CommandLineOptions.printHelp;
+import static de.kosit.validationtool.impl.Printer.writeErr;
+
import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
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.ArrayUtils;
-import org.apache.commons.lang3.StringUtils;
+import org.fusesource.jansi.AnsiRenderer.Code;
-import lombok.extern.slf4j.Slf4j;
-
-import de.kosit.validationtool.api.Configuration;
-import de.kosit.validationtool.api.Input;
-import de.kosit.validationtool.api.InputFactory;
-import de.kosit.validationtool.api.Result;
-import de.kosit.validationtool.cmd.assertions.Assertions;
-import de.kosit.validationtool.config.ConfigurationLoader;
-import de.kosit.validationtool.daemon.Daemon;
-import de.kosit.validationtool.impl.ConversionService;
-
-import net.sf.saxon.s9api.Processor;
+import de.kosit.validationtool.cmd.report.Line;
+import de.kosit.validationtool.impl.Printer;
/**
- * Commandline Version des Prüftools. Parsed die Kommandozeile und führt die konfigurierten Aktionen aus.
+ * Commandline interface of the validator. It parses the commandline args and hands over actual execution to
+ * {@link Validator}.
+ *
+ * This separated from {@link Validator} to configure the slf4j simple logging.
*
* @author Andreas Penski
*/
-@Slf4j
-@SuppressWarnings("squid:S3725") // performance is not a problem here
+// performance is not a problem here
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")
- .desc("Defines the out directory for results. Defaults to cwd").hasArg().build();
-
- private static final Option EXTRACT_HTML = Option.builder("h").longOpt("html")
- .desc("Extract and save any html content within result as a separate file ").build();
-
- private static final Option DEBUG = Option.builder("d").longOpt("debug").desc("Prints some more debug information").build();
-
- private static final Option SERIALIZE_REPORT_INPUT = Option.builder("c").longOpt("serialize-report-input")
- .desc("Serializes the report input to the cwd").build();
-
- 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();
-
- private static final Option DISABLE_GUI = Option.builder("G").longOpt("disable-gui").desc("Disables the GUI of the daemon mode")
- .build();
-
- private static final Option REPORT_POSTFIX = Option.builder(null).longOpt("report-postfix").hasArg()
- .desc("Postfix of the generated report name").build();
-
- private static final Option REPORT_PREFIX = Option.builder(null).longOpt("report-prefix").hasArg()
- .desc("Prefix of the generated report name").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();
-
private CommandLineApplication() {
// main class -> hide constructor
}
/**
- * Main-Funktion für die Kommandozeilen-Applikation.
+ * Main.
*
* @param args die Eingabe-Argumente
*/
public static void main(final String[] args) {
final int resultStatus = mainProgram(args);
if (DAEMON_SIGNAL != resultStatus) {
+ sayGoodby(resultStatus);
System.exit(resultStatus);
}
}
- /**
- * Hauptprogramm für die Kommandozeilen-Applikation.
- *
- * @param args die Eingabe-Argumente
- */
- static int mainProgram(final String[] args) {
- int returnValue = 0;
- final Options options = createOptions();
- if (isHelpRequested(args)) {
- printHelp(options);
+ private static void sayGoodby(final int resultStatus) {
+ Printer.writeOut("\n##############################");
+ if (resultStatus == 0) {
+ Printer.writeOut("# " + new Line(Code.GREEN).add("Validation succesful!").render(false, false) + " #");
} else {
- try {
+ Printer.writeOut("# " + new Line(Code.RED).add("Validation failed!").render(false, false) + " #");
+ }
+ Printer.writeOut("##############################");
+ }
+
+ // for testing purposes. Unless jvm is terminated during tests. See above
+ static int mainProgram(final String[] args) {
+
+ final Options options = createOptions();
+ int resultStatus;
+ try {
+ if (isHelpRequested(args)) {
+ printHelp(options);
+ resultStatus = 0;
+ } else {
final CommandLineParser parser = new DefaultParser();
final CommandLine cmd = parser.parse(options, args);
- if (cmd.hasOption(SERVER.getOpt())) {
- returnValue = startDaemonMode(cmd);
- } else if (cmd.getArgList().isEmpty()) {
- printHelp(createOptions());
- } else {
- returnValue = processActions(cmd);
- }
- } catch (final ParseException e) {
- log.error("Error processing command line arguments: " + e.getMessage());
- printHelp(options);
+ configureLogging(cmd);
+ resultStatus = Validator.mainProgram(cmd);
}
+ } catch (final ParseException e) {
+ writeErr("Error processing command line arguments: {0}", e.getMessage(), e);
+ printHelp(options);
+ resultStatus = 1;
}
- return returnValue;
- }
-
- private static int determinePort(final CommandLine cmd) {
- int port = 8080;
- if (checkOptionWithValue(PORT, cmd)) {
- port = Integer.parseInt(cmd.getOptionValue(PORT.getOpt()));
- }
- return port;
- }
-
- private static int determineThreads(final 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(final CommandLine cmd) {
- String host = "localhost";
- if (checkOptionWithValue(HOST, cmd)) {
- host = cmd.getOptionValue(HOST.getOpt());
- }
- return host;
- }
-
- private static int startDaemonMode(final CommandLine cmd) {
- final Option[] unavailable = new Option[] { PRINT, CHECK_ASSERTIONS, DEBUG, OUTPUT, EXTRACT_HTML, REPORT_POSTFIX, REPORT_PREFIX };
- warnUnusedOptions(cmd, unavailable, true);
- final ConfigurationLoader config = Configuration.load(determineDefinition(cmd), determineRepository(cmd));
- final Daemon validDaemon = new Daemon(determineHost(cmd), determinePort(cmd), determineThreads(cmd));
- if (cmd.hasOption(DISABLE_GUI.getOpt())) {
- validDaemon.setGuiEnabled(false);
- }
- validDaemon.startServer(config.build());
- return DAEMON_SIGNAL;
- }
-
- private static void warnUnusedOptions(final CommandLine cmd, final Option[] unavailable, final 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");
- }
+ return resultStatus;
}
private static boolean isHelpRequested(final String[] args) {
@@ -217,200 +113,26 @@ public class CommandLineApplication {
return false;
}
- private static int processActions(final CommandLine cmd) {
- try {
+ private static void configureLogging(final CommandLine cmd) throws ParseException {
+ if (cmd.hasOption(CommandLineOptions.DEBUG_LOG.getOpt())) {
+ System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "DEBUG");
+ } else if (cmd.hasOption(CommandLineOptions.LOG_LEVEL.getOpt())) {
- long start = System.currentTimeMillis();
- final Option[] unavailable = new Option[] { HOST, PORT, WORKER_COUNT, DISABLE_GUI };
- warnUnusedOptions(cmd, unavailable, false);
- final Configuration config = Configuration.load(determineDefinition(cmd), determineRepository(cmd)).build();
-
- final InternalCheck check = new InternalCheck(config);
- final Path outputDirectory = determineOutputDirectory(cmd);
-
- final Processor processor = config.getContentRepository().getProcessor();
- if (cmd.hasOption(EXTRACT_HTML.getOpt())) {
- check.getCheckSteps().add(new ExtractHtmlContentAction(processor, outputDirectory));
- }
- check.getCheckSteps().add(new SerializeReportAction(outputDirectory, processor, determineNamingStrategy(cmd)));
- if (cmd.hasOption(SERIALIZE_REPORT_INPUT.getOpt())) {
- check.getCheckSteps().add(new SerializeReportInputAction(outputDirectory, check.getConversionService()));
- }
- if (cmd.hasOption(PRINT.getOpt())) {
- check.getCheckSteps().add(new PrintReportAction(processor));
- }
-
- if (cmd.hasOption(CHECK_ASSERTIONS.getOpt())) {
- final Assertions assertions = loadAssertions(cmd.getOptionValue(CHECK_ASSERTIONS.getOpt()));
- check.getCheckSteps().add(new CheckAssertionAction(assertions, processor));
- }
- if (cmd.hasOption(PRINT_MEM_STATS.getOpt())) {
- check.getCheckSteps().add(new PrintMemoryStats());
- }
-
- log.info("Setup completed in {}ms\n", System.currentTimeMillis() - start);
-
- final Collection targets = determineTestTargets(cmd);
- start = System.currentTimeMillis();
- final Map results = new HashMap<>();
- for (final Path p : targets) {
- final Input input = InputFactory.read(p);
- results.put(p, check.checkInput(input));
- }
- final boolean result = check.printAndEvaluate(results);
- log.info("Processing {} object(s) completed in {}ms", targets.size(), System.currentTimeMillis() - start);
- return result ? 0 : 1;
-
- } catch (final Exception e) {
- e.printStackTrace();// NOSONAR
- if (cmd.hasOption(DEBUG.getOpt())) {
- log.error(e.getMessage(), e);
- } else {
- log.error(e.getMessage());
- }
- return -1;
- }
- }
-
- private static NamingStrategy determineNamingStrategy(final CommandLine cmd) {
- final DefaultNamingStrategy namingStrategy = new DefaultNamingStrategy();
- if (cmd.hasOption(REPORT_PREFIX.getLongOpt())) {
- namingStrategy.setPrefix(cmd.getOptionValue(REPORT_PREFIX.getLongOpt()));
- }
- if (cmd.hasOption(REPORT_POSTFIX.getLongOpt())) {
- namingStrategy.setPostfix(cmd.getOptionValue(REPORT_POSTFIX.getLongOpt()));
- }
-
- return namingStrategy;
- }
-
- private static Assertions loadAssertions(final String optionValue) {
- final Path p = Paths.get(optionValue);
- Assertions a = null;
- if (Files.exists(p)) {
- final ConversionService c = new ConversionService();
- c.initialize(de.kosit.validationtool.cmd.assertions.ObjectFactory.class.getPackage());
- a = c.readXml(p.toUri(), Assertions.class);
- }
- return a;
- }
-
- private static Path determineOutputDirectory(final CommandLine cmd) {
- final String value = cmd.getOptionValue(OUTPUT.getOpt());
- final Path fir;
- if (StringUtils.isNotBlank(value)) {
- fir = Paths.get(value);
- if ((!Files.exists(fir) && !fir.toFile().mkdirs()) || !Files.isDirectory(fir)) {
- throw new IllegalStateException(String.format("Invalid target directory %s specified", value));
- }
+ final String level = Level.resolve(cmd.getOptionValue(CommandLineOptions.LOG_LEVEL.getOpt()));
+ System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, level);
} else {
- fir = Paths.get(""/* cwd */);
- }
- return fir;
- }
-
- private static Collection determineTestTargets(final CommandLine cmd) {
- final Collection targets = new ArrayList<>();
- if (!cmd.getArgList().isEmpty()) {
- cmd.getArgList().forEach(e -> targets.addAll(determineTestTarget(e)));
- }
- if (targets.isEmpty()) {
- throw new IllegalStateException("No test targets found. Nothing to check. Will quit now!");
- }
- return targets;
- }
-
- private static Collection determineTestTarget(final String s) {
- final Path d = Paths.get(s);
- if (Files.isDirectory(d)) {
- return listDirectoryTargets(d);
- } else if (Files.exists(d)) {
- return Collections.singleton(d);
- }
- log.warn("The specified test target {} does not exist. Will be ignored", s);
- return Collections.emptyList();
-
- }
-
- private static Collection listDirectoryTargets(final Path d) {
- try ( final Stream stream = Files.list(d) ) {
- return stream.filter(path -> path.toString().endsWith(".xml")).collect(Collectors.toList());
- } catch (final IOException e) {
- throw new IllegalStateException("IOException while list directory content. Can not determine test targets.", e);
- }
-
- }
-
- private static URI determineRepository(final CommandLine cmd) {
- if (checkOptionWithValue(REPOSITORY, cmd)) {
- final Path d = Paths.get(cmd.getOptionValue(REPOSITORY.getOpt()));
- if (Files.isDirectory(d)) {
- return d.toUri();
- } else {
- throw new IllegalArgumentException(
- String.format("Not a valid path for repository definition specified: '%s'", d.toAbsolutePath()));
- }
- }
- return null;
- }
-
- private static URI determineDefinition(final CommandLine cmd) {
- checkOptionWithValue(SCENARIOS, cmd);
- final Path f = Paths.get(cmd.getOptionValue(SCENARIOS.getOpt()));
- if (Files.isRegularFile(f)) {
- return f.toAbsolutePath().toUri();
- } else {
- throw new IllegalArgumentException(
- String.format("Not a valid path for scenario definition specified: '%s'", f.toAbsolutePath()));
+ System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "OFF");
}
}
- private static boolean checkOptionWithValue(final Option option, final CommandLine cmd) {
- final String opt = option.getOpt();
- if (cmd.hasOption(opt)) {
- final String value = cmd.getOptionValue(opt);
- if (StringUtils.isNoneBlank(value)) {
- return true;
- } else {
- throw new IllegalArgumentException(String.format("Option value required for Option '%s'", option.getLongOpt()));
- }
- } else if (option.isRequired()) {
+ private enum Level {
- throw new IllegalArgumentException(String.format("Option '%s' required ", option.getLongOpt()));
+ INFO, WARN, DEBUG, TRACE, ERROR, OFF;
+
+ static String resolve(final String optionValue) throws ParseException {
+ return Arrays.stream(values()).filter(e -> e.name().equalsIgnoreCase(optionValue)).map(Enum::name).findFirst()
+ .orElseThrow(() -> new ParseException("Either specify trace,debug,info,warn,error as log level"));
}
- return false;
}
- private static void printHelp(final Options options) {
- // automatically generate the help statement
- final HelpFormatter formatter = new HelpFormatter();
- formatter.printHelp("check-tool -s [OPTIONS] [FILE]... ", options, false);
- }
-
- private static Options createHelpOptions() {
- final Options options = new Options();
- options.addOption(HELP);
- return options;
- }
-
- private static Options createOptions() {
- final 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);
- options.addOption(OUTPUT);
- options.addOption(EXTRACT_HTML);
- options.addOption(DEBUG);
- options.addOption(CHECK_ASSERTIONS);
- options.addOption(PRINT_MEM_STATS);
- options.addOption(WORKER_COUNT);
- options.addOption(DISABLE_GUI);
- options.addOption(REPORT_POSTFIX);
- options.addOption(REPORT_PREFIX);
- return options;
- }
}
diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java
new file mode 100644
index 0000000..c871b5f
--- /dev/null
+++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java
@@ -0,0 +1,97 @@
+package de.kosit.validationtool.cmd;
+
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.Option;
+
+/**
+ * @author Andreas Penski
+ */
+public class CommandLineOptions {
+
+ static final Option HELP = Option.builder("?").longOpt("help").argName("Help").desc("Displays this help").build();
+
+ static final Option SCENARIOS = Option.builder("s").required().longOpt("scenarios").hasArg().desc("Location of scenarios.xml e.g.")
+ .build();
+
+ static final Option REPOSITORY = Option.builder("r").longOpt("repository").hasArg().desc("Directory containing scenario content")
+ .build();
+
+ static final Option PRINT = Option.builder("p").longOpt("print").desc("Prints the check result to stdout").build();
+
+ static final Option OUTPUT = Option.builder("o").longOpt("output-directory")
+ .desc("Defines the out directory for results. Defaults to cwd").hasArg().build();
+
+ static final Option EXTRACT_HTML = Option.builder("h").longOpt("html")
+ .desc("Extract and save any html content within result as a separate file ").build();
+
+ static final Option DEBUG = Option.builder("d").longOpt("debug").desc("Prints some more debug information").build();
+
+ static final Option SERIALIZE_REPORT_INPUT = Option.builder("c").longOpt("serialize-report-input")
+ .desc("Serializes the report input to the cwd").build();
+
+ static final Option CHECK_ASSERTIONS = Option.builder("c").longOpt("check-assertions").hasArg()
+ .desc("Check the result using defined assertions").argName("assertions-file").build();
+
+ static final Option SERVER = Option.builder("D").longOpt("daemon").desc("Starts a daemon listing for validation requests").build();
+
+ static final Option HOST = Option.builder("H").longOpt("host").hasArg()
+ .desc("The hostname / IP address to bind the daemon. Default is localhost").build();
+
+ static final Option PORT = Option.builder("P").longOpt("port").hasArg().desc("The port to bind the daemon. Default is 8080").build();
+
+ static final Option WORKER_COUNT = Option.builder("T").longOpt("threads").hasArg()
+ .desc("Number of threads processing validation requests").build();
+
+ static final Option DISABLE_GUI = Option.builder("G").longOpt("disable-gui").desc("Disables the GUI of the daemon mode").build();
+
+ static final Option REPORT_POSTFIX = Option.builder(null).longOpt("report-postfix").hasArg()
+ .desc("Postfix of the generated report name").build();
+
+ static final Option REPORT_PREFIX = Option.builder(null).longOpt("report-prefix").hasArg().desc("Prefix of the generated report name")
+ .build();
+
+ static final Option DEBUG_LOG = Option.builder("X").longOpt("debug-logging").desc("Enables full debug log. Alias for -l debug").build();
+
+ static final Option LOG_LEVEL = Option.builder("l").longOpt("log-level").hasArg()
+ .desc("Enables a certain log level for debugging " + "purposes").build();
+
+ public static final int DAEMON_SIGNAL = 100;
+
+ static final Option PRINT_MEM_STATS = Option.builder("m").longOpt("memory-stats").desc("Prints some memory stats").build();
+
+ static org.apache.commons.cli.Options createOptions() {
+ final org.apache.commons.cli.Options options = new org.apache.commons.cli.Options();
+ options.addOption(HELP);
+ options.addOption(SERVER);
+ options.addOption(HOST);
+ options.addOption(PORT);
+ options.addOption(SCENARIOS);
+ options.addOption(REPOSITORY);
+ options.addOption(PRINT);
+ options.addOption(OUTPUT);
+ options.addOption(EXTRACT_HTML);
+ options.addOption(DEBUG);
+ options.addOption(CHECK_ASSERTIONS);
+ options.addOption(PRINT_MEM_STATS);
+ options.addOption(WORKER_COUNT);
+ options.addOption(DISABLE_GUI);
+ options.addOption(REPORT_POSTFIX);
+ options.addOption(REPORT_PREFIX);
+ options.addOption(LOG_LEVEL);
+ options.addOption(DEBUG_LOG);
+ return options;
+ }
+
+ static void printHelp(final org.apache.commons.cli.Options options) {
+ // automatically generate the help statement
+ final HelpFormatter formatter = new HelpFormatter();
+ formatter.printHelp("check-tool -s [OPTIONS] [FILE]... ", options, false);
+ }
+
+ static org.apache.commons.cli.Options createHelpOptions() {
+ final org.apache.commons.cli.Options options = new org.apache.commons.cli.Options();
+ options.addOption(HELP);
+ return options;
+ }
+
+}
diff --git a/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java b/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
index 4933fdf..ec6f0c6 100644
--- a/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
+++ b/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
@@ -100,7 +100,6 @@ class InternalCheck extends DefaultCheck {
final long rejected = results.entrySet().stream().filter(e -> !e.getValue().isAcceptable()).count();
final long errors = results.entrySet().stream().filter(e -> !e.getValue().isProcessingSuccessful()).count();
final Line line = new Line();
- line.add(String.format("Validation of %s objects finished. ", results.size()));
line.add("Acceptable: ").add(acceptable, Code.GREEN);
line.add(" Rejected: ").add(rejected, Code.RED);
if (errors > 0) {
diff --git a/src/main/java/de/kosit/validationtool/cmd/PrintReportAction.java b/src/main/java/de/kosit/validationtool/cmd/PrintReportAction.java
index ba7c25b..cb74315 100644
--- a/src/main/java/de/kosit/validationtool/cmd/PrintReportAction.java
+++ b/src/main/java/de/kosit/validationtool/cmd/PrintReportAction.java
@@ -24,6 +24,7 @@ import java.io.StringWriter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
+import de.kosit.validationtool.impl.Printer;
import de.kosit.validationtool.impl.tasks.CheckAction;
import net.sf.saxon.s9api.Processor;
@@ -47,7 +48,7 @@ class PrintReportAction implements CheckAction {
final StringWriter writer = new StringWriter();
final Serializer serializer = this.processor.newSerializer(writer);
serializer.serializeNode(results.getReport());
- System.out.print(writer.toString()); // NOSONAR
+ Printer.writeOut(writer.toString());
} catch (final SaxonApiException e) {
log.error("Error while printing result to stdout", e);
}
diff --git a/src/main/java/de/kosit/validationtool/cmd/Validator.java b/src/main/java/de/kosit/validationtool/cmd/Validator.java
new file mode 100644
index 0000000..64d743d
--- /dev/null
+++ b/src/main/java/de/kosit/validationtool/cmd/Validator.java
@@ -0,0 +1,331 @@
+package de.kosit.validationtool.cmd;
+
+import static de.kosit.validationtool.cmd.CommandLineOptions.CHECK_ASSERTIONS;
+import static de.kosit.validationtool.cmd.CommandLineOptions.DAEMON_SIGNAL;
+import static de.kosit.validationtool.cmd.CommandLineOptions.DEBUG;
+import static de.kosit.validationtool.cmd.CommandLineOptions.DISABLE_GUI;
+import static de.kosit.validationtool.cmd.CommandLineOptions.EXTRACT_HTML;
+import static de.kosit.validationtool.cmd.CommandLineOptions.HELP;
+import static de.kosit.validationtool.cmd.CommandLineOptions.HOST;
+import static de.kosit.validationtool.cmd.CommandLineOptions.OUTPUT;
+import static de.kosit.validationtool.cmd.CommandLineOptions.PORT;
+import static de.kosit.validationtool.cmd.CommandLineOptions.PRINT;
+import static de.kosit.validationtool.cmd.CommandLineOptions.PRINT_MEM_STATS;
+import static de.kosit.validationtool.cmd.CommandLineOptions.REPORT_POSTFIX;
+import static de.kosit.validationtool.cmd.CommandLineOptions.REPORT_PREFIX;
+import static de.kosit.validationtool.cmd.CommandLineOptions.REPOSITORY;
+import static de.kosit.validationtool.cmd.CommandLineOptions.SCENARIOS;
+import static de.kosit.validationtool.cmd.CommandLineOptions.SERIALIZE_REPORT_INPUT;
+import static de.kosit.validationtool.cmd.CommandLineOptions.SERVER;
+import static de.kosit.validationtool.cmd.CommandLineOptions.WORKER_COUNT;
+import static de.kosit.validationtool.cmd.CommandLineOptions.createOptions;
+import static de.kosit.validationtool.cmd.CommandLineOptions.printHelp;
+
+import java.io.IOException;
+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.HashMap;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.Option;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.fusesource.jansi.AnsiRenderer.Code;
+
+import lombok.extern.slf4j.Slf4j;
+
+import de.kosit.validationtool.api.Configuration;
+import de.kosit.validationtool.api.Input;
+import de.kosit.validationtool.api.InputFactory;
+import de.kosit.validationtool.api.Result;
+import de.kosit.validationtool.cmd.assertions.Assertions;
+import de.kosit.validationtool.cmd.report.Line;
+import de.kosit.validationtool.config.ConfigurationLoader;
+import de.kosit.validationtool.daemon.Daemon;
+import de.kosit.validationtool.impl.ConversionService;
+import de.kosit.validationtool.impl.EngineInformation;
+import de.kosit.validationtool.impl.Printer;
+
+import net.sf.saxon.s9api.Processor;
+
+/**
+ * Actual evaluation and processing of commandline argumtens.
+ *
+ * @author Andreas Penski
+ */
+@Slf4j
+@SuppressWarnings("squid:S3725")
+public class Validator {
+
+ /**
+ * Hauptprogramm für die Kommandozeilen-Applikation.
+ *
+ * @param cmd parsed commandline.
+ */
+ static int mainProgram(final CommandLine cmd) {
+ greeting();
+ final org.apache.commons.cli.Options options = createOptions();
+ int returnValue = 0;
+ if (cmd.hasOption(SERVER.getOpt())) {
+ returnValue = startDaemonMode(cmd);
+ } else if (cmd.hasOption(HELP.getOpt()) || cmd.getArgList().isEmpty()) {
+ printHelp(options);
+ } else if (cmd.getArgList().isEmpty()) {
+ printHelp(options);
+ } else {
+ returnValue = processActions(cmd);
+ }
+
+ return returnValue;
+ }
+
+ private static void greeting() {
+ Printer.writeOut("{0} version {1}", EngineInformation.getName(), EngineInformation.getVersion());
+ }
+
+ private static int determinePort(final CommandLine cmd) {
+ int port = 8080;
+ if (checkOptionWithValue(PORT, cmd)) {
+ port = Integer.parseInt(cmd.getOptionValue(PORT.getOpt()));
+ }
+ return port;
+ }
+
+ private static int determineThreads(final 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(final CommandLine cmd) {
+ String host = "localhost";
+ if (checkOptionWithValue(HOST, cmd)) {
+ host = cmd.getOptionValue(HOST.getOpt());
+ }
+ return host;
+ }
+
+ private static int startDaemonMode(final CommandLine cmd) {
+ final Option[] unavailable = new Option[] { PRINT, CHECK_ASSERTIONS, DEBUG, OUTPUT, EXTRACT_HTML, REPORT_POSTFIX, REPORT_PREFIX };
+ warnUnusedOptions(cmd, unavailable, true);
+ final ConfigurationLoader config = Configuration.load(determineDefinition(cmd), determineRepository(cmd));
+ final Daemon validDaemon = new Daemon(determineHost(cmd), determinePort(cmd), determineThreads(cmd));
+ if (cmd.hasOption(DISABLE_GUI.getOpt())) {
+ validDaemon.setGuiEnabled(false);
+ }
+ validDaemon.startServer(config.build());
+ return DAEMON_SIGNAL;
+ }
+
+ private static void warnUnusedOptions(final CommandLine cmd, final Option[] unavailable, final 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 int processActions(final CommandLine cmd) {
+ try {
+
+ long start = System.currentTimeMillis();
+ final Option[] unavailable = new Option[] { HOST, PORT, WORKER_COUNT, DISABLE_GUI };
+ warnUnusedOptions(cmd, unavailable, false);
+ final URI scenarioLocation = determineDefinition(cmd);
+ final URI repositoryLocation = determineRepository(cmd);
+ reportConfiguration(scenarioLocation, repositoryLocation);
+ final Configuration config = Configuration.load(scenarioLocation, repositoryLocation).build();
+
+ final InternalCheck check = new InternalCheck(config);
+ final Path outputDirectory = determineOutputDirectory(cmd);
+
+ final Processor processor = config.getContentRepository().getProcessor();
+ if (cmd.hasOption(EXTRACT_HTML.getOpt())) {
+ check.getCheckSteps().add(new ExtractHtmlContentAction(processor, outputDirectory));
+ }
+ check.getCheckSteps().add(new SerializeReportAction(outputDirectory, processor, determineNamingStrategy(cmd)));
+ if (cmd.hasOption(SERIALIZE_REPORT_INPUT.getOpt())) {
+ check.getCheckSteps().add(new SerializeReportInputAction(outputDirectory, check.getConversionService()));
+ }
+ if (cmd.hasOption(PRINT.getOpt())) {
+ check.getCheckSteps().add(new PrintReportAction(processor));
+ }
+
+ if (cmd.hasOption(CHECK_ASSERTIONS.getOpt())) {
+ final Assertions assertions = loadAssertions(cmd.getOptionValue(CHECK_ASSERTIONS.getOpt()));
+ check.getCheckSteps().add(new CheckAssertionAction(assertions, processor));
+ }
+ if (cmd.hasOption(PRINT_MEM_STATS.getOpt())) {
+ check.getCheckSteps().add(new PrintMemoryStats());
+ }
+ printScenarios(check.getConfiguration());
+ log.info("Setup completed in {}ms\n", System.currentTimeMillis() - start);
+
+ final Collection targets = determineTestTargets(cmd);
+ start = System.currentTimeMillis();
+ final Map results = new HashMap<>();
+ Printer.writeOut("\nProcessing of {0} objects started", targets.size());
+ long tick = System.currentTimeMillis();
+ for (final Path p : targets) {
+ final Input input = InputFactory.read(p);
+ results.put(p, check.checkInput(input));
+ if (((System.currentTimeMillis() - tick) / 1000) > 5) {
+ tick = System.currentTimeMillis();
+ Printer.writeOut("{0}/{1} objects processed", results.size(), targets.size());
+ }
+ }
+ final long processingTime = System.currentTimeMillis() - start;
+ Printer.writeOut("Processing of {0} objects completed in {1}ms", targets.size(), processingTime);
+ Printer.writeOut("Results:");
+ final boolean result = check.printAndEvaluate(results);
+ log.info("Processing {} object(s) completed in {}ms", targets.size(), processingTime);
+ return result ? 0 : 1;
+
+ } catch (final Exception e) {
+ e.printStackTrace();// NOSONAR
+ if (cmd.hasOption(DEBUG.getOpt())) {
+ log.error(e.getMessage(), e);
+ } else {
+ log.error(e.getMessage());
+ }
+ return -1;
+ }
+ }
+
+ private static void reportConfiguration(final URI scenarioLocation, final URI repositoryLocation) {
+ Printer.writeOut("Loading scenarios from {0}", scenarioLocation);
+ Printer.writeOut("Using repository {0}", repositoryLocation);
+ }
+
+ private static void printScenarios(final Configuration configuration) {
+ Printer.writeOut("Loaded \"{0} {1}\" by {2} from {3} ", configuration.getName(), "1", configuration.getAuthor(),
+ configuration.getDate());
+ Printer.writeOut("\nThe following scenarios are available:");
+ configuration.getScenarios().forEach(e -> {
+ final Line line = new Line(Code.GREEN);
+ line.add(" * " + e.getName());
+ Printer.writeOut(line.render(false, false));
+ });
+ }
+
+ private static NamingStrategy determineNamingStrategy(final CommandLine cmd) {
+ final DefaultNamingStrategy namingStrategy = new DefaultNamingStrategy();
+ if (cmd.hasOption(REPORT_PREFIX.getLongOpt())) {
+ namingStrategy.setPrefix(cmd.getOptionValue(REPORT_PREFIX.getLongOpt()));
+ }
+ if (cmd.hasOption(REPORT_POSTFIX.getLongOpt())) {
+ namingStrategy.setPostfix(cmd.getOptionValue(REPORT_POSTFIX.getLongOpt()));
+ }
+
+ return namingStrategy;
+ }
+
+ private static Assertions loadAssertions(final String optionValue) {
+ final Path p = Paths.get(optionValue);
+ Assertions a = null;
+ if (Files.exists(p)) {
+ final ConversionService c = new ConversionService();
+ c.initialize(de.kosit.validationtool.cmd.assertions.ObjectFactory.class.getPackage());
+ a = c.readXml(p.toUri(), Assertions.class);
+ }
+ return a;
+ }
+
+ private static Path determineOutputDirectory(final CommandLine cmd) {
+ final String value = cmd.getOptionValue(OUTPUT.getOpt());
+ final Path fir;
+ if (StringUtils.isNotBlank(value)) {
+ fir = Paths.get(value);
+ if ((!Files.exists(fir) && !fir.toFile().mkdirs()) || !Files.isDirectory(fir)) {
+ throw new IllegalStateException(String.format("Invalid target directory %s specified", value));
+ }
+ } else {
+ fir = Paths.get(""/* cwd */);
+ }
+ return fir;
+ }
+
+ private static Collection determineTestTargets(final CommandLine cmd) {
+ final Collection targets = new ArrayList<>();
+ if (!cmd.getArgList().isEmpty()) {
+ cmd.getArgList().forEach(e -> targets.addAll(determineTestTarget(e)));
+ }
+ if (targets.isEmpty()) {
+ throw new IllegalStateException("No test targets found. Nothing to check. Will quit now!");
+ }
+ return targets;
+ }
+
+ private static Collection determineTestTarget(final String s) {
+ final Path d = Paths.get(s);
+ if (Files.isDirectory(d)) {
+ return listDirectoryTargets(d);
+ } else if (Files.exists(d)) {
+ return Collections.singleton(d);
+ }
+ log.warn("The specified test target {} does not exist. Will be ignored", s);
+ return Collections.emptyList();
+
+ }
+
+ private static Collection listDirectoryTargets(final Path d) {
+ try ( final Stream stream = Files.list(d) ) {
+ return stream.filter(path -> path.toString().endsWith(".xml")).collect(Collectors.toList());
+ } catch (final IOException e) {
+ throw new IllegalStateException("IOException while list directory content. Can not determine test targets.", e);
+ }
+
+ }
+
+ private static URI determineRepository(final CommandLine cmd) {
+ if (checkOptionWithValue(REPOSITORY, cmd)) {
+ final Path d = Paths.get(cmd.getOptionValue(REPOSITORY.getOpt()));
+ if (Files.isDirectory(d)) {
+ return d.toUri();
+ } else {
+ throw new IllegalArgumentException(
+ String.format("Not a valid path for repository definition specified: '%s'", d.toAbsolutePath()));
+ }
+ }
+ return null;
+ }
+
+ private static URI determineDefinition(final CommandLine cmd) {
+ checkOptionWithValue(SCENARIOS, cmd);
+ final Path f = Paths.get(cmd.getOptionValue(SCENARIOS.getOpt()));
+ if (Files.isRegularFile(f)) {
+ return f.toAbsolutePath().toUri();
+ } else {
+ throw new IllegalArgumentException(
+ String.format("Not a valid path for scenario definition specified: '%s'", f.toAbsolutePath()));
+ }
+ }
+
+ private static boolean checkOptionWithValue(final Option option, final CommandLine cmd) {
+ final String opt = option.getOpt();
+ if (cmd.hasOption(opt)) {
+ final String value = cmd.getOptionValue(opt);
+ if (StringUtils.isNoneBlank(value)) {
+ return true;
+ } else {
+ throw new IllegalArgumentException(String.format("Option value required for Option '%s'", option.getLongOpt()));
+ }
+ } else if (option.isRequired()) {
+
+ throw new IllegalArgumentException(String.format("Option '%s' required ", option.getLongOpt()));
+ }
+ return false;
+ }
+
+}
diff --git a/src/main/java/de/kosit/validationtool/cmd/report/Line.java b/src/main/java/de/kosit/validationtool/cmd/report/Line.java
index 9cf0fa3..1c7128c 100644
--- a/src/main/java/de/kosit/validationtool/cmd/report/Line.java
+++ b/src/main/java/de/kosit/validationtool/cmd/report/Line.java
@@ -64,7 +64,7 @@ public class Line {
return render(true, false);
}
- String render(final boolean newLine, final boolean dotted) {
+ public String render(final boolean newLine, final boolean dotted) {
final List joins = new ArrayList<>();
final List reversed = new ArrayList<>(this.texts);
int replace = 0;
diff --git a/src/main/java/de/kosit/validationtool/impl/Printer.java b/src/main/java/de/kosit/validationtool/impl/Printer.java
index 3a1eb51..d1f726c 100644
--- a/src/main/java/de/kosit/validationtool/impl/Printer.java
+++ b/src/main/java/de/kosit/validationtool/impl/Printer.java
@@ -18,4 +18,14 @@ public class Printer {
public static void writeOut(final String message, final Object... params) {
System.out.println(MessageFormat.format(message, params));
}
+
+ /**
+ * Writes to standard error channel.
+ *
+ * @param message the message with placeholders
+ * @param params the params.
+ */
+ public static void writeErr(final String message, final Object... params) {
+ System.err.println(MessageFormat.format(message, params));
+ }
}
diff --git a/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java b/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java
index 59da755..1fe995b 100644
--- a/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java
+++ b/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java
@@ -29,6 +29,8 @@ import java.nio.file.Paths;
import java.util.List;
import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.assertj.core.api.Condition;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -51,7 +53,6 @@ public class CommandlineApplicationTest {
private final Path output = Paths.get("target/test-output");
-
@Before
public void setup() throws IOException {
this.commandLine = new CommandLine();
@@ -112,8 +113,7 @@ public class CommandlineApplicationTest {
@Test
public void testNotExistingTestTarget() {
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r",
- Paths.get(Simple.REPOSITORY_URI).toString(),
- Paths.get(Simple.NOT_EXISTING).toString() };
+ Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.NOT_EXISTING).toString() };
CommandLineApplication.mainProgram(args);
assertThat(this.commandLine.getErrorOutput()).isNotEmpty();
assertThat(this.commandLine.getErrorOutput()).contains("No test targets found");
@@ -122,8 +122,7 @@ public class CommandlineApplicationTest {
@Test
public void testValidMinimalConfiguration() {
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r",
- Paths.get(Simple.REPOSITORY_URI).toString(),
- Paths.get(Simple.SIMPLE_VALID).toString() };
+ Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
}
@@ -181,14 +180,15 @@ public class CommandlineApplicationTest {
Paths.get(Simple.REPOSITORY_URI).toString(), "-o", this.output.toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
- assertThat(this.commandLine.getOutputLines().get(0)).contains("");
+ assertThat(this.commandLine.getOutputLines()).haveAtLeastOne(new Condition<>(
+ s -> StringUtils.contains(s, ""), "Must " + "contain xml preambel"));
}
@Test
public void testHtmlExtraktion() throws IOException {
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-h", "-o",
- this.output.toAbsolutePath().toString(),
- "-r", Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
+ this.output.toAbsolutePath().toString(), "-r", Paths.get(Simple.REPOSITORY_URI).toString(),
+ Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
assertThat(Files.list(this.output).filter(f -> f.toString().endsWith(".html")).count()).isGreaterThan(0);
@@ -198,8 +198,7 @@ public class CommandlineApplicationTest {
public void testAssertionsExtraktion() {
final String[] args = new String[] { "-d", "-s", Paths.get(Simple.SCENARIOS).toString(), "-r",
Paths.get(Simple.REPOSITORY_URI).toString(), "-o", this.output.toString(), "-c", Paths.get(ASSERTIONS).toString(),
- Paths.get(Simple.REPOSITORY_URI).toString(),
- Paths.get(Simple.SIMPLE_VALID).toString() };
+ Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
assertThat(this.commandLine.getErrorOutput()).contains("Can not find assertions for ");
@@ -208,8 +207,7 @@ public class CommandlineApplicationTest {
@Test
public void testDebugFlag() {
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", "unknown", "-o", this.output.toString(),
- "-d",
- Paths.get(ASSERTIONS).toString() };
+ "-d", Paths.get(ASSERTIONS).toString() };
CommandLineApplication.mainProgram(args);
assertThat(this.commandLine.getErrorOutput()).contains("at de.kosit.validationtool");
}
From f4509fd097d6ec6d77532c32512948a856990ab4 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Thu, 13 Aug 2020 15:23:59 +0200
Subject: [PATCH 012/210] cleanup
---
.../cmd/CommandLineOptions.java | 23 ++++---------------
.../kosit/validationtool/cmd/Validator.java | 4 ++++
.../de/kosit/validationtool/impl/Printer.java | 5 ++++
3 files changed, 13 insertions(+), 19 deletions(-)
diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java
index c871b5f..992e083 100644
--- a/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java
+++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java
@@ -9,56 +9,41 @@ import org.apache.commons.cli.Option;
public class CommandLineOptions {
static final Option HELP = Option.builder("?").longOpt("help").argName("Help").desc("Displays this help").build();
-
static final Option SCENARIOS = Option.builder("s").required().longOpt("scenarios").hasArg().desc("Location of scenarios.xml e.g.")
.build();
-
static final Option REPOSITORY = Option.builder("r").longOpt("repository").hasArg().desc("Directory containing scenario content")
.build();
-
static final Option PRINT = Option.builder("p").longOpt("print").desc("Prints the check result to stdout").build();
-
static final Option OUTPUT = Option.builder("o").longOpt("output-directory")
.desc("Defines the out directory for results. Defaults to cwd").hasArg().build();
-
static final Option EXTRACT_HTML = Option.builder("h").longOpt("html")
.desc("Extract and save any html content within result as a separate file ").build();
-
static final Option DEBUG = Option.builder("d").longOpt("debug").desc("Prints some more debug information").build();
-
static final Option SERIALIZE_REPORT_INPUT = Option.builder("c").longOpt("serialize-report-input")
.desc("Serializes the report input to the cwd").build();
-
static final Option CHECK_ASSERTIONS = Option.builder("c").longOpt("check-assertions").hasArg()
.desc("Check the result using defined assertions").argName("assertions-file").build();
-
static final Option SERVER = Option.builder("D").longOpt("daemon").desc("Starts a daemon listing for validation requests").build();
-
static final Option HOST = Option.builder("H").longOpt("host").hasArg()
.desc("The hostname / IP address to bind the daemon. Default is localhost").build();
-
static final Option PORT = Option.builder("P").longOpt("port").hasArg().desc("The port to bind the daemon. Default is 8080").build();
-
static final Option WORKER_COUNT = Option.builder("T").longOpt("threads").hasArg()
.desc("Number of threads processing validation requests").build();
-
static final Option DISABLE_GUI = Option.builder("G").longOpt("disable-gui").desc("Disables the GUI of the daemon mode").build();
-
static final Option REPORT_POSTFIX = Option.builder(null).longOpt("report-postfix").hasArg()
.desc("Postfix of the generated report name").build();
-
static final Option REPORT_PREFIX = Option.builder(null).longOpt("report-prefix").hasArg().desc("Prefix of the generated report name")
.build();
-
static final Option DEBUG_LOG = Option.builder("X").longOpt("debug-logging").desc("Enables full debug log. Alias for -l debug").build();
-
static final Option LOG_LEVEL = Option.builder("l").longOpt("log-level").hasArg()
.desc("Enables a certain log level for debugging " + "purposes").build();
-
public static final int DAEMON_SIGNAL = 100;
-
static final Option PRINT_MEM_STATS = Option.builder("m").longOpt("memory-stats").desc("Prints some memory stats").build();
+ private CommandLineOptions() {
+ // hide
+ }
+
static org.apache.commons.cli.Options createOptions() {
final org.apache.commons.cli.Options options = new org.apache.commons.cli.Options();
options.addOption(HELP);
diff --git a/src/main/java/de/kosit/validationtool/cmd/Validator.java b/src/main/java/de/kosit/validationtool/cmd/Validator.java
index 64d743d..c66015a 100644
--- a/src/main/java/de/kosit/validationtool/cmd/Validator.java
+++ b/src/main/java/de/kosit/validationtool/cmd/Validator.java
@@ -66,6 +66,10 @@ import net.sf.saxon.s9api.Processor;
@SuppressWarnings("squid:S3725")
public class Validator {
+ private Validator() {
+ // hide
+ }
+
/**
* Hauptprogramm für die Kommandozeilen-Applikation.
*
diff --git a/src/main/java/de/kosit/validationtool/impl/Printer.java b/src/main/java/de/kosit/validationtool/impl/Printer.java
index d1f726c..87bdf8d 100644
--- a/src/main/java/de/kosit/validationtool/impl/Printer.java
+++ b/src/main/java/de/kosit/validationtool/impl/Printer.java
@@ -7,8 +7,13 @@ import java.text.MessageFormat;
*
* @author Andreas Penski
*/
+@SuppressWarnings("squid:S106")
public class Printer {
+ private Printer() {
+ // hide
+ }
+
/**
* Writes to standard output channel.
*
From 8aa93158d1268e9fe84f479870adfa17d0f4b241 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Thu, 13 Aug 2020 15:59:20 +0200
Subject: [PATCH 013/210] #65 daemon mode default output
---
.../validationtool/api/InputFactory.java | 2 +-
.../kosit/validationtool/cmd/Validator.java | 22 ++++++++++++-------
.../kosit/validationtool/daemon/Daemon.java | 12 ++++++----
3 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/src/main/java/de/kosit/validationtool/api/InputFactory.java b/src/main/java/de/kosit/validationtool/api/InputFactory.java
index c0035fd..93bede4 100644
--- a/src/main/java/de/kosit/validationtool/api/InputFactory.java
+++ b/src/main/java/de/kosit/validationtool/api/InputFactory.java
@@ -300,7 +300,7 @@ public class InputFactory {
*/
public static Input read(final InputStream inputStream, final String name, final String digestAlgorithm) {
checkNull(inputStream);
- return read(new StreamSource(inputStream, name), digestAlgorithm);
+ return read(new StreamSource(inputStream, name), name, digestAlgorithm);
}
/**
diff --git a/src/main/java/de/kosit/validationtool/cmd/Validator.java b/src/main/java/de/kosit/validationtool/cmd/Validator.java
index c66015a..b67329f 100644
--- a/src/main/java/de/kosit/validationtool/cmd/Validator.java
+++ b/src/main/java/de/kosit/validationtool/cmd/Validator.java
@@ -123,12 +123,15 @@ public class Validator {
private static int startDaemonMode(final CommandLine cmd) {
final Option[] unavailable = new Option[] { PRINT, CHECK_ASSERTIONS, DEBUG, OUTPUT, EXTRACT_HTML, REPORT_POSTFIX, REPORT_PREFIX };
warnUnusedOptions(cmd, unavailable, true);
- final ConfigurationLoader config = Configuration.load(determineDefinition(cmd), determineRepository(cmd));
+ final ConfigurationLoader config = getConfiguration(cmd);
final Daemon validDaemon = new Daemon(determineHost(cmd), determinePort(cmd), determineThreads(cmd));
if (cmd.hasOption(DISABLE_GUI.getOpt())) {
validDaemon.setGuiEnabled(false);
}
- validDaemon.startServer(config.build());
+ final Configuration configuration = config.build();
+ printScenarios(configuration);
+ Printer.writeOut("\nStarting daemon mode ...");
+ validDaemon.startServer(configuration);
return DAEMON_SIGNAL;
}
@@ -146,11 +149,8 @@ public class Validator {
long start = System.currentTimeMillis();
final Option[] unavailable = new Option[] { HOST, PORT, WORKER_COUNT, DISABLE_GUI };
warnUnusedOptions(cmd, unavailable, false);
- final URI scenarioLocation = determineDefinition(cmd);
- final URI repositoryLocation = determineRepository(cmd);
- reportConfiguration(scenarioLocation, repositoryLocation);
- final Configuration config = Configuration.load(scenarioLocation, repositoryLocation).build();
-
+ final Configuration config = getConfiguration(cmd).build();
+ printScenarios(config);
final InternalCheck check = new InternalCheck(config);
final Path outputDirectory = determineOutputDirectory(cmd);
@@ -173,7 +173,6 @@ public class Validator {
if (cmd.hasOption(PRINT_MEM_STATS.getOpt())) {
check.getCheckSteps().add(new PrintMemoryStats());
}
- printScenarios(check.getConfiguration());
log.info("Setup completed in {}ms\n", System.currentTimeMillis() - start);
final Collection targets = determineTestTargets(cmd);
@@ -207,6 +206,13 @@ public class Validator {
}
}
+ private static ConfigurationLoader getConfiguration(final CommandLine cmd) {
+ final URI scenarioLocation = determineDefinition(cmd);
+ final URI repositoryLocation = determineRepository(cmd);
+ reportConfiguration(scenarioLocation, repositoryLocation);
+ return Configuration.load(scenarioLocation, repositoryLocation);
+ }
+
private static void reportConfiguration(final URI scenarioLocation, final URI repositoryLocation) {
Printer.writeOut("Loading scenarios from {0}", scenarioLocation);
Printer.writeOut("Using repository {0}", repositoryLocation);
diff --git a/src/main/java/de/kosit/validationtool/daemon/Daemon.java b/src/main/java/de/kosit/validationtool/daemon/Daemon.java
index 24da017..75e464d 100644
--- a/src/main/java/de/kosit/validationtool/daemon/Daemon.java
+++ b/src/main/java/de/kosit/validationtool/daemon/Daemon.java
@@ -44,16 +44,18 @@ public class Daemon {
/**
* Create a new daemon.
+ *
* @param hostname the interface to bind to
* @param port the port to expose
* @param threadCount the number of working threads
*/
public Daemon(final String hostname, final int port, final int threadCount) {
this.bindAddress = hostname;
- this.port = port;
+ this.port = port;
this.threadCount = threadCount;
}
+
/**
* Methode zum Starten des Servers
*
@@ -73,9 +75,7 @@ public class Daemon {
server.setExecutor(createExecutor());
server.start();
log.info("Server {} started", server.getAddress());
- if (!log.isInfoEnabled()) {
- writeOut("Server {0} started", server.getAddress());
- }
+ writeOut("Daemon started. Visit http://{0}", this.bindAddress + ":" + this.port);
} catch (final IOException e) {
log.error("Error starting HttpServer for Valdidator: {}", e.getMessage(), e);
}
@@ -101,4 +101,8 @@ public class Daemon {
private InetSocketAddress getSocket() {
return new InetSocketAddress(defaultIfBlank(this.bindAddress, DEFAULT_HOST), this.port > 0 ? this.port : DEFAULT_PORT);
}
+
+ public static void shutdown() {
+ System.out.println("bla");
+ }
}
From aad08768dd636f6a5638af2019e7979b524f6da5 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Thu, 13 Aug 2020 16:06:28 +0200
Subject: [PATCH 014/210] #65 daemon mode default output
---
src/main/java/de/kosit/validationtool/daemon/Daemon.java | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/main/java/de/kosit/validationtool/daemon/Daemon.java b/src/main/java/de/kosit/validationtool/daemon/Daemon.java
index 75e464d..65033be 100644
--- a/src/main/java/de/kosit/validationtool/daemon/Daemon.java
+++ b/src/main/java/de/kosit/validationtool/daemon/Daemon.java
@@ -102,7 +102,4 @@ public class Daemon {
return new InetSocketAddress(defaultIfBlank(this.bindAddress, DEFAULT_HOST), this.port > 0 ? this.port : DEFAULT_PORT);
}
- public static void shutdown() {
- System.out.println("bla");
- }
}
From bcbb0de09c9a1e3eee68d1619f1496d296751234 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Fri, 14 Aug 2020 08:56:45 +0200
Subject: [PATCH 015/210] (chore) more test coverage
---
.../api/CheckConfiguration.java | 3 +-
.../validationtool/daemon/BaseHandler.java | 6 +-
.../api/CheckConfigurationTest.java | 29 +++++++++
.../config/TestScenarioFactory.java | 2 +-
.../daemon/ConfigHandlerTest.java | 60 +++++++++++++++++++
.../resources/examples/simple/scenarios.xml | 1 +
6 files changed, 95 insertions(+), 6 deletions(-)
create mode 100644 src/test/java/de/kosit/validationtool/api/CheckConfigurationTest.java
create mode 100644 src/test/java/de/kosit/validationtool/daemon/ConfigHandlerTest.java
diff --git a/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java b/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java
index dddf41a..185ad26 100644
--- a/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java
+++ b/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java
@@ -28,7 +28,6 @@ import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
-import de.kosit.validationtool.config.ConfigurationLoader;
import de.kosit.validationtool.impl.ContentRepository;
import de.kosit.validationtool.impl.Scenario;
@@ -55,7 +54,7 @@ public class CheckConfiguration implements Configuration {
*/
private URI scenarioRepository;
- private ConfigurationLoader loader;
+
private Configuration delegate;
diff --git a/src/main/java/de/kosit/validationtool/daemon/BaseHandler.java b/src/main/java/de/kosit/validationtool/daemon/BaseHandler.java
index 9aaae1c..9e75fd4 100644
--- a/src/main/java/de/kosit/validationtool/daemon/BaseHandler.java
+++ b/src/main/java/de/kosit/validationtool/daemon/BaseHandler.java
@@ -15,13 +15,13 @@ abstract class BaseHandler implements HttpHandler {
protected static final String APPLICATION_XML = "application/xml";
- protected static final int OK = 200;
+ static final int OK = 200;
protected static void write(final HttpExchange exchange, final byte[] content, final String contentType) throws IOException {
write(exchange, contentType, os -> os.write(content));
}
- protected static void write(final HttpExchange exchange, final String contentType, Write write) throws IOException {
+ protected static void write(final HttpExchange exchange, final String contentType, final Write write) throws IOException {
exchange.getResponseHeaders().add("Content-Type", contentType);
exchange.sendResponseHeaders(OK, 0);
final OutputStream os = exchange.getResponseBody();
@@ -41,6 +41,6 @@ abstract class BaseHandler implements HttpHandler {
@FunctionalInterface
protected interface Write {
- public void write(OutputStream out) throws IOException;
+ void write(OutputStream out) throws IOException;
}
}
diff --git a/src/test/java/de/kosit/validationtool/api/CheckConfigurationTest.java b/src/test/java/de/kosit/validationtool/api/CheckConfigurationTest.java
new file mode 100644
index 0000000..717a59d
--- /dev/null
+++ b/src/test/java/de/kosit/validationtool/api/CheckConfigurationTest.java
@@ -0,0 +1,29 @@
+package de.kosit.validationtool.api;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.Test;
+
+import de.kosit.validationtool.impl.Helper.Simple;
+
+/**
+ * Test {@link CheckConfiguration }.
+ *
+ * @author Andreas Penski
+ */
+@Deprecated
+public class CheckConfigurationTest {
+
+ @Test
+ public void testDelegation() {
+ final CheckConfiguration config = new CheckConfiguration(Simple.SCENARIOS);
+ config.setScenarioRepository(Simple.REPOSITORY_URI);
+ assertThat(config.getScenarios()).isNotEmpty();
+ assertThat(config.getContentRepository()).isNotNull();
+ assertThat(config.getFallbackScenario()).isNotNull();
+ assertThat(config.getAuthor()).isNotEmpty();
+ assertThat(config.getDate()).isNotEmpty();
+ assertThat(config.getName()).isNotEmpty();
+ assertThat(config.getScenarioRepository()).isNotNull();
+ }
+}
diff --git a/src/test/java/de/kosit/validationtool/config/TestScenarioFactory.java b/src/test/java/de/kosit/validationtool/config/TestScenarioFactory.java
index 70ae5cc..272878d 100644
--- a/src/test/java/de/kosit/validationtool/config/TestScenarioFactory.java
+++ b/src/test/java/de/kosit/validationtool/config/TestScenarioFactory.java
@@ -17,7 +17,7 @@ import de.kosit.validationtool.impl.ResolvingMode;
*/
public class TestScenarioFactory {
- static ConfigurationBuilder createSimpleConfiguration() {
+ public static ConfigurationBuilder createSimpleConfiguration() {
return Configuration.create().name("Simple-API").author("me").description("test desc").date(new Date())
.with(createScenario().description("awesome scenario")).with(fallback().name("default").source("report.xsl"))
diff --git a/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerTest.java b/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerTest.java
new file mode 100644
index 0000000..c4aea0e
--- /dev/null
+++ b/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerTest.java
@@ -0,0 +1,60 @@
+package de.kosit.validationtool.daemon;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.Mockito.atLeast;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.junit.Test;
+import org.mockito.ArgumentCaptor;
+
+import com.sun.net.httpserver.Headers;
+import com.sun.net.httpserver.HttpExchange;
+
+import de.kosit.validationtool.api.Configuration;
+import de.kosit.validationtool.config.TestScenarioFactory;
+import de.kosit.validationtool.impl.ConversionService;
+
+/**
+ * @author Andreas Penski
+ */
+public class ConfigHandlerTest {
+
+ @Test
+ public void testApiConfiguration() throws IOException {
+ final HttpExchange exchange = mock(HttpExchange.class);
+ final Headers headers = mock(Headers.class);
+ final OutputStream stream = mock(OutputStream.class);
+ when(exchange.getResponseHeaders()).thenReturn(headers);
+ when(exchange.getResponseBody()).thenReturn(stream);
+ final Configuration config = TestScenarioFactory.createSimpleConfiguration().build();
+ final ConfigHandler handler = new ConfigHandler(config, new ConversionService());
+ handler.handle(exchange);
+ verify(exchange, times(1)).sendResponseHeaders(ConfigHandler.OK, 0);
+ verify(stream, atLeast(1)).write(any());
+ }
+
+ @Test
+ public void testError() throws IOException {
+ final HttpExchange exchange = mock(HttpExchange.class);
+ final Headers headers = mock(Headers.class);
+ final OutputStream stream = mock(OutputStream.class);
+ when(exchange.getResponseHeaders()).thenReturn(headers);
+ when(exchange.getResponseBody()).thenReturn(stream);
+ final ArgumentCaptor valueCapture = ArgumentCaptor.forClass(Integer.class);
+ doNothing().when(exchange).sendResponseHeaders(valueCapture.capture(), anyLong());
+ final ConfigHandler handler = new ConfigHandler(null/* will produce npe */, new ConversionService());
+ handler.handle(exchange);
+ verify(headers, times(1)).add(any(), any());
+ verify(stream, atLeast(1)).write(any());
+ assertThat(valueCapture.getValue()).isEqualTo(500);
+ }
+}
diff --git a/src/test/resources/examples/simple/scenarios.xml b/src/test/resources/examples/simple/scenarios.xml
index a896a23..1513b5d 100644
--- a/src/test/resources/examples/simple/scenarios.xml
+++ b/src/test/resources/examples/simple/scenarios.xml
@@ -20,6 +20,7 @@
HTML-TestSuite
+ QA2017-08-08
Szenario für Tests
From 4d4aa5ea60138f8fa4c443cbb1ab69b5b22a60b6 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Mon, 17 Aug 2020 08:24:06 +0200
Subject: [PATCH 016/210] test custom resolving strategy
---
.../config/ConfigurationLoader.java | 3 +++
.../config/ConfigurationBuilderTest.java | 2 +-
.../config/ConfigurationLoaderTest.java | 27 +++++++++++++++++++
.../config/ScenarioBuilderTest.java | 2 +-
.../config/SimpleConfigTest.java | 2 +-
...ory.java => TestConfigurationFactory.java} | 6 ++++-
.../daemon/ConfigHandlerTest.java | 4 +--
.../impl/tasks/CreateReportActionTest.java | 2 +-
8 files changed, 41 insertions(+), 7 deletions(-)
create mode 100644 src/test/java/de/kosit/validationtool/config/ConfigurationLoaderTest.java
rename src/test/java/de/kosit/validationtool/config/{TestScenarioFactory.java => TestConfigurationFactory.java} (89%)
diff --git a/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java b/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java
index 0457459..7848c6b 100644
--- a/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java
+++ b/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java
@@ -181,6 +181,9 @@ public class ConfigurationLoader {
* @return this
*/
public ConfigurationLoader setResolvingMode(final ResolvingMode mode) {
+ if (this.resolvingConfigurationStrategy != null) {
+ log.warn("Ignoring resolving mode configuration since a custom strategy is already defined");
+ }
this.resolvingMode = mode;
return this;
}
diff --git a/src/test/java/de/kosit/validationtool/config/ConfigurationBuilderTest.java b/src/test/java/de/kosit/validationtool/config/ConfigurationBuilderTest.java
index eaee8d9..9b98549 100644
--- a/src/test/java/de/kosit/validationtool/config/ConfigurationBuilderTest.java
+++ b/src/test/java/de/kosit/validationtool/config/ConfigurationBuilderTest.java
@@ -2,7 +2,7 @@ package de.kosit.validationtool.config;
import static de.kosit.validationtool.config.ConfigurationBuilder.report;
import static de.kosit.validationtool.config.ConfigurationBuilder.schematron;
-import static de.kosit.validationtool.config.TestScenarioFactory.createSimpleConfiguration;
+import static de.kosit.validationtool.config.TestConfigurationFactory.createSimpleConfiguration;
import static org.assertj.core.api.Assertions.assertThat;
import java.net.URI;
diff --git a/src/test/java/de/kosit/validationtool/config/ConfigurationLoaderTest.java b/src/test/java/de/kosit/validationtool/config/ConfigurationLoaderTest.java
new file mode 100644
index 0000000..d944049
--- /dev/null
+++ b/src/test/java/de/kosit/validationtool/config/ConfigurationLoaderTest.java
@@ -0,0 +1,27 @@
+package de.kosit.validationtool.config;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+
+import org.junit.Test;
+
+import de.kosit.validationtool.api.Configuration;
+import de.kosit.validationtool.api.ResolvingConfigurationStrategy;
+import de.kosit.validationtool.impl.ResolvingMode;
+import de.kosit.validationtool.impl.xml.StrictLocalResolvingStrategy;
+
+/**
+ * @author Andreas Penski
+ */
+public class ConfigurationLoaderTest {
+
+ @Test
+ public void testCustomResolvingStrategy() {
+ final ConfigurationLoader loader = TestConfigurationFactory.loadSimpleConfiguration();
+ final ResolvingConfigurationStrategy strategy = mock(ResolvingConfigurationStrategy.class);
+ loader.setResolvingStrategy(strategy);
+ loader.setResolvingMode(ResolvingMode.STRICT_LOCAL);
+ final Configuration config = loader.build();
+ assertThat(config.getContentRepository().getResolvingConfigurationStrategy()).isNotInstanceOf(StrictLocalResolvingStrategy.class);
+ }
+}
diff --git a/src/test/java/de/kosit/validationtool/config/ScenarioBuilderTest.java b/src/test/java/de/kosit/validationtool/config/ScenarioBuilderTest.java
index 3b968c5..43170cc 100644
--- a/src/test/java/de/kosit/validationtool/config/ScenarioBuilderTest.java
+++ b/src/test/java/de/kosit/validationtool/config/ScenarioBuilderTest.java
@@ -1,6 +1,6 @@
package de.kosit.validationtool.config;
-import static de.kosit.validationtool.config.TestScenarioFactory.createScenario;
+import static de.kosit.validationtool.config.TestConfigurationFactory.createScenario;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.HashMap;
diff --git a/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java b/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java
index 16e31a1..8db79ad 100644
--- a/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java
+++ b/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java
@@ -1,6 +1,6 @@
package de.kosit.validationtool.config;
-import static de.kosit.validationtool.config.TestScenarioFactory.createSimpleConfiguration;
+import static de.kosit.validationtool.config.TestConfigurationFactory.createSimpleConfiguration;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
diff --git a/src/test/java/de/kosit/validationtool/config/TestScenarioFactory.java b/src/test/java/de/kosit/validationtool/config/TestConfigurationFactory.java
similarity index 89%
rename from src/test/java/de/kosit/validationtool/config/TestScenarioFactory.java
rename to src/test/java/de/kosit/validationtool/config/TestConfigurationFactory.java
index 272878d..b471e44 100644
--- a/src/test/java/de/kosit/validationtool/config/TestScenarioFactory.java
+++ b/src/test/java/de/kosit/validationtool/config/TestConfigurationFactory.java
@@ -15,7 +15,7 @@ import de.kosit.validationtool.impl.ResolvingMode;
/**
* @author Andreas Penski
*/
-public class TestScenarioFactory {
+public class TestConfigurationFactory {
public static ConfigurationBuilder createSimpleConfiguration() {
return Configuration.create().name("Simple-API").author("me").description("test desc").date(new Date())
@@ -24,6 +24,10 @@ public class TestScenarioFactory {
.resolvingMode(ResolvingMode.STRICT_RELATIVE).useRepository(Simple.REPOSITORY_URI);
}
+ public static ConfigurationLoader loadSimpleConfiguration() {
+ return Configuration.load(Simple.SCENARIOS, Simple.REPOSITORY_URI);
+ }
+
public static ScenarioBuilder createScenario() {
return scenario("simple").validate(schema("Sample Schema").schemaLocation(URI.create("simple.xsd")))
.with(report("Report für eRechnung").source("report.xsl")).acceptWith("count(//test:rejected) = 0")
diff --git a/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerTest.java b/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerTest.java
index c4aea0e..6eedeb3 100644
--- a/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerTest.java
+++ b/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerTest.java
@@ -20,7 +20,7 @@ import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange;
import de.kosit.validationtool.api.Configuration;
-import de.kosit.validationtool.config.TestScenarioFactory;
+import de.kosit.validationtool.config.TestConfigurationFactory;
import de.kosit.validationtool.impl.ConversionService;
/**
@@ -35,7 +35,7 @@ public class ConfigHandlerTest {
final OutputStream stream = mock(OutputStream.class);
when(exchange.getResponseHeaders()).thenReturn(headers);
when(exchange.getResponseBody()).thenReturn(stream);
- final Configuration config = TestScenarioFactory.createSimpleConfiguration().build();
+ final Configuration config = TestConfigurationFactory.createSimpleConfiguration().build();
final ConfigHandler handler = new ConfigHandler(config, new ConversionService());
handler.handle(exchange);
verify(exchange, times(1)).sendResponseHeaders(ConfigHandler.OK, 0);
diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java b/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java
index afaaee4..6425366 100644
--- a/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java
@@ -1,6 +1,6 @@
package de.kosit.validationtool.impl.tasks;
-import static de.kosit.validationtool.config.TestScenarioFactory.createScenario;
+import static de.kosit.validationtool.config.TestConfigurationFactory.createScenario;
import static de.kosit.validationtool.impl.Helper.serialize;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
From 4a4ebcadc044e97a352fd8c925d542b624b3a4d7 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Mon, 17 Aug 2020 08:33:23 +0200
Subject: [PATCH 017/210] fix test
---
.../config/ConfigurationLoaderTest.java | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/test/java/de/kosit/validationtool/config/ConfigurationLoaderTest.java b/src/test/java/de/kosit/validationtool/config/ConfigurationLoaderTest.java
index d944049..4c3f626 100644
--- a/src/test/java/de/kosit/validationtool/config/ConfigurationLoaderTest.java
+++ b/src/test/java/de/kosit/validationtool/config/ConfigurationLoaderTest.java
@@ -1,14 +1,13 @@
package de.kosit.validationtool.config;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
import org.junit.Test;
import de.kosit.validationtool.api.Configuration;
-import de.kosit.validationtool.api.ResolvingConfigurationStrategy;
import de.kosit.validationtool.impl.ResolvingMode;
-import de.kosit.validationtool.impl.xml.StrictLocalResolvingStrategy;
+import de.kosit.validationtool.impl.xml.RemoteResolvingStrategy;
+import de.kosit.validationtool.impl.xml.StrictRelativeResolvingStrategy;
/**
* @author Andreas Penski
@@ -18,10 +17,9 @@ public class ConfigurationLoaderTest {
@Test
public void testCustomResolvingStrategy() {
final ConfigurationLoader loader = TestConfigurationFactory.loadSimpleConfiguration();
- final ResolvingConfigurationStrategy strategy = mock(ResolvingConfigurationStrategy.class);
- loader.setResolvingStrategy(strategy);
- loader.setResolvingMode(ResolvingMode.STRICT_LOCAL);
+ loader.setResolvingStrategy(new StrictRelativeResolvingStrategy());
+ loader.setResolvingMode(ResolvingMode.ALLOW_REMOTE);
final Configuration config = loader.build();
- assertThat(config.getContentRepository().getResolvingConfigurationStrategy()).isNotInstanceOf(StrictLocalResolvingStrategy.class);
+ assertThat(config.getContentRepository().getResolvingConfigurationStrategy()).isNotInstanceOf(RemoteResolvingStrategy.class);
}
}
From 911a4f2ceb37c2e0187fc854b904afdde1d5e33a Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Wed, 19 Aug 2020 14:03:58 +0200
Subject: [PATCH 018/210] (fix) return code 0 on assertion check
---
CHANGELOG.md | 1 +
.../validationtool/cmd/InternalCheck.java | 25 ++++++++++++++++---
.../kosit/validationtool/cmd/Validator.java | 8 +++---
.../validationtool/impl/DefaultCheck.java | 6 +++++
4 files changed, 32 insertions(+), 8 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c61706c..cc30047 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- read saxon XdmNode with InputFactory
- [CLI] custom output without the various log messages
- [CLI] options to set the log level (`-X` = full debug output, `-l ` set a specific level)
+- [CLI] return code ist <> 0 on rejected results
### Changed
- InputFactory has methods to read any java.xml.transform.Source as Input not only StreamSources
diff --git a/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java b/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
index ec6f0c6..93ddd4b 100644
--- a/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
+++ b/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
@@ -21,6 +21,7 @@ package de.kosit.validationtool.cmd;
import java.io.PrintWriter;
import java.nio.file.Path;
+import java.text.MessageFormat;
import java.util.Comparator;
import java.util.Map;
import java.util.stream.Collectors;
@@ -40,7 +41,6 @@ import de.kosit.validationtool.cmd.report.Line;
import de.kosit.validationtool.impl.DefaultCheck;
import de.kosit.validationtool.impl.tasks.CheckAction;
-
/**
* 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!
@@ -80,19 +80,36 @@ class InternalCheck extends DefaultCheck {
return result;
}
- boolean printAndEvaluate(final Map results) {
+ void printResults(final Map results) {
final PrintWriter writer = new PrintWriter(System.out);// NOSONAR
+ writer.write("Results:\n");
writer.write(createResultGrid(results).render());
writer.write(createStatusLine(results));
+ writer.write(createAssertionStatus());
writer.flush();
+ }
+
+ private String createAssertionStatus() {
+ final Line line = new Line();
if (this.failedAssertions > 0) {
log.error("Assertion check failed.\n\nAssertions run: {}, Assertions failed: {}\n", this.checkAssertions,
this.failedAssertions);
+ line.add(MessageFormat.format("Assertions run: {0}, Assertions failed: ", this.checkAssertions));
+ line.add(this.failedAssertions, Code.RED);
} else if (this.checkAssertions > 0) {
log.info("Assertion check successful.\n\nAssertions run: {}, Assertions failed: {}\n", this.checkAssertions,
this.failedAssertions);
+ line.add(MessageFormat.format("Assertions run: {0}, Assertions failed: {1}", this.checkAssertions, this.failedAssertions));
}
- return this.failedAssertions == 0 && results.entrySet().stream().allMatch(e -> e.getValue().isAcceptable());
+ return line.render(true, false);
+ }
+
+ @Override
+ public boolean isSuccessful(final Map results) {
+ if (this.checkAssertions > 0) {
+ return this.failedAssertions == 0;
+ }
+ return super.isSuccessful(results);
}
private static String createStatusLine(final Map results) {
@@ -105,7 +122,7 @@ class InternalCheck extends DefaultCheck {
if (errors > 0) {
line.add(" Processing errors: ").add(errors, Code.RED);
}
- return line.render();
+ return line.render(true, false);
}
private static Grid createResultGrid(final Map results) {
diff --git a/src/main/java/de/kosit/validationtool/cmd/Validator.java b/src/main/java/de/kosit/validationtool/cmd/Validator.java
index b67329f..2303f6e 100644
--- a/src/main/java/de/kosit/validationtool/cmd/Validator.java
+++ b/src/main/java/de/kosit/validationtool/cmd/Validator.java
@@ -190,10 +190,10 @@ public class Validator {
}
final long processingTime = System.currentTimeMillis() - start;
Printer.writeOut("Processing of {0} objects completed in {1}ms", targets.size(), processingTime);
- Printer.writeOut("Results:");
- final boolean result = check.printAndEvaluate(results);
+
+ check.printResults(results);
log.info("Processing {} object(s) completed in {}ms", targets.size(), processingTime);
- return result ? 0 : 1;
+ return check.isSuccessful(results) ? 0 : 1;
} catch (final Exception e) {
e.printStackTrace();// NOSONAR
@@ -219,7 +219,7 @@ public class Validator {
}
private static void printScenarios(final Configuration configuration) {
- Printer.writeOut("Loaded \"{0} {1}\" by {2} from {3} ", configuration.getName(), "1", configuration.getAuthor(),
+ Printer.writeOut("Loaded \"{0}\" by {1} from {2} ", configuration.getName(), configuration.getAuthor(),
configuration.getDate());
Printer.writeOut("\nThe following scenarios are available:");
configuration.getScenarios().forEach(e -> {
diff --git a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
index 81baa2c..551ba91 100644
--- a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
+++ b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
@@ -21,9 +21,11 @@ package de.kosit.validationtool.impl;
import static de.kosit.validationtool.impl.DateFactory.createTimestamp;
+import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.Map;
import java.util.stream.Collectors;
import lombok.Getter;
@@ -101,6 +103,10 @@ public class DefaultCheck implements Check {
return type;
}
+ protected boolean isSuccessful(final Map results) {
+ return results.entrySet().stream().allMatch(e -> e.getValue().isAcceptable());
+ }
+
@Override
public Result checkInput(final Input input) {
final CheckAction.Bag t = new CheckAction.Bag(input, createReport());
From 9c98d6470d7633c3a960bde47d65072cb70b13b9 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Thu, 20 Aug 2020 16:50:37 +0200
Subject: [PATCH 019/210] (chore) no stacktrace, when not targets supplied
---
src/main/java/de/kosit/validationtool/cmd/Validator.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/main/java/de/kosit/validationtool/cmd/Validator.java b/src/main/java/de/kosit/validationtool/cmd/Validator.java
index 2303f6e..0c9d5fd 100644
--- a/src/main/java/de/kosit/validationtool/cmd/Validator.java
+++ b/src/main/java/de/kosit/validationtool/cmd/Validator.java
@@ -196,7 +196,7 @@ public class Validator {
return check.isSuccessful(results) ? 0 : 1;
} catch (final Exception e) {
- e.printStackTrace();// NOSONAR
+ Printer.writeErr(e.getMessage());
if (cmd.hasOption(DEBUG.getOpt())) {
log.error(e.getMessage(), e);
} else {
@@ -219,8 +219,7 @@ public class Validator {
}
private static void printScenarios(final Configuration configuration) {
- Printer.writeOut("Loaded \"{0}\" by {1} from {2} ", configuration.getName(), configuration.getAuthor(),
- configuration.getDate());
+ Printer.writeOut("Loaded \"{0}\" by {1} from {2} ", configuration.getName(), configuration.getAuthor(), configuration.getDate());
Printer.writeOut("\nThe following scenarios are available:");
configuration.getScenarios().forEach(e -> {
final Line line = new Line(Code.GREEN);
@@ -291,7 +290,7 @@ public class Validator {
private static Collection listDirectoryTargets(final Path d) {
try ( final Stream stream = Files.list(d) ) {
- return stream.filter(path -> path.toString().endsWith(".xml")).collect(Collectors.toList());
+ return stream.filter(path -> path.toString().toLowerCase().endsWith(".xml")).collect(Collectors.toList());
} catch (final IOException e) {
throw new IllegalStateException("IOException while list directory content. Can not determine test targets.", e);
}
From 7a8635eba27a6af08fa314303ff985371c6d69aa Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Fri, 21 Aug 2020 10:03:21 +0200
Subject: [PATCH 020/210] (fix)
https://github.com/itplr-kosit/validator/issues/51
---
CHANGELOG.md | 2 +
.../cmd/DefaultNamingStrategy.java | 21 ++++---
.../impl/tasks/CheckAction.java | 10 +--
.../cmd/DefaultNamingStrategyTest.java | 61 +++++++++++++++++++
4 files changed, 77 insertions(+), 17 deletions(-)
create mode 100644 src/test/java/de/kosit/validationtool/cmd/DefaultNamingStrategyTest.java
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cc30047..c72e1d8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Fixed
- date conversion when using [ConfigurationBuilder#date(Date)](https://github.com/itplr-kosit/validator/blob/d7beb1040418ae5cbeb9427532fd87482f55756c/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java#L109)
+### Fixed
+- [#51](https://github.com/itplr-kosit/validator/issues/51) Suffix of report xml is missing
### Added
- read saxon XdmNode with InputFactory
diff --git a/src/main/java/de/kosit/validationtool/cmd/DefaultNamingStrategy.java b/src/main/java/de/kosit/validationtool/cmd/DefaultNamingStrategy.java
index 0debe17..35bb045 100644
--- a/src/main/java/de/kosit/validationtool/cmd/DefaultNamingStrategy.java
+++ b/src/main/java/de/kosit/validationtool/cmd/DefaultNamingStrategy.java
@@ -1,7 +1,10 @@
package de.kosit.validationtool.cmd;
+import static org.apache.commons.io.FilenameUtils.isExtension;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
+import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
import lombok.Getter;
@@ -18,27 +21,25 @@ public class DefaultNamingStrategy implements NamingStrategy {
private String prefix;
- private String postfix = "report";
+ private String postfix;
@Override
- public String createName(final String base) {
- if (StringUtils.isEmpty(base)) {
+ public String createName(final String name) {
+ if (StringUtils.isEmpty(name)) {
throw new IllegalArgumentException("Can not generate name based on null input");
}
- final int index = base.lastIndexOf('.');
+ final String base = isExtension(name.toLowerCase(), "xml") ? FilenameUtils.getBaseName(name) : name;
final StringBuilder result = new StringBuilder();
if (isNotEmpty(this.prefix)) {
result.append(this.prefix).append("-");
}
- result.append(base, 0, index > 0 ? index : base.length());
+ result.append(base);
if (isNotEmpty(this.postfix)) {
result.append("-").append(this.postfix);
+ } else if (isEmpty(this.prefix)) {
+ result.append("-").append("report");
}
- if (index > 0) {
- result.append(base.substring(index));
- } else {
- result.append(".xml");
- }
+ result.append(".xml");
return result.toString();
}
}
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 a5b65aa..1973a5b 100644
--- a/src/main/java/de/kosit/validationtool/impl/tasks/CheckAction.java
+++ b/src/main/java/de/kosit/validationtool/impl/tasks/CheckAction.java
@@ -21,8 +21,8 @@ package de.kosit.validationtool.impl.tasks;
import java.util.Collection;
import java.util.Collections;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+
+import org.apache.commons.io.FilenameUtils;
import lombok.AccessLevel;
import lombok.Getter;
@@ -113,11 +113,7 @@ public interface CheckAction {
*/
public String getName() {
final String fileName = getInput().getName().replaceAll(".*/|.*\\\\", "");
- final Matcher matcher = Pattern.compile("(.*)\\..+").matcher(fileName);
- if (matcher.matches()) {
- return matcher.group(1);
- }
- return fileName;
+ return FilenameUtils.getBaseName(fileName);
}
}
diff --git a/src/test/java/de/kosit/validationtool/cmd/DefaultNamingStrategyTest.java b/src/test/java/de/kosit/validationtool/cmd/DefaultNamingStrategyTest.java
new file mode 100644
index 0000000..655e8d0
--- /dev/null
+++ b/src/test/java/de/kosit/validationtool/cmd/DefaultNamingStrategyTest.java
@@ -0,0 +1,61 @@
+package de.kosit.validationtool.cmd;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.Test;
+
+/**
+ * Tests {@link DefaultNamingStrategy}
+ *
+ * @author Andreas Penski
+ */
+public class DefaultNamingStrategyTest {
+
+ @Test
+ public void testSimple() {
+ final DefaultNamingStrategy strategy = new DefaultNamingStrategy();
+ assertThat(strategy.createName("test")).isEqualTo("test-report.xml");
+ strategy.setPrefix("prefix");
+ assertThat(strategy.createName("test")).isEqualTo("prefix-test.xml");
+ strategy.setPostfix("postfix");
+ assertThat(strategy.createName("test")).isEqualTo("prefix-test-postfix.xml");
+ strategy.setPrefix(null);
+ assertThat(strategy.createName("test")).isEqualTo("test-postfix.xml");
+ }
+
+ @Test
+ public void testDotted() {
+ final DefaultNamingStrategy strategy = new DefaultNamingStrategy();
+ assertThat(strategy.createName("test.xml")).isEqualTo("test-report.xml");
+ strategy.setPrefix("prefix");
+ assertThat(strategy.createName("test.xml")).isEqualTo("prefix-test.xml");
+ strategy.setPostfix("postfix");
+ assertThat(strategy.createName("test.xml")).isEqualTo("prefix-test-postfix.xml");
+ strategy.setPrefix(null);
+ assertThat(strategy.createName("test.xml")).isEqualTo("test-postfix.xml");
+ }
+
+ @Test
+ public void testDoubleDotted() {
+ final DefaultNamingStrategy strategy = new DefaultNamingStrategy();
+ assertThat(strategy.createName("test.second.xml")).isEqualTo("test.second-report.xml");
+ strategy.setPrefix("prefix");
+ assertThat(strategy.createName("test.second.xml")).isEqualTo("prefix-test.second.xml");
+ strategy.setPostfix("postfix");
+ assertThat(strategy.createName("test.second.xml")).isEqualTo("prefix-test.second-postfix.xml");
+ strategy.setPrefix(null);
+ assertThat(strategy.createName("test.second.xml")).isEqualTo("test.second-postfix.xml");
+ }
+
+ @Test
+ public void testUnknownExtenson() {
+ final DefaultNamingStrategy strategy = new DefaultNamingStrategy();
+ assertThat(strategy.createName("test.ext")).isEqualTo("test.ext-report.xml");
+ strategy.setPrefix("prefix");
+ assertThat(strategy.createName("test.ext")).isEqualTo("prefix-test.ext.xml");
+ strategy.setPostfix("postfix");
+ assertThat(strategy.createName("test.ext")).isEqualTo("prefix-test.ext-postfix.xml");
+ strategy.setPrefix(null);
+ assertThat(strategy.createName("test.ext")).isEqualTo("test.ext-postfix.xml");
+ }
+}
From fff5c256fa6039d85721c5ade022d38920476361 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Fri, 21 Aug 2020 10:12:47 +0200
Subject: [PATCH 021/210] (chore) cleanup
---
.../de/kosit/validationtool/cmd/DefaultNamingStrategy.java | 2 --
.../kosit/validationtool/cmd/DefaultNamingStrategyTest.java | 5 +++++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/main/java/de/kosit/validationtool/cmd/DefaultNamingStrategy.java b/src/main/java/de/kosit/validationtool/cmd/DefaultNamingStrategy.java
index 35bb045..02f8918 100644
--- a/src/main/java/de/kosit/validationtool/cmd/DefaultNamingStrategy.java
+++ b/src/main/java/de/kosit/validationtool/cmd/DefaultNamingStrategy.java
@@ -7,7 +7,6 @@ import static org.apache.commons.lang3.StringUtils.isNotEmpty;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang3.StringUtils;
-import lombok.Getter;
import lombok.Setter;
/**
@@ -15,7 +14,6 @@ import lombok.Setter;
*
* @author Andreas Penski
*/
-@Getter
@Setter
public class DefaultNamingStrategy implements NamingStrategy {
diff --git a/src/test/java/de/kosit/validationtool/cmd/DefaultNamingStrategyTest.java b/src/test/java/de/kosit/validationtool/cmd/DefaultNamingStrategyTest.java
index 655e8d0..da13c79 100644
--- a/src/test/java/de/kosit/validationtool/cmd/DefaultNamingStrategyTest.java
+++ b/src/test/java/de/kosit/validationtool/cmd/DefaultNamingStrategyTest.java
@@ -58,4 +58,9 @@ public class DefaultNamingStrategyTest {
strategy.setPrefix(null);
assertThat(strategy.createName("test.ext")).isEqualTo("test.ext-postfix.xml");
}
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testEmptyInput() {
+ new DefaultNamingStrategy().createName(null);
+ }
}
From 83770df637f4b98eb7e8e5b4e80c46f500e8294e Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Fri, 21 Aug 2020 10:29:09 +0200
Subject: [PATCH 022/210] (chore) remove double 'fixed' section
---
CHANGELOG.md | 1 -
1 file changed, 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c72e1d8..b8adfdd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,7 +8,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Fixed
- date conversion when using [ConfigurationBuilder#date(Date)](https://github.com/itplr-kosit/validator/blob/d7beb1040418ae5cbeb9427532fd87482f55756c/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java#L109)
-### Fixed
- [#51](https://github.com/itplr-kosit/validator/issues/51) Suffix of report xml is missing
### Added
From 04dd2868c6b7f2b02dd43ccb8783af2032f4392c Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Fri, 21 Aug 2020 10:42:23 +0200
Subject: [PATCH 023/210] (chore) minor dependency updates
---
pom.xml | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/pom.xml b/pom.xml
index ca017d9..ed9079b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,8 +40,8 @@
UTF-80.8.5
- 1.18.8
- 9.9.1-3
+ 1.18.12
+ 9.9.1-71.7.25
@@ -92,7 +92,7 @@
org.apache.commonscommons-lang3
- 3.9
+ 3.10org.glassfish.jaxb
@@ -103,13 +103,13 @@
org.assertjassertj-core
- 3.12.2
+ 3.16.1testjunitjunit
- 4.12
+ 4.13test
@@ -120,13 +120,13 @@
io.rest-assuredrest-assured
- 3.3.0
+ 4.3.1testorg.mockitomockito-core
- 3.2.4
+ 3.3.3test
From 584923af8edc7d056346adb2411675aa0ccbc0fe Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Fri, 21 Aug 2020 10:51:18 +0200
Subject: [PATCH 024/210] (chore) saxon update to CHANGELOG.md
---
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b8adfdd..f85f4b1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- InputFactory has methods to read any java.xml.transform.Source as Input not only StreamSources
- InputFactory uses a generated UUID as name for SourceInput, if no "real" name can be derived
+- saxon dependency update (minor, 9.9.1-7)
## 1.3.1
### Fixed
From fa7faf99615aab3d84f9aded086d38188f472a14 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Mon, 24 Aug 2020 08:51:17 +0200
Subject: [PATCH 025/210] (chore) jaxb dependency minor update
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index ed9079b..8eba135 100644
--- a/pom.xml
+++ b/pom.xml
@@ -97,7 +97,7 @@
org.glassfish.jaxbjaxb-runtime
- 2.3.2
+ 2.3.3true
From f2223552ad74a6cc1f1065aa1a5f542d3a9b1dfe Mon Sep 17 00:00:00 2001
From: Andreas Penski <18-andreas.penski@users.noreply.projekte.kosit.org>
Date: Wed, 2 Sep 2020 12:34:20 +0000
Subject: [PATCH 026/210] #67 [CLI,DAEMON] Return proper return codes / status
codes
---
.gitlab-ci.yml | 31 +---
CHANGELOG.md | 5 +-
README.md | 47 +++--
docs/cli.md | 46 +++++
docs/daemon.md | 17 +-
pom.xml | 2 -
.../cmd/CommandLineApplication.java | 21 +--
.../cmd/CommandLineOptions.java | 1 -
.../validationtool/cmd/InternalCheck.java | 19 +-
.../kosit/validationtool/cmd/ReturnValue.java | 28 +++
.../kosit/validationtool/cmd/Validator.java | 165 +++++++++---------
.../validationtool/daemon/BaseHandler.java | 13 +-
.../validationtool/daemon/CheckHandler.java | 26 ++-
.../validationtool/daemon/HttpStatus.java | 32 ++++
.../validationtool/impl/DefaultCheck.java | 3 +-
.../cmd/CheckAssertionActionTest.java | 6 +-
.../kosit/validationtool/cmd/CommandLine.java | 137 +++++++++------
.../cmd/CommandlineApplicationTest.java | 56 +++---
.../cmd/PrintReportActionTest.java | 10 +-
.../validationtool/daemon/CheckHandlerIT.java | 3 +-
.../daemon/ConfigHandlerTest.java | 4 +-
21 files changed, 424 insertions(+), 248 deletions(-)
create mode 100644 docs/cli.md
create mode 100644 src/main/java/de/kosit/validationtool/cmd/ReturnValue.java
create mode 100644 src/main/java/de/kosit/validationtool/daemon/HttpStatus.java
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2985761..039bbdd 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -27,37 +27,10 @@ build-java-14:
script:
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
artifacts:
+ when: on_failure
name: java-14
paths:
- - target/*.jar
- reports:
- junit:
- - target/surefire-reports/*.xml
- - target/failsafe-reports/*.xml
-
-build-java-13:
- stage: build
- image: maven:3-jdk-13
- script:
- - mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
- artifacts:
- name: java-13
- paths:
- - target/*.jar
- reports:
- junit:
- - target/surefire-reports/*.xml
- - target/failsafe-reports/*.xml
-
-build-java-12:
- stage: build
- image: maven:3-jdk-12
- script:
- - mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
- artifacts:
- name: java-12
- paths:
- - target/*.jar
+ - target/*
reports:
junit:
- target/surefire-reports/*.xml
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f85f4b1..3b9af62 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,11 +15,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [CLI] custom output without the various log messages
- [CLI] options to set the log level (`-X` = full debug output, `-l ` set a specific level)
- [CLI] return code ist <> 0 on rejected results
+- [CLI] read (single) test target from stdin
+- [DAEMON] name inputs via request URI (see [daemon documentation](./docs/daemon.md#status-codes))
### Changed
- InputFactory has methods to read any java.xml.transform.Source as Input not only StreamSources
- InputFactory uses a generated UUID as name for SourceInput, if no "real" name can be derived
- saxon dependency update (minor, 9.9.1-7)
+- [DAEMON] proper status codes when returning results
## 1.3.1
### Fixed
@@ -29,7 +32,7 @@ do not reflect actual schematron validation result
- exception while resolving when using XSLT's `unparsed-text()` function within report generation
### Added
-- [CLI] add summary report
+- [CLI] summary report
### Changed
- engine info contains version number of the validator (configurations can output this in the report for maintainance puposes)
diff --git a/README.md b/README.md
index be743c4..6b91c6c 100644
--- a/README.md
+++ b/README.md
@@ -1,27 +1,34 @@
-# Validator
+# KoSIT Validator
+- [Introduction](#introduction)
+- [Validation Configurations](#validation-configurations)
+ * [Third Party Validation Configurations](#third-party-validation-configurations)
+- [Usage](#usage)
+ * [Standalone Command-Line Interface](#standalone-command-line-interface)
+ * [Application User Interface (API / embedded usage)](#application-user-interface--api---embedded-usage-)
+ * [Daemon-Mode](#daemon-mode)
+- [Packages](#packages)
-The validator is an XML validation-engine. It validates XML documents against XML Schema and Schematron Rules depending on self defined [scenarios](docs/configurations.md) which are used to fully configure the validation process.
-The validator always outputs a [validation report in XML](docs/configurations.md#validators-report) including all validation errors and data about the validation.
+## Introduction
+The validator is an XML validation engine to validate and process XML files in various formats. It basically does the following in order:
-See [architecture](docs/architecture.md) for informations about the actual validation process.
+1. identify actual xml format
+1. validate the xml file (using schema and schematron rules)
+1. generate a custom report / extract custom data from the xml file
+1. compute an acceptance status (according the supplied schema and rules)
-## Packages
+The validator depends on self defined [scenarios](docs/configurations.md) which are used to fully configure the process.
+It always creates a [validation report in XML](docs/configurations.md#validators-report). The actual content of this is controlled by the scenario.
-The validator distribution contains the following artifacts:
-
-1. **validationtool-``.jar**: Java library for embedded use within an application
-1. **validationtool-`-standalone.jar**: Uber-JAR for standalone usage containing all dependencies in one jar file. This file comes with JAXB *embedded* and can be used with Java 8 and Java >= 11)
-1. **validationtool-`-java8-standalone.jar**: Uber-JAR for standalone usage with Java JDK 8 containing all dependencies in one jar file. This file file *does not* contain JAXB and depends on the bundled version of the JDK.
-1. **libs/***: directory containing all (incl. optional) dependencies of the validator
+See [architecture](docs/architecture.md) for information about the actual validation process.
-## Validation Configurations
+## Validation configurations
-The validator is just an engine and does not know anything about XML Documents and has no own validation rules.
+The validator is just an engine and does not know anything about XML documents and has no own validation rules.
Validation rules and details are defined in [validation scenarios](docs/configurations.md) which are used to fully configure the validation process.
All configurations are self-contained modules which are deployed and developed on their own.
-### Third Party Validation Configurations
+### Third party validation configurations
Currently, there are two public third party validation configurations available.
@@ -34,7 +41,7 @@ Currently, there are two public third party validation configurations available.
## Usage
-The validator is designed to be used in three different ways:
+The validator can be used in three different ways:
* as standalone application running from the cli
* as library embedded within a custom application
@@ -57,6 +64,8 @@ java -jar validationtool--standalone.jar --help
A concrete example with a specific validator configuration can be found on
[GitHub](https://github.com/itplr-kosit/validator-configuration-xrechnung)
+The [CLI documentation](./docs/cli.md) shows further configuration options.
+
### Application User Interface (API / embedded usage)
The validator can also be used in own Java Applications via the API. An example use of the API as follows:
@@ -85,3 +94,11 @@ java -jar validationtool--standalone.jar -s -D
The [daemon documentation](./docs/daemon.md) shows more usage details and further configuration options.
+## Packages
+
+The validator distribution contains the following artifacts:
+
+1. **validationtool-``.jar**: Java library for embedded use within an application
+1. **validationtool-`-standalone.jar**: Uber-JAR for standalone usage containing all dependencies in one jar file. This file comes with JAXB *embedded* and can be used with Java 8 and Java >= 11)
+1. **validationtool-`-java8-standalone.jar**: Uber-JAR for standalone usage with Java JDK 8 containing all dependencies in one jar file. This file file *does not* contain JAXB and depends on the bundled version of the JDK.
+1. **libs/***: directory containing all (incl. optional) dependencies of the validator
\ No newline at end of file
diff --git a/docs/cli.md b/docs/cli.md
new file mode 100644
index 0000000..8287f81
--- /dev/null
+++ b/docs/cli.md
@@ -0,0 +1,46 @@
+# Validator CLI
+
+The validator comes with a commandline interface (CLI) which allows validating any number of input xml files.
+
+The general way using the CLI is:
+
+```shell
+java -jar validationtool--standalone.jar -s [OPTIONS] [FILE] [FILE] [FILE] ...
+```
+
+The validator can also read the xml file from the standard input
+
+```shell script
+# via redirection
+java -jar validationtool--standalone.jar -s [OPTIONS] < my-input.xml
+
+# read from pipe
+cat my-input.xml | validationtool--standalone.jar -s [OPTIONS]
+```
+
+The help option displays further CLI options to customize the process:
+
+```shell
+java -jar validationtool--standalone.jar --help
+```
+
+## Special features
+Besides the obvious functionality of validating, the cli provides additional functionality to customize the processing:
+
+|name | option | description |
+| - | - | - |
+| [Daemon mode](daemon.md) | `-D` | Starts the validator in daemon mode as an HTTP service |
+| print mode | `-p` | Print the report to stdout |
+| extract html | `-h` | Extracts any html blocks within the report and saves the content to the filesystem. Note: the file name is derived from the node name the html appears in |
+| print memory stats | `-m` | Prints some memory usage information. Mainly for debugging purposes on processing huge xml files |
+| check assertions | `-c ` | Check assertions on the generated reports. This is mainly useful for scenario developers. Ask KoSIT for documentation, if you want to use this feauture |
+
+
+## Return codes
+
+| code | description |
+|-|-|
+| 0 | All validated xml files are acceptable according to the scenario configurations |
+| positive integer | Number of rejected (e.g. not acceptable) xml files according to the scenario configurations|
+| -1 | Parsing error. The commandline arguments specified are incorrect |
+| -2 | Configuration error. There is an error loading the configuration and/or validation targets |
diff --git a/docs/daemon.md b/docs/daemon.md
index ff5cd65..e3f7996 100644
--- a/docs/daemon.md
+++ b/docs/daemon.md
@@ -42,9 +42,11 @@ The possible customizations are:
## Access the HTTP interface
-The validation service listens to `POST`-requests on any server URL. You need to supply the xml/object to validate in the HTTP body.
+The validation service listens to `POST`-requests on any server URL. You need to supply the xml/object to validate in the HTTP body.
+The last segment of the request URI is treated as the name of the input. E.g. requests to `/myfile.xml`, `/mypath/myfile.xml` and `/mypath/myfile.xml?someParam=1`
+would all result in an input named `myfile.xml`. If you don't specify a specific request URI (e.g. POST to `/`), the name is auto generated for you.
-The service expects a single XML input in the HTTP body, e.g. `multipart/form-data` is not supported.
+The service expects a single XML input in the HTTP body, e.g. `multipart/form-data` is NOT supported.
Examples:
@@ -84,6 +86,15 @@ fetch("http://localhost:8080", requestOptions)
.then(result => console.log(result))
.catch(error => console.log('error', error));
```
+## Status codes
+| code | description |
+|-|-|
+| 200 | The xml file is acceptable according to the scenario configurations |
+| 400 | Bad request. the request contains errors, e.g. no content supplied |
+| 405 | Method not allowed. Thec check service is only answering on POST requests |
+| 406 | The xml file is NOT acceptable according to the scenario configurations|
+| 422 | Unprocessable entity. Indicates an error while processing the xml file. This hints to errors in the scenario configuration |
+| 500 | Internal server error. Something went wrong |
## Authorization
There is no mechanism to check, whether client is allowed to consume the service or not. The user is responsible to secure access to the service.
@@ -101,7 +112,7 @@ The daemon provides a simple GUI when issuing `GET` requests providing the follo
1. information about the actual [validator configuration](configurations.md) used by this daemon
1. a simple form to test the daemon with custom inputs
- The GUI can be disabled using the API (see above) or via CLI
+ The GUI can be disabled using the API (see above) or via CLI:
```shell script
java -jar validationtool--standalone.jar -s -D --disable-gui
diff --git a/pom.xml b/pom.xml
index 8eba135..b290a51 100644
--- a/pom.xml
+++ b/pom.xml
@@ -504,8 +504,6 @@
-
-
diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java
index 38a8ded..d91f75a 100644
--- a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java
+++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java
@@ -19,7 +19,6 @@
package de.kosit.validationtool.cmd;
-import static de.kosit.validationtool.cmd.CommandLineOptions.DAEMON_SIGNAL;
import static de.kosit.validationtool.cmd.CommandLineOptions.HELP;
import static de.kosit.validationtool.cmd.CommandLineOptions.createHelpOptions;
import static de.kosit.validationtool.cmd.CommandLineOptions.createOptions;
@@ -59,16 +58,18 @@ public class CommandLineApplication {
* @param args die Eingabe-Argumente
*/
public static void main(final String[] args) {
- final int resultStatus = mainProgram(args);
- if (DAEMON_SIGNAL != resultStatus) {
+ final ReturnValue resultStatus = mainProgram(args);
+ if (!resultStatus.equals(ReturnValue.DAEMON_MODE)) {
sayGoodby(resultStatus);
- System.exit(resultStatus);
+ System.exit(resultStatus.getCode());
+ } else {
+ Runtime.getRuntime().addShutdownHook(new Thread(() -> Printer.writeOut("Shutting down daemon ...")));
}
}
- private static void sayGoodby(final int resultStatus) {
+ private static void sayGoodby(final ReturnValue resultStatus) {
Printer.writeOut("\n##############################");
- if (resultStatus == 0) {
+ if (resultStatus.equals(ReturnValue.SUCCESS)) {
Printer.writeOut("# " + new Line(Code.GREEN).add("Validation succesful!").render(false, false) + " #");
} else {
Printer.writeOut("# " + new Line(Code.RED).add("Validation failed!").render(false, false) + " #");
@@ -77,14 +78,14 @@ public class CommandLineApplication {
}
// for testing purposes. Unless jvm is terminated during tests. See above
- static int mainProgram(final String[] args) {
+ static ReturnValue mainProgram(final String[] args) {
final Options options = createOptions();
- int resultStatus;
+ ReturnValue resultStatus;
try {
if (isHelpRequested(args)) {
printHelp(options);
- resultStatus = 0;
+ resultStatus = ReturnValue.SUCCESS;
} else {
final CommandLineParser parser = new DefaultParser();
final CommandLine cmd = parser.parse(options, args);
@@ -94,7 +95,7 @@ public class CommandLineApplication {
} catch (final ParseException e) {
writeErr("Error processing command line arguments: {0}", e.getMessage(), e);
printHelp(options);
- resultStatus = 1;
+ resultStatus = ReturnValue.PARSING_ERROR;
}
return resultStatus;
}
diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java
index 992e083..c7bc6d0 100644
--- a/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java
+++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java
@@ -37,7 +37,6 @@ public class CommandLineOptions {
static final Option DEBUG_LOG = Option.builder("X").longOpt("debug-logging").desc("Enables full debug log. Alias for -l debug").build();
static final Option LOG_LEVEL = Option.builder("l").longOpt("log-level").hasArg()
.desc("Enables a certain log level for debugging " + "purposes").build();
- public static final int DAEMON_SIGNAL = 100;
static final Option PRINT_MEM_STATS = Option.builder("m").longOpt("memory-stats").desc("Prints some memory stats").build();
private CommandLineOptions() {
diff --git a/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java b/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
index 93ddd4b..1cedd08 100644
--- a/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
+++ b/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
@@ -20,10 +20,9 @@
package de.kosit.validationtool.cmd;
import java.io.PrintWriter;
-import java.nio.file.Path;
import java.text.MessageFormat;
-import java.util.Comparator;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.stream.Collectors;
import org.fusesource.jansi.AnsiRenderer.Code;
@@ -80,7 +79,7 @@ class InternalCheck extends DefaultCheck {
return result;
}
- void printResults(final Map results) {
+ void printResults(final Map results) {
final PrintWriter writer = new PrintWriter(System.out);// NOSONAR
writer.write("Results:\n");
writer.write(createResultGrid(results).render());
@@ -105,14 +104,18 @@ class InternalCheck extends DefaultCheck {
}
@Override
- public boolean isSuccessful(final Map results) {
+ public boolean isSuccessful(final Map results) {
if (this.checkAssertions > 0) {
return this.failedAssertions == 0;
}
return super.isSuccessful(results);
}
- private static String createStatusLine(final Map results) {
+ public int getNotAcceptableCount(final Map results) {
+ return (int) (this.failedAssertions + results.values().stream().filter(e -> !e.isAcceptable()).count());
+ }
+
+ private static String createStatusLine(final Map results) {
final long acceptable = results.entrySet().stream().filter(e -> e.getValue().isAcceptable()).count();
final long rejected = results.entrySet().stream().filter(e -> !e.getValue().isAcceptable()).count();
final long errors = results.entrySet().stream().filter(e -> !e.getValue().isProcessingSuccessful()).count();
@@ -125,7 +128,7 @@ class InternalCheck extends DefaultCheck {
return line.render(true, false);
}
- private static Grid createResultGrid(final Map results) {
+ private static Grid createResultGrid(final Map results) {
final Grid grid = new Grid(
//@formatter:off
new ColumnDefinition("filename", 60, 10, 1),
@@ -135,11 +138,11 @@ class InternalCheck extends DefaultCheck {
new ColumnDefinition("Error/Description", 60,20,3)
);
//@formatter:on
- results.entrySet().stream().sorted(Comparator.comparing(e -> e.getKey().getFileName())).forEach(e -> {
+ results.entrySet().stream().sorted(Entry.comparingByKey()).forEach(e -> {
final Result value = e.getValue();
final Code textcolor = value.isAcceptable() ? Code.GREEN : Code.RED;
- grid.addCell(e.getKey().getFileName(), textcolor);
+ grid.addCell(e.getKey(), textcolor);
grid.addCell(value.isSchemaValid() ? "Y" : "N", textcolor);
grid.addCell(value.isSchematronValid() ? "Y" : "N", textcolor);
grid.addCell(value.getAcceptRecommendation(), textcolor);
diff --git a/src/main/java/de/kosit/validationtool/cmd/ReturnValue.java b/src/main/java/de/kosit/validationtool/cmd/ReturnValue.java
new file mode 100644
index 0000000..16b1e0e
--- /dev/null
+++ b/src/main/java/de/kosit/validationtool/cmd/ReturnValue.java
@@ -0,0 +1,28 @@
+package de.kosit.validationtool.cmd;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+
+/**
+ * CLI return codes.
+ *
+ * @author Andreas Penski
+ */
+@RequiredArgsConstructor
+@Getter
+public class ReturnValue {
+
+ public static final ReturnValue SUCCESS = new ReturnValue(0);
+
+ public static final ReturnValue CONFIGURATION_ERROR = new ReturnValue(-2);
+
+ public static final ReturnValue DAEMON_MODE = new ReturnValue(-100);
+
+ public static final ReturnValue PARSING_ERROR = new ReturnValue(-1);;
+
+ private final int code;
+
+ public static ReturnValue createFailed(final int count) {
+ return new ReturnValue(count);
+ }
+}
diff --git a/src/main/java/de/kosit/validationtool/cmd/Validator.java b/src/main/java/de/kosit/validationtool/cmd/Validator.java
index 0c9d5fd..bd986ae 100644
--- a/src/main/java/de/kosit/validationtool/cmd/Validator.java
+++ b/src/main/java/de/kosit/validationtool/cmd/Validator.java
@@ -1,7 +1,6 @@
package de.kosit.validationtool.cmd;
import static de.kosit.validationtool.cmd.CommandLineOptions.CHECK_ASSERTIONS;
-import static de.kosit.validationtool.cmd.CommandLineOptions.DAEMON_SIGNAL;
import static de.kosit.validationtool.cmd.CommandLineOptions.DEBUG;
import static de.kosit.validationtool.cmd.CommandLineOptions.DISABLE_GUI;
import static de.kosit.validationtool.cmd.CommandLineOptions.EXTRACT_HTML;
@@ -75,20 +74,29 @@ public class Validator {
*
* @param cmd parsed commandline.
*/
- static int mainProgram(final CommandLine cmd) {
+ static ReturnValue mainProgram(final CommandLine cmd) {
greeting();
final org.apache.commons.cli.Options options = createOptions();
- int returnValue = 0;
- if (cmd.hasOption(SERVER.getOpt())) {
- returnValue = startDaemonMode(cmd);
- } else if (cmd.hasOption(HELP.getOpt()) || cmd.getArgList().isEmpty()) {
- printHelp(options);
- } else if (cmd.getArgList().isEmpty()) {
- printHelp(options);
- } else {
- returnValue = processActions(cmd);
+ final ReturnValue returnValue;
+ try {
+ if (cmd.hasOption(SERVER.getOpt())) {
+ startDaemonMode(cmd);
+ returnValue = ReturnValue.DAEMON_MODE;
+ } else if (cmd.hasOption(HELP.getOpt()) || (cmd.getArgList().isEmpty() && !isPiped())) {
+ printHelp(options);
+ returnValue = ReturnValue.PARSING_ERROR;
+ } else {
+ returnValue = processActions(cmd);
+ }
+ } catch (final Exception e) {
+ Printer.writeErr(e.getMessage());
+ if (cmd.hasOption(DEBUG.getOpt())) {
+ log.error(e.getMessage(), e);
+ } else {
+ log.error(e.getMessage());
+ }
+ return ReturnValue.CONFIGURATION_ERROR;
}
-
return returnValue;
}
@@ -120,7 +128,7 @@ public class Validator {
return host;
}
- private static int startDaemonMode(final CommandLine cmd) {
+ private static void startDaemonMode(final CommandLine cmd) {
final Option[] unavailable = new Option[] { PRINT, CHECK_ASSERTIONS, DEBUG, OUTPUT, EXTRACT_HTML, REPORT_POSTFIX, REPORT_PREFIX };
warnUnusedOptions(cmd, unavailable, true);
final ConfigurationLoader config = getConfiguration(cmd);
@@ -132,7 +140,6 @@ public class Validator {
printScenarios(configuration);
Printer.writeOut("\nStarting daemon mode ...");
validDaemon.startServer(configuration);
- return DAEMON_SIGNAL;
}
private static void warnUnusedOptions(final CommandLine cmd, final Option[] unavailable, final boolean daemon) {
@@ -143,69 +150,57 @@ public class Validator {
}
}
- private static int processActions(final CommandLine cmd) {
- try {
+ private static ReturnValue processActions(final CommandLine cmd) throws IOException {
+ long start = System.currentTimeMillis();
+ final Option[] unavailable = new Option[] { HOST, PORT, WORKER_COUNT, DISABLE_GUI };
+ warnUnusedOptions(cmd, unavailable, false);
+ final Configuration config = getConfiguration(cmd).build();
+ printScenarios(config);
+ final InternalCheck check = new InternalCheck(config);
+ final Path outputDirectory = determineOutputDirectory(cmd);
- long start = System.currentTimeMillis();
- final Option[] unavailable = new Option[] { HOST, PORT, WORKER_COUNT, DISABLE_GUI };
- warnUnusedOptions(cmd, unavailable, false);
- final Configuration config = getConfiguration(cmd).build();
- printScenarios(config);
- final InternalCheck check = new InternalCheck(config);
- final Path outputDirectory = determineOutputDirectory(cmd);
-
- final Processor processor = config.getContentRepository().getProcessor();
- if (cmd.hasOption(EXTRACT_HTML.getOpt())) {
- check.getCheckSteps().add(new ExtractHtmlContentAction(processor, outputDirectory));
- }
- check.getCheckSteps().add(new SerializeReportAction(outputDirectory, processor, determineNamingStrategy(cmd)));
- if (cmd.hasOption(SERIALIZE_REPORT_INPUT.getOpt())) {
- check.getCheckSteps().add(new SerializeReportInputAction(outputDirectory, check.getConversionService()));
- }
- if (cmd.hasOption(PRINT.getOpt())) {
- check.getCheckSteps().add(new PrintReportAction(processor));
- }
-
- if (cmd.hasOption(CHECK_ASSERTIONS.getOpt())) {
- final Assertions assertions = loadAssertions(cmd.getOptionValue(CHECK_ASSERTIONS.getOpt()));
- check.getCheckSteps().add(new CheckAssertionAction(assertions, processor));
- }
- if (cmd.hasOption(PRINT_MEM_STATS.getOpt())) {
- check.getCheckSteps().add(new PrintMemoryStats());
- }
- log.info("Setup completed in {}ms\n", System.currentTimeMillis() - start);
-
- final Collection targets = determineTestTargets(cmd);
- start = System.currentTimeMillis();
- final Map results = new HashMap<>();
- Printer.writeOut("\nProcessing of {0} objects started", targets.size());
- long tick = System.currentTimeMillis();
- for (final Path p : targets) {
- final Input input = InputFactory.read(p);
- results.put(p, check.checkInput(input));
- if (((System.currentTimeMillis() - tick) / 1000) > 5) {
- tick = System.currentTimeMillis();
- Printer.writeOut("{0}/{1} objects processed", results.size(), targets.size());
- }
- }
- final long processingTime = System.currentTimeMillis() - start;
- Printer.writeOut("Processing of {0} objects completed in {1}ms", targets.size(), processingTime);
-
- check.printResults(results);
- log.info("Processing {} object(s) completed in {}ms", targets.size(), processingTime);
- return check.isSuccessful(results) ? 0 : 1;
-
- } catch (final Exception e) {
- Printer.writeErr(e.getMessage());
- if (cmd.hasOption(DEBUG.getOpt())) {
- log.error(e.getMessage(), e);
- } else {
- log.error(e.getMessage());
- }
- return -1;
+ final Processor processor = config.getContentRepository().getProcessor();
+ if (cmd.hasOption(EXTRACT_HTML.getOpt())) {
+ check.getCheckSteps().add(new ExtractHtmlContentAction(processor, outputDirectory));
}
+ check.getCheckSteps().add(new SerializeReportAction(outputDirectory, processor, determineNamingStrategy(cmd)));
+ if (cmd.hasOption(SERIALIZE_REPORT_INPUT.getOpt())) {
+ check.getCheckSteps().add(new SerializeReportInputAction(outputDirectory, check.getConversionService()));
+ }
+ if (cmd.hasOption(PRINT.getOpt())) {
+ check.getCheckSteps().add(new PrintReportAction(processor));
+ }
+
+ if (cmd.hasOption(CHECK_ASSERTIONS.getOpt())) {
+ final Assertions assertions = loadAssertions(cmd.getOptionValue(CHECK_ASSERTIONS.getOpt()));
+ check.getCheckSteps().add(new CheckAssertionAction(assertions, processor));
+ }
+ if (cmd.hasOption(PRINT_MEM_STATS.getOpt())) {
+ check.getCheckSteps().add(new PrintMemoryStats());
+ }
+ log.info("Setup completed in {}ms\n", System.currentTimeMillis() - start);
+
+ final Collection targets = determineTestTargets(cmd);
+ start = System.currentTimeMillis();
+ final Map results = new HashMap<>();
+ Printer.writeOut("\nProcessing of {0} objects started", targets.size());
+ long tick = System.currentTimeMillis();
+ for (final Input input : targets) {
+ results.put(input.getName(), check.checkInput(input));
+ if (((System.currentTimeMillis() - tick) / 1000) > 5) {
+ tick = System.currentTimeMillis();
+ Printer.writeOut("{0}/{1} objects processed", results.size(), targets.size());
+ }
+ }
+ final long processingTime = System.currentTimeMillis() - start;
+ Printer.writeOut("Processing of {0} objects completed in {1}ms", targets.size(), processingTime);
+
+ check.printResults(results);
+ log.info("Processing {} object(s) completed in {}ms", targets.size(), processingTime);
+ return check.isSuccessful(results) ? ReturnValue.SUCCESS : ReturnValue.createFailed(check.getNotAcceptableCount(results));
}
+
private static ConfigurationLoader getConfiguration(final CommandLine cmd) {
final URI scenarioLocation = determineDefinition(cmd);
final URI repositoryLocation = determineRepository(cmd);
@@ -265,32 +260,44 @@ public class Validator {
return fir;
}
- private static Collection determineTestTargets(final CommandLine cmd) {
- final Collection targets = new ArrayList<>();
+ private static Collection determineTestTargets(final CommandLine cmd) throws IOException {
+ final Collection targets = new ArrayList<>();
if (!cmd.getArgList().isEmpty()) {
cmd.getArgList().forEach(e -> targets.addAll(determineTestTarget(e)));
}
+ if (isPiped()) {
+ targets.add(readFromPipe());
+ }
if (targets.isEmpty()) {
throw new IllegalStateException("No test targets found. Nothing to check. Will quit now!");
}
return targets;
}
- private static Collection determineTestTarget(final String s) {
+ private static boolean isPiped() throws IOException {
+ return System.in.available() > 0;
+ }
+
+ private static Input readFromPipe() {
+ return InputFactory.read(System.in, "stdin");
+ }
+
+ private static Collection determineTestTarget(final String s) {
final Path d = Paths.get(s);
if (Files.isDirectory(d)) {
return listDirectoryTargets(d);
} else if (Files.exists(d)) {
- return Collections.singleton(d);
+ return Collections.singleton(InputFactory.read(d));
}
log.warn("The specified test target {} does not exist. Will be ignored", s);
return Collections.emptyList();
}
- private static Collection listDirectoryTargets(final Path d) {
+ private static Collection listDirectoryTargets(final Path d) {
try ( final Stream stream = Files.list(d) ) {
- return stream.filter(path -> path.toString().toLowerCase().endsWith(".xml")).collect(Collectors.toList());
+ return stream.filter(path -> path.toString().toLowerCase().endsWith(".xml")).map(InputFactory::read)
+ .collect(Collectors.toList());
} catch (final IOException e) {
throw new IllegalStateException("IOException while list directory content. Can not determine test targets.", e);
}
diff --git a/src/main/java/de/kosit/validationtool/daemon/BaseHandler.java b/src/main/java/de/kosit/validationtool/daemon/BaseHandler.java
index 9e75fd4..ad58082 100644
--- a/src/main/java/de/kosit/validationtool/daemon/BaseHandler.java
+++ b/src/main/java/de/kosit/validationtool/daemon/BaseHandler.java
@@ -15,15 +15,20 @@ abstract class BaseHandler implements HttpHandler {
protected static final String APPLICATION_XML = "application/xml";
- static final int OK = 200;
protected static void write(final HttpExchange exchange, final byte[] content, final String contentType) throws IOException {
- write(exchange, contentType, os -> os.write(content));
+ write(exchange, content, contentType, HttpStatus.SC_OK);
}
- protected static void write(final HttpExchange exchange, final String contentType, final Write write) throws IOException {
+ protected static void write(final HttpExchange exchange, final byte[] content, final String contentType, final int statusCode)
+ throws IOException {
+ write(exchange, contentType, os -> os.write(content), statusCode);
+ }
+
+ protected static void write(final HttpExchange exchange, final String contentType, final Write write, final int statusCode)
+ throws IOException {
exchange.getResponseHeaders().add("Content-Type", contentType);
- exchange.sendResponseHeaders(OK, 0);
+ exchange.sendResponseHeaders(statusCode, 0);
final OutputStream os = exchange.getResponseBody();
write.write(os);
os.close();
diff --git a/src/main/java/de/kosit/validationtool/daemon/CheckHandler.java b/src/main/java/de/kosit/validationtool/daemon/CheckHandler.java
index 29e0d62..276f552 100644
--- a/src/main/java/de/kosit/validationtool/daemon/CheckHandler.java
+++ b/src/main/java/de/kosit/validationtool/daemon/CheckHandler.java
@@ -3,6 +3,7 @@ package de.kosit.validationtool.daemon;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.net.URI;
import java.util.concurrent.atomic.AtomicLong;
import com.sun.net.httpserver.HttpExchange;
@@ -49,21 +50,36 @@ class CheckHandler extends BaseHandler {
final InputStream inputStream = httpExchange.getRequestBody();
if (inputStream.available() > 0) {
final SourceInput serverInput = (SourceInput) InputFactory.read(inputStream,
- "supplied_instance_" + counter.incrementAndGet());
+ resolveInputName(httpExchange.getRequestURI()));
final Result result = this.implemenation.checkInput(serverInput);
- write(httpExchange, serialize(result), APPLICATION_XML);
+ write(httpExchange, serialize(result), APPLICATION_XML, resolveStatus(result));
} else {
- error(httpExchange, 400, "No content supplied");
+ error(httpExchange, HttpStatus.SC_BAD_REQUEST, "No content supplied");
}
} else {
- error(httpExchange, 405, "Method not supported");
+ error(httpExchange, HttpStatus.SC_METHOD_NOT_ALLOWED, "Method not supported");
}
} catch (final Exception e) {
- error(httpExchange, 500, "Internal error: " + e.getMessage());
+ error(httpExchange, HttpStatus.SC_INTERNAL_SERVER_ERROR, "Internal error: " + e.getMessage());
}
}
+ private static String resolveInputName(final URI requestURI) {
+ final String path = requestURI.getPath();
+ if (path.equalsIgnoreCase("/")) {
+ return "supplied_instance_" + counter.incrementAndGet();
+ }
+ return path.substring((path.lastIndexOf('/') + 1));
+ }
+
+ private static int resolveStatus(final Result result) {
+ if (result.isProcessingSuccessful()) {
+ return result.isAcceptable() ? HttpStatus.SC_OK : HttpStatus.SC_NOT_ACCEPTABLE;
+ }
+ return HttpStatus.SC_UNPROCESSABLE_ENTITY;
+ }
+
private byte[] serialize(final Result result) {
try ( final ByteArrayOutputStream out = new ByteArrayOutputStream() ) {
final Serializer serializer = this.processor.newSerializer(out);
diff --git a/src/main/java/de/kosit/validationtool/daemon/HttpStatus.java b/src/main/java/de/kosit/validationtool/daemon/HttpStatus.java
new file mode 100644
index 0000000..a29c902
--- /dev/null
+++ b/src/main/java/de/kosit/validationtool/daemon/HttpStatus.java
@@ -0,0 +1,32 @@
+package de.kosit.validationtool.daemon;
+
+/**
+ * Status codes for the HTTP daemon.
+ *
+ * @author Andreas Penski
+ */
+public interface HttpStatus {
+
+ // --- 2xx Success ---
+
+ /** {@code 200 OK} (HTTP/1.0 - RFC 1945) */
+ int SC_OK = 200;
+
+ // --- 4xx Client Error ---
+
+ /** {@code 400 Bad Request} (HTTP/1.1 - RFC 2616) */
+ int SC_BAD_REQUEST = 400;
+
+ /** {@code 405 Method Not Allowed} (HTTP/1.1 - RFC 2616) */
+ int SC_METHOD_NOT_ALLOWED = 405;
+
+ /** {@code 406 Not Acceptable} (HTTP/1.1 - RFC 2616) */
+ int SC_NOT_ACCEPTABLE = 406;
+
+ /** {@code 422 Unprocessable Entity} (WebDAV - RFC 2518) */
+ public static final int SC_UNPROCESSABLE_ENTITY = 422;
+
+ /** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */
+ int SC_INTERNAL_SERVER_ERROR = 500;
+
+}
\ No newline at end of file
diff --git a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
index 551ba91..e11f0fa 100644
--- a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
+++ b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
@@ -21,7 +21,6 @@ package de.kosit.validationtool.impl;
import static de.kosit.validationtool.impl.DateFactory.createTimestamp;
-import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -103,7 +102,7 @@ public class DefaultCheck implements Check {
return type;
}
- protected boolean isSuccessful(final Map results) {
+ protected boolean isSuccessful(final Map results) {
return results.entrySet().stream().allMatch(e -> e.getValue().isAcceptable());
}
diff --git a/src/test/java/de/kosit/validationtool/cmd/CheckAssertionActionTest.java b/src/test/java/de/kosit/validationtool/cmd/CheckAssertionActionTest.java
index a170d84..29e8e7c 100644
--- a/src/test/java/de/kosit/validationtool/cmd/CheckAssertionActionTest.java
+++ b/src/test/java/de/kosit/validationtool/cmd/CheckAssertionActionTest.java
@@ -53,14 +53,14 @@ public class CheckAssertionActionTest {
@Before
public void setup() throws IOException {
this.commandLine = new CommandLine();
- this.commandLine.activate();
+ CommandLine.activate();
}
@Test
public void testEmptyInput() {
final CheckAssertionAction a = new CheckAssertionAction(new Assertions(), TestObjectFactory.createProcessor());
a.check(new CheckAction.Bag(InputFactory.read(SAMPLE), new CreateReportInput()));
- assertThat(this.commandLine.getErrorOutput()).contains("Can not find assertions for");
+ assertThat(CommandLine.getErrorOutput()).contains("Can not find assertions for");
}
@Test
@@ -72,6 +72,6 @@ public class CheckAssertionActionTest {
final CheckAssertionAction a = new CheckAssertionAction(assertions, TestObjectFactory.createProcessor());
a.check(bag);
- assertThat(this.commandLine.getErrorOutput()).contains("Assertion mismatch");
+ assertThat(CommandLine.getErrorOutput()).contains("Assertion mismatch");
}
}
diff --git a/src/test/java/de/kosit/validationtool/cmd/CommandLine.java b/src/test/java/de/kosit/validationtool/cmd/CommandLine.java
index 1412124..cae55e8 100644
--- a/src/test/java/de/kosit/validationtool/cmd/CommandLine.java
+++ b/src/test/java/de/kosit/validationtool/cmd/CommandLine.java
@@ -19,7 +19,14 @@
package de.kosit.validationtool.cmd;
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.io.Reader;
import java.util.List;
import org.apache.commons.io.IOUtils;
@@ -35,23 +42,85 @@ import lombok.Setter;
*/
public class CommandLine {
- private static ReplaceableOutputStream out = new ReplaceableOutputStream<>();
+ /**
+ * Simpler Proxy für {@link OutputStream}, dessen target ausgetauscht werden kann.
+ *
+ * @param Typ des eigentlichen {@link OutputStream}
+ */
+ private static class ReplaceableOutputStream extends OutputStream {
- private static ReplaceableOutputStream error = new ReplaceableOutputStream<>();
+ @Getter
+ @Setter
+ private O out;
+
+ @Override
+ public void write(final int idx) throws IOException {
+ if (this.out != null) {
+ this.out.write(idx);
+ }
+ }
+
+ @Override
+ public void write(final byte[] bts) throws IOException {
+ if (this.out != null) {
+ this.out.write(bts);
+ }
+ }
+
+ @Override
+ public void write(final byte[] bts, final int st, final int end) throws IOException {
+ if (this.out != null) {
+ this.out.write(bts, st, end);
+ }
+ }
+
+ @Override
+ public void flush() throws IOException {
+
+ if (this.out != null) {
+ this.out.flush();
+ }
+ }
+
+ @Override
+ public void close() throws IOException {
+ if (this.out != null) {
+ this.out.close();
+ }
+ }
+ }
+
+ private static final ReplaceableOutputStream out = new ReplaceableOutputStream<>();
+
+ private static final ReplaceableOutputStream error = new ReplaceableOutputStream<>();
static {
// Initialisierung muss vor SL4J's SimpleLogger erfolgen, sonst sind logs nicht erfasst.
// deshalb darf diese Klasse kein Log haben
System.setOut(new PrintStream(new TeeOutputStream(System.out, out)));
System.setErr(new PrintStream(new TeeOutputStream(System.err, error)));
+ setStandardInput(nullInputStream());
}
- public String getOutput() {
+ public static void setStandardInput(final InputStream in) {
+ System.setIn(in);
+ }
+
+ public static InputStream nullInputStream() {
+ return new InputStream() {
+
+ @Override
+ public int read() throws IOException {
+ return 0;
+ }
+ };
+ }
+
+ public static String getOutput() {
return new String(out.getOut().toByteArray());
}
-
- public String getErrorOutput() {
+ public static String getErrorOutput() {
return new String(error.getOut().toByteArray());
}
@@ -63,68 +132,26 @@ public class CommandLine {
return readLines(error.getOut().toByteArray());
}
- private List readLines(byte[] bytes) {
- try ( ByteArrayInputStream in = new ByteArrayInputStream(bytes);
- Reader r = new InputStreamReader(in) ) {
+ private List readLines(final byte[] bytes) {
+ try ( final ByteArrayInputStream in = new ByteArrayInputStream(bytes);
+ final Reader r = new InputStreamReader(in) ) {
return IOUtils.readLines(r);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new IllegalStateException("Can not read input");
}
}
- public void activate() {
+ public static void activate() {
out.setOut(new ByteArrayOutputStream());
error.setOut(new ByteArrayOutputStream());
}
- public void deactivate() {
+ public static void deactivate() {
out.setOut(null);
error.setOut(null);
- }
-
- /**
- * Simpler Proxy für {@link OutputStream}, dessen target ausgetauscht werden kann.
- *
- * @param Typ des eigentlichen {@link OutputStream}
- */
- private static class ReplaceableOutputStream extends OutputStream {
-
- @Getter
- @Setter
- private O out;
-
- public void write(int idx) throws IOException {
- if (out != null) {
- this.out.write(idx);
- }
- }
-
- public void write(byte[] bts) throws IOException {
- if (out != null) {
- this.out.write(bts);
- }
- }
-
- public void write(byte[] bts, int st, int end) throws IOException {
- if (out != null) {
- this.out.write(bts, st, end);
- }
- }
-
- public void flush() throws IOException {
-
- if (out != null) {
- this.out.flush();
- }
- }
-
- public void close() throws IOException {
- if (out != null) {
- this.out.close();
- }
- }
+ setStandardInput(nullInputStream());
}
}
diff --git a/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java b/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java
index 1fe995b..285a059 100644
--- a/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java
+++ b/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java
@@ -56,7 +56,7 @@ public class CommandlineApplicationTest {
@Before
public void setup() throws IOException {
this.commandLine = new CommandLine();
- this.commandLine.activate();
+ CommandLine.activate();
if (Files.exists(this.output)) {
FileUtils.deleteDirectory(this.output.toFile());
}
@@ -71,13 +71,14 @@ public class CommandlineApplicationTest {
log.error("Error deleting file", e);
}
});
+ CommandLine.deactivate();
}
@Test
public void testHelp() {
final String[] args = new String[] { "-?" };
CommandLineApplication.mainProgram(args);
- assertThat(this.commandLine.getErrorOutput()).isEmpty();
+ assertThat(CommandLine.getErrorOutput()).isEmpty();
checkForHelp(this.commandLine.getOutputLines());
}
@@ -90,24 +91,24 @@ public class CommandlineApplicationTest {
public void testRequiredScenarioFile() {
final String[] args = new String[] { "-d", "arguments", "egal welche", "argument drin sind" };
CommandLineApplication.mainProgram(args);
- assertThat(this.commandLine.getErrorOutput()).isNotEmpty();
- assertThat(this.commandLine.getErrorOutput()).contains("Missing required option: s");
+ assertThat(CommandLine.getErrorOutput()).isNotEmpty();
+ assertThat(CommandLine.getErrorOutput()).contains("Missing required option: s");
}
@Test
public void testNotExistingScenarioFile() {
final String[] args = new String[] { "-s", Paths.get(Simple.NOT_EXISTING).toString(), Paths.get(Simple.NOT_EXISTING).toString() };
CommandLineApplication.mainProgram(args);
- assertThat(this.commandLine.getErrorOutput()).isNotEmpty();
- assertThat(this.commandLine.getErrorOutput()).contains("Not a valid path for scenario definition specified");
+ assertThat(CommandLine.getErrorOutput()).isNotEmpty();
+ assertThat(CommandLine.getErrorOutput()).contains("Not a valid path for scenario definition specified");
}
@Test
public void testIncorrectRepository() {
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), Paths.get(Simple.NOT_EXISTING).toString() };
CommandLineApplication.mainProgram(args);
- assertThat(this.commandLine.getErrorOutput()).isNotEmpty();
- assertThat(this.commandLine.getErrorOutput()).contains("Can not resolve");
+ assertThat(CommandLine.getErrorOutput()).isNotEmpty();
+ assertThat(CommandLine.getErrorOutput()).contains("Can not resolve");
}
@Test
@@ -115,8 +116,8 @@ public class CommandlineApplicationTest {
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r",
Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.NOT_EXISTING).toString() };
CommandLineApplication.mainProgram(args);
- assertThat(this.commandLine.getErrorOutput()).isNotEmpty();
- assertThat(this.commandLine.getErrorOutput()).contains("No test targets found");
+ assertThat(CommandLine.getErrorOutput()).isNotEmpty();
+ assertThat(CommandLine.getErrorOutput()).contains("No test targets found");
}
@Test
@@ -124,7 +125,7 @@ public class CommandlineApplicationTest {
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r",
Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
- assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
+ assertThat(CommandLine.getErrorOutput()).contains(RESULT_OUTPUT);
}
@Test
@@ -133,8 +134,8 @@ public class CommandlineApplicationTest {
Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.SIMPLE_VALID).toString(), "--report-prefix", "somePrefix",
"--report-postfix", "somePostfix" };
CommandLineApplication.mainProgram(args);
- assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
- assertThat(this.commandLine.getErrorOutput()).contains("somePrefix-simple-somePostfix");
+ assertThat(CommandLine.getErrorOutput()).contains(RESULT_OUTPUT);
+ assertThat(CommandLine.getErrorOutput()).contains("somePrefix-simple-somePostfix");
}
@Test
@@ -142,7 +143,7 @@ public class CommandlineApplicationTest {
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-o", this.output.toString(), "-r",
Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.SIMPLE_VALID).toString(), Paths.get(Simple.FOO).toString() };
CommandLineApplication.mainProgram(args);
- assertThat(this.commandLine.getErrorOutput()).contains("Processing 2 object(s) completed");
+ assertThat(CommandLine.getErrorOutput()).contains("Processing 2 object(s) completed");
}
@Test
@@ -150,7 +151,7 @@ public class CommandlineApplicationTest {
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-o", this.output.toString(), "-r",
Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.EXAMPLES).toString() };
CommandLineApplication.mainProgram(args);
- assertThat(this.commandLine.getErrorOutput()).contains("Processing 8 object(s) completed");
+ assertThat(CommandLine.getErrorOutput()).contains("Processing 8 object(s) completed");
}
@Test
@@ -159,7 +160,7 @@ public class CommandlineApplicationTest {
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-o", this.output.toString(), "-r",
Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
- assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
+ assertThat(CommandLine.getErrorOutput()).contains(RESULT_OUTPUT);
assertThat(this.output).exists();
assertThat(Files.list(this.output)).hasSize(1);
}
@@ -179,7 +180,7 @@ public class CommandlineApplicationTest {
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-p", "-r",
Paths.get(Simple.REPOSITORY_URI).toString(), "-o", this.output.toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
- assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
+ assertThat(CommandLine.getErrorOutput()).contains(RESULT_OUTPUT);
assertThat(this.commandLine.getOutputLines()).haveAtLeastOne(new Condition<>(
s -> StringUtils.contains(s, ""), "Must " + "contain xml preambel"));
}
@@ -190,7 +191,7 @@ public class CommandlineApplicationTest {
this.output.toAbsolutePath().toString(), "-r", Paths.get(Simple.REPOSITORY_URI).toString(),
Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
- assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
+ assertThat(CommandLine.getErrorOutput()).contains(RESULT_OUTPUT);
assertThat(Files.list(this.output).filter(f -> f.toString().endsWith(".html")).count()).isGreaterThan(0);
}
@@ -200,8 +201,8 @@ public class CommandlineApplicationTest {
Paths.get(Simple.REPOSITORY_URI).toString(), "-o", this.output.toString(), "-c", Paths.get(ASSERTIONS).toString(),
Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
- assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
- assertThat(this.commandLine.getErrorOutput()).contains("Can not find assertions for ");
+ assertThat(CommandLine.getErrorOutput()).contains(RESULT_OUTPUT);
+ assertThat(CommandLine.getErrorOutput()).contains("Can not find assertions for ");
}
@Test
@@ -209,7 +210,7 @@ public class CommandlineApplicationTest {
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", "unknown", "-o", this.output.toString(),
"-d", Paths.get(ASSERTIONS).toString() };
CommandLineApplication.mainProgram(args);
- assertThat(this.commandLine.getErrorOutput()).contains("at de.kosit.validationtool");
+ assertThat(CommandLine.getErrorOutput()).contains("at de.kosit.validationtool");
}
@Test
@@ -217,7 +218,16 @@ public class CommandlineApplicationTest {
final String[] args = new String[] { "-m", "-s", Paths.get(Simple.SCENARIOS).toString(), "-r",
Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
- assertThat(this.commandLine.getErrorOutput()).contains(RESULT_OUTPUT);
- assertThat(this.commandLine.getErrorOutput()).contains("total");
+ assertThat(CommandLine.getErrorOutput()).contains(RESULT_OUTPUT);
+ assertThat(CommandLine.getErrorOutput()).contains("total");
+ }
+
+ @Test
+ public void testReadFromPipe() throws IOException {
+ final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r",
+ Paths.get(Simple.REPOSITORY_URI).toString() };
+ CommandLine.setStandardInput(Files.newInputStream(Paths.get(Simple.SIMPLE_VALID)));
+ CommandLineApplication.mainProgram(args);
+ assertThat(CommandLine.getErrorOutput()).contains(RESULT_OUTPUT);
}
}
diff --git a/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java b/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java
index 303eff1..b5b614d 100644
--- a/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java
+++ b/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java
@@ -46,13 +46,13 @@ public class PrintReportActionTest {
@Before
public void setup() {
this.commandLine = new CommandLine();
- this.commandLine.activate();
+ CommandLine.activate();
this.action = new PrintReportAction(TestObjectFactory.createProcessor());
}
@After
public void tearDown() {
- this.commandLine.deactivate();
+ CommandLine.deactivate();
}
@Test
@@ -62,9 +62,9 @@ public class PrintReportActionTest {
assertThat(this.action.isSkipped(b)).isFalse();
this.action.check(b);
assertThat(b.isStopped()).isFalse();
- assertThat(this.commandLine.getOutput()).isNotEmpty();
- assertThat(this.commandLine.getOutput()).contains("
Date: Thu, 3 Sep 2020 06:02:42 +0000
Subject: [PATCH 027/210] Resolve "Force formatting"
---
.idea/eclipseCodeFormatter.xml | 3 +-
.idea/misc.xml | 5 +-
.settings/org.eclipse.jdt.core.prefs | 422 ------------------
docs/contribute.md | 11 +-
formatter.xml | 366 +++++++++++++++
pom.xml | 45 ++
.../api/AcceptRecommendation.java | 2 +-
.../de/kosit/validationtool/api/Check.java | 6 +-
.../api/CheckConfiguration.java | 4 -
.../validationtool/api/Configuration.java | 4 +-
.../validationtool/api/InputFactory.java | 25 +-
.../api/ResolvingConfigurationStrategy.java | 15 +-
.../de/kosit/validationtool/api/Result.java | 7 +-
.../cmd/CheckAssertionAction.java | 1 -
.../cmd/CommandLineOptions.java | 18 +
.../kosit/validationtool/cmd/Validator.java | 1 -
.../kosit/validationtool/cmd/report/Grid.java | 2 -
.../config/ConfigurationLoader.java | 4 +-
.../config/FallbackBuilder.java | 12 +-
.../de/kosit/validationtool/config/Keys.java | 5 +-
.../validationtool/config/ReportBuilder.java | 12 +-
.../config/ScenarioBuilder.java | 4 +-
.../config/SchematronBuilder.java | 12 +-
.../validationtool/daemon/BaseHandler.java | 1 -
.../validationtool/daemon/CheckHandler.java | 4 +-
.../validationtool/daemon/ConfigHandler.java | 2 +-
.../kosit/validationtool/daemon/Daemon.java | 1 -
.../validationtool/daemon/GuiHandler.java | 15 +-
.../impl/ConversionService.java | 4 +-
.../validationtool/impl/DateFactory.java | 6 +-
.../impl/EngineInformation.java | 2 -
.../impl/ScenarioRepository.java | 3 +-
.../impl/tasks/CheckAction.java | 6 +-
.../impl/tasks/CreateReportAction.java | 5 +-
.../impl/tasks/SchemaValidationAction.java | 1 -
.../impl/xml/RelativeUriResolver.java | 1 -
.../cmd/ExtractHtmlActionTest.java | 1 -
.../cmd/PrintReportActionTest.java | 1 -
.../cmd/SerializeReportActionTest.java | 5 +-
.../config/SimpleConfigTest.java | 3 -
.../validationtool/daemon/GuiHandlerIT.java | 5 +-
.../tasks/ComputeAcceptanceActionTest.java | 2 +-
.../impl/tasks/CreateReportActionTest.java | 1 -
.../impl/tasks/TestBagBuilder.java | 14 +-
.../impl/xml/SaxonSecurityTest.java | 4 +-
45 files changed, 535 insertions(+), 538 deletions(-)
delete mode 100644 .settings/org.eclipse.jdt.core.prefs
create mode 100644 formatter.xml
diff --git a/.idea/eclipseCodeFormatter.xml b/.idea/eclipseCodeFormatter.xml
index 680c7c6..a63598c 100644
--- a/.idea/eclipseCodeFormatter.xml
+++ b/.idea/eclipseCodeFormatter.xml
@@ -8,7 +8,8 @@
-
+
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
index c874577..241632b 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -4,6 +4,9 @@
+
+
+
@@ -79,7 +82,7 @@
-
+
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 661b86d..0000000
--- a/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,422 +0,0 @@
-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.enablePreviewFeatures=disabled
-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.reportPreviewFeatures=ignore
-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=enabled
-org.eclipse.jdt.core.compiler.release=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/docs/contribute.md b/docs/contribute.md
index 76d0d95..0bf56f0 100644
--- a/docs/contribute.md
+++ b/docs/contribute.md
@@ -22,9 +22,14 @@ For other IDEs the correct setup is up to you.
We use an automatic formatting of the source code in our environment. This is based on the Eclipse code formatter functionality
due to historical reasons. This not only works in Eclipse but also in IntelliJ (via plugin) and can be used standalone.
-The configuration can be found in `.settings`-directory. For IntelliJ this is all set up. Additionally this should work in Eclipse out of the box.
-Another potential usage scenario would be to integrate the formatter via git hooks into the commit-pipeline (e.g [Example Hook](https://gist.github.com/ktoso/708972) ).
-For other IDEs you are on your own.
+The configuration can be found in `.settings`-directory. For IntelliJ this is all set up. The correct formatting is validated as part of the build
+process. If your IDE does not support the eclipse formatter, your can run the maven build locally prior commit like this:
+
+```shell script
+mvn package -Pformat
+```
+
+This will format all changed files according to our rules. Afterwards your can commit and push your changes.
## Build
diff --git a/formatter.xml b/formatter.xml
new file mode 100644
index 0000000..1623387
--- /dev/null
+++ b/formatter.xml
@@ -0,0 +1,366 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pom.xml b/pom.xml
index b290a51..2fc00c3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -504,9 +504,54 @@
+
+ net.revelc.code.formatter
+ formatter-maven-plugin
+ 2.12.2
+
+
+ validate
+ generate-sources
+
+ validate
+
+
+
+
+ ${project.basedir}/formatter.xml
+
+
+
+
+ format
+ false
+
+
+
+ net.revelc.code.formatter
+ formatter-maven-plugin
+ 2.12.2
+
+
+ maven-formatting
+ initialize
+
+ format
+
+
+
+
+ ${project.basedir}/formatter.xml
+
+
+
+
+
+
+
diff --git a/src/main/java/de/kosit/validationtool/api/AcceptRecommendation.java b/src/main/java/de/kosit/validationtool/api/AcceptRecommendation.java
index 479733d..f330280 100644
--- a/src/main/java/de/kosit/validationtool/api/AcceptRecommendation.java
+++ b/src/main/java/de/kosit/validationtool/api/AcceptRecommendation.java
@@ -16,7 +16,7 @@ public enum AcceptRecommendation {
ACCEPTABLE,
/**
- * Recommendation is to reject {@link Input} based on the evaluation of the overall validation.
+ * Recommendation is to reject {@link Input} based on the evaluation of the overall validation.
*/
REJECT
}
diff --git a/src/main/java/de/kosit/validationtool/api/Check.java b/src/main/java/de/kosit/validationtool/api/Check.java
index dd0e6cf..9eadf53 100644
--- a/src/main/java/de/kosit/validationtool/api/Check.java
+++ b/src/main/java/de/kosit/validationtool/api/Check.java
@@ -24,7 +24,6 @@ import java.util.stream.Collectors;
import org.w3c.dom.Document;
-
/**
* Main validator interface for checking incoming files.
*
@@ -33,8 +32,8 @@ import org.w3c.dom.Document;
public interface Check {
/**
- * Checks an incoming xml {@link Input Inputs}. The result-{@link Document} is readonly. To change the this document you
- * need to copy the nodes into an new {@link Document}.
+ * Checks an incoming xml {@link Input Inputs}. The result-{@link Document} is readonly. To change the this document
+ * you need to copy the nodes into an new {@link Document}.
*
* @param input the resource / xml file to validate.
* @return a result-{@link Document} (readonly)
@@ -75,5 +74,4 @@ public interface Check {
return input.stream().map(this::checkInput).collect(Collectors.toList());
}
-
}
diff --git a/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java b/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java
index 185ad26..45a530e 100644
--- a/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java
+++ b/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java
@@ -54,8 +54,6 @@ public class CheckConfiguration implements Configuration {
*/
private URI scenarioRepository;
-
-
private Configuration delegate;
private Configuration getDelegate() {
@@ -95,8 +93,6 @@ public class CheckConfiguration implements Configuration {
return getDelegate().getAuthor();
}
-
-
@Override
public ContentRepository getContentRepository() {
return getDelegate().getContentRepository();
diff --git a/src/main/java/de/kosit/validationtool/api/Configuration.java b/src/main/java/de/kosit/validationtool/api/Configuration.java
index 9aa6f70..6194c48 100644
--- a/src/main/java/de/kosit/validationtool/api/Configuration.java
+++ b/src/main/java/de/kosit/validationtool/api/Configuration.java
@@ -62,8 +62,8 @@ public interface Configuration {
String getDate();
/**
- * Add some additional parameters to the validator configuration. Parameter usage depends on actual implementation of
- * {@link Check}
+ * Add some additional parameters to the validator configuration. Parameter usage depends on actual implementation
+ * of {@link Check}
*
* @return
*/
diff --git a/src/main/java/de/kosit/validationtool/api/InputFactory.java b/src/main/java/de/kosit/validationtool/api/InputFactory.java
index 93bede4..113be10 100644
--- a/src/main/java/de/kosit/validationtool/api/InputFactory.java
+++ b/src/main/java/de/kosit/validationtool/api/InputFactory.java
@@ -79,8 +79,8 @@ public class InputFactory {
}
/**
- * Liest einen Prüfling von dem übergebenen Pfad. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der Prüfsumme
- * genutzt.
+ * Liest einen Prüfling von dem übergebenen Pfad. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der
+ * Prüfsumme genutzt.
*
* @param path der Prüflings
* @return ein Prüf-Eingabe-Objekt
@@ -114,8 +114,8 @@ public class InputFactory {
}
/**
- * Liest einen Prüfling von der übergebenen URI. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der Prüfsumme
- * genutzt.
+ * Liest einen Prüfling von der übergebenen URI. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der
+ * Prüfsumme genutzt.
*
* @param uri URI des Prüflings
* @return ein Prüf-Eingabe-Objekt
@@ -141,8 +141,8 @@ public class InputFactory {
}
/**
- * Liest einen Prüfling von der übergebenen URL. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der Prüfsumme
- * genutzt.
+ * Liest einen Prüfling von der übergebenen URL. Es wird der Default-Prüfsummenalgorithmus zur Ermittlung der
+ * Prüfsumme genutzt.
*
* @param url URL des Prüflings
* @return ein Prüf-Eingabe-Objekt
@@ -173,8 +173,9 @@ public class InputFactory {
}
/**
- * Reads a test document from a {@link Source}. Note: computing the hashcode is only supported for {@link StreamSource}.
- * You can not directly use other {@link Source Soures}. You need to supply the hashcode for identification then.
+ * Reads a test document from a {@link Source}. Note: computing the hashcode is only supported for
+ * {@link StreamSource}. You can not directly use other {@link Source Soures}. You need to supply the hashcode for
+ * identification then.
*
* @param source source
* @return an {@link Input}
@@ -190,8 +191,8 @@ public class InputFactory {
/**
* Reads a test document from a {@link Source} using a specified digest algorithm.
*
- * Note: computing the hashcode is only supported for {@link StreamSource}. You can not directly use other {@link Source
- * Soures}. You need to supply the hashcode for identification then.
+ * Note: computing the hashcode is only supported for {@link StreamSource}. You can not directly use other
+ * {@link Source Soures}. You need to supply the hashcode for identification then.
*
* @param source source
* @param name the digest algorithm
@@ -304,8 +305,8 @@ public class InputFactory {
}
/**
- * Reads a saxon {@link XdmNode} with a given name. Hashcode identification is based on the name of the supplied input.
- * Now real hashcode is computed.
+ * Reads a saxon {@link XdmNode} with a given name. Hashcode identification is based on the name of the supplied
+ * input. Now real hashcode is computed.
*
* @param node the node to read
* @param name the name of the {@link Input}
diff --git a/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java b/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java
index c6fd194..7833824 100644
--- a/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java
+++ b/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java
@@ -36,8 +36,8 @@ public interface ResolvingConfigurationStrategy {
/**
* Returns a preconfigured {@link Processor Saxon Processor} for various tasks within the Validator. The validator
- * leverages the saxon s9api for internal processing e.g. xml reading and writing. So this is the main object to secure
- * for reading, transforming and writing xml files.
+ * leverages the saxon s9api for internal processing e.g. xml reading and writing. So this is the main object to
+ * secure for reading, transforming and writing xml files.
*
* Note: you need exactly one instance for all validator related processing.
*
@@ -50,8 +50,8 @@ public interface ResolvingConfigurationStrategy {
* dereferencing an absolute URI (after resolution) to return a {@link javax.xml.transform.Source}. It can be
* used for resolving relative URIs against a base URI or restrict access to certain URIs.
*
- * This URIResolver is used to dereference the URIs appearing in xsl:import, xsl:include, and
- * xsl:import-schema declarations.
+ * This URIResolver is used to dereference the URIs appearing in xsl:import, xsl:include,
+ * and xsl:import-schema declarations.
*
*
* @param scenarioRepository an optional repository, your implementation might not need this
@@ -60,7 +60,8 @@ public interface ResolvingConfigurationStrategy {
URIResolver createResolver(URI scenarioRepository);
/**
- * Creates a specific implementation for resolving objects referenced via XSLT's unparsed-text() function.
+ * Creates a specific implementation for resolving objects referenced via XSLT's unparsed-text()
+ * function.
*
* @param scenarioRepository an optional repository, your implementation might not need this
* @return a preconfigured {@link net.sf.saxon.lib.UnparsedTextURIResolver} or null for using saxons default
@@ -68,8 +69,8 @@ public interface ResolvingConfigurationStrategy {
UnparsedTextURIResolver createUnparsedTextURIResolver(URI scenarioRepository);
/**
- * Creates a preconfigured {@link Validator } instance for a given schema for xml file validation. The implementation
- * takes care about security and reference resolving strategies.
+ * Creates a preconfigured {@link Validator } instance for a given schema for xml file validation. The
+ * implementation takes care about security and reference resolving strategies.
*
* @param schema the scheme to create a {@link Validator} for
* @return a preconfigured {@link Validator}
diff --git a/src/main/java/de/kosit/validationtool/api/Result.java b/src/main/java/de/kosit/validationtool/api/Result.java
index 91617ae..af86a90 100644
--- a/src/main/java/de/kosit/validationtool/api/Result.java
+++ b/src/main/java/de/kosit/validationtool/api/Result.java
@@ -16,8 +16,8 @@ import net.sf.saxon.s9api.XdmNode;
public interface Result {
/**
- * Zeigt an, ob die Verarbeitung durch den Validator erfolgreich durchlaufen wurde. Diese Funktion macht ausdrücklich
- * keine Aussage über die zur Akzeptanz.
+ * Zeigt an, ob die Verarbeitung durch den Validator erfolgreich durchlaufen wurde. Diese Funktion macht
+ * ausdrücklich keine Aussage über die zur Akzeptanz.
*
* @return true, wenn die Verarbeitung komplett und erfolgreich durchlaufen wurde
* @see #getAcceptRecommendation()
@@ -92,7 +92,8 @@ public interface Result {
boolean isWellformed();
/**
- * Returns true, if schematron has been checked and the result does not contain any {@link FailedAssert FailedAsserts}.
+ * Returns true, if schematron has been checked and the result does not contain any {@link FailedAssert
+ * FailedAsserts}.
*
* @return true, if valid
*/
diff --git a/src/main/java/de/kosit/validationtool/cmd/CheckAssertionAction.java b/src/main/java/de/kosit/validationtool/cmd/CheckAssertionAction.java
index 79d4d24..813cf4d 100644
--- a/src/main/java/de/kosit/validationtool/cmd/CheckAssertionAction.java
+++ b/src/main/java/de/kosit/validationtool/cmd/CheckAssertionAction.java
@@ -91,7 +91,6 @@ class CheckAssertionAction implements CheckAction {
return getMapped().entrySet().stream().filter(e -> matches(e.getKey(), name)).map(Map.Entry::getValue).findFirst().orElse(null);
}
-
private boolean check(XdmNode document, AssertionType assertion) {
try {
final XPathSelector selector = createSelector(assertion);
diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java
index c7bc6d0..76ab31b 100644
--- a/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java
+++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java
@@ -9,34 +9,52 @@ import org.apache.commons.cli.Option;
public class CommandLineOptions {
static final Option HELP = Option.builder("?").longOpt("help").argName("Help").desc("Displays this help").build();
+
static final Option SCENARIOS = Option.builder("s").required().longOpt("scenarios").hasArg().desc("Location of scenarios.xml e.g.")
.build();
+
static final Option REPOSITORY = Option.builder("r").longOpt("repository").hasArg().desc("Directory containing scenario content")
.build();
+
static final Option PRINT = Option.builder("p").longOpt("print").desc("Prints the check result to stdout").build();
+
static final Option OUTPUT = Option.builder("o").longOpt("output-directory")
.desc("Defines the out directory for results. Defaults to cwd").hasArg().build();
+
static final Option EXTRACT_HTML = Option.builder("h").longOpt("html")
.desc("Extract and save any html content within result as a separate file ").build();
+
static final Option DEBUG = Option.builder("d").longOpt("debug").desc("Prints some more debug information").build();
+
static final Option SERIALIZE_REPORT_INPUT = Option.builder("c").longOpt("serialize-report-input")
.desc("Serializes the report input to the cwd").build();
+
static final Option CHECK_ASSERTIONS = Option.builder("c").longOpt("check-assertions").hasArg()
.desc("Check the result using defined assertions").argName("assertions-file").build();
+
static final Option SERVER = Option.builder("D").longOpt("daemon").desc("Starts a daemon listing for validation requests").build();
+
static final Option HOST = Option.builder("H").longOpt("host").hasArg()
.desc("The hostname / IP address to bind the daemon. Default is localhost").build();
+
static final Option PORT = Option.builder("P").longOpt("port").hasArg().desc("The port to bind the daemon. Default is 8080").build();
+
static final Option WORKER_COUNT = Option.builder("T").longOpt("threads").hasArg()
.desc("Number of threads processing validation requests").build();
+
static final Option DISABLE_GUI = Option.builder("G").longOpt("disable-gui").desc("Disables the GUI of the daemon mode").build();
+
static final Option REPORT_POSTFIX = Option.builder(null).longOpt("report-postfix").hasArg()
.desc("Postfix of the generated report name").build();
+
static final Option REPORT_PREFIX = Option.builder(null).longOpt("report-prefix").hasArg().desc("Prefix of the generated report name")
.build();
+
static final Option DEBUG_LOG = Option.builder("X").longOpt("debug-logging").desc("Enables full debug log. Alias for -l debug").build();
+
static final Option LOG_LEVEL = Option.builder("l").longOpt("log-level").hasArg()
.desc("Enables a certain log level for debugging " + "purposes").build();
+
static final Option PRINT_MEM_STATS = Option.builder("m").longOpt("memory-stats").desc("Prints some memory stats").build();
private CommandLineOptions() {
diff --git a/src/main/java/de/kosit/validationtool/cmd/Validator.java b/src/main/java/de/kosit/validationtool/cmd/Validator.java
index bd986ae..522e0c8 100644
--- a/src/main/java/de/kosit/validationtool/cmd/Validator.java
+++ b/src/main/java/de/kosit/validationtool/cmd/Validator.java
@@ -200,7 +200,6 @@ public class Validator {
return check.isSuccessful(results) ? ReturnValue.SUCCESS : ReturnValue.createFailed(check.getNotAcceptableCount(results));
}
-
private static ConfigurationLoader getConfiguration(final CommandLine cmd) {
final URI scenarioLocation = determineDefinition(cmd);
final URI repositoryLocation = determineRepository(cmd);
diff --git a/src/main/java/de/kosit/validationtool/cmd/report/Grid.java b/src/main/java/de/kosit/validationtool/cmd/report/Grid.java
index f96b7ef..cffe4ec 100644
--- a/src/main/java/de/kosit/validationtool/cmd/report/Grid.java
+++ b/src/main/java/de/kosit/validationtool/cmd/report/Grid.java
@@ -183,8 +183,6 @@ public class Grid {
return this;
}
-
-
}
private static final Format DEFAULT_FORMAT = new Format();
diff --git a/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java b/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java
index 7848c6b..5484edf 100644
--- a/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java
+++ b/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java
@@ -177,6 +177,7 @@ public class ConfigurationLoader {
/**
* Sets actual {@link ResolvingMode}, when the validator needs to resolve stuff on startup.
+ *
* @param mode the resolving mode
* @return this
*/
@@ -188,13 +189,14 @@ public class ConfigurationLoader {
return this;
}
- public ConfigurationLoader setResolvingStrategy(final ResolvingConfigurationStrategy strategy){
+ public ConfigurationLoader setResolvingStrategy(final ResolvingConfigurationStrategy strategy) {
this.resolvingConfigurationStrategy = strategy;
return this;
}
/**
* Add a parameter to the configuration.
+ *
* @param name the name of the parameter
* @param value the parameter value object
* @return this
diff --git a/src/main/java/de/kosit/validationtool/config/FallbackBuilder.java b/src/main/java/de/kosit/validationtool/config/FallbackBuilder.java
index d81b096..41998ca 100644
--- a/src/main/java/de/kosit/validationtool/config/FallbackBuilder.java
+++ b/src/main/java/de/kosit/validationtool/config/FallbackBuilder.java
@@ -48,8 +48,8 @@ public class FallbackBuilder implements Builder {
}
/**
- * Specifices a source for this report. This is either used to compile the report transformation or as documentation for
- * a precompiled tranformation.
+ * Specifices a source for this report. This is either used to compile the report transformation or as documentation
+ * for a precompiled tranformation.
*
* @param source the source
* @return this
@@ -60,8 +60,8 @@ public class FallbackBuilder implements Builder {
}
/**
- * Specifices a source for this report. This is either used to compile the report transformation or as documentation for
- * a precompiled tranformation.
+ * Specifices a source for this report. This is either used to compile the report transformation or as documentation
+ * for a precompiled tranformation.
*
* @param source the source
* @return this
@@ -72,8 +72,8 @@ public class FallbackBuilder implements Builder {
}
/**
- * Specifices a source for this report. This is either used to compile the report transformation or as documentation for
- * a precompiled tranformation.
+ * Specifices a source for this report. This is either used to compile the report transformation or as documentation
+ * for a precompiled tranformation.
*
* @param source the source
* @return this
diff --git a/src/main/java/de/kosit/validationtool/config/Keys.java b/src/main/java/de/kosit/validationtool/config/Keys.java
index bd37c5c..3efb187 100644
--- a/src/main/java/de/kosit/validationtool/config/Keys.java
+++ b/src/main/java/de/kosit/validationtool/config/Keys.java
@@ -11,9 +11,10 @@ public final class Keys {
* The actual scenarios file location as used with {@link ConfigurationLoader}.
*/
public static final String SCENARIOS_FILE = "scenarios_file";
+
/**
- * The actual scenarios configuration represented as serializable tree. This either loaded from file or build manually
- * via {@link ConfigurationBuilder}
+ * The actual scenarios configuration represented as serializable tree. This either loaded from file or build
+ * manually via {@link ConfigurationBuilder}
*/
public static final String SCENARIO_DEFINITION = "scenario_definition";
diff --git a/src/main/java/de/kosit/validationtool/config/ReportBuilder.java b/src/main/java/de/kosit/validationtool/config/ReportBuilder.java
index b512877..2c840f9 100644
--- a/src/main/java/de/kosit/validationtool/config/ReportBuilder.java
+++ b/src/main/java/de/kosit/validationtool/config/ReportBuilder.java
@@ -70,8 +70,8 @@ public class ReportBuilder implements Builder {
/**
* Add description for this scenario. This is part of the
- * {@link de.kosit.validationtool.model.reportInput.CreateReportInput} configuration and can be used while creating the
- * report
+ * {@link de.kosit.validationtool.model.reportInput.CreateReportInput} configuration and can be used while creating
+ * the report
*
* @param description the description
* @return this
diff --git a/src/main/java/de/kosit/validationtool/config/SchematronBuilder.java b/src/main/java/de/kosit/validationtool/config/SchematronBuilder.java
index 73c187b..23f959b 100644
--- a/src/main/java/de/kosit/validationtool/config/SchematronBuilder.java
+++ b/src/main/java/de/kosit/validationtool/config/SchematronBuilder.java
@@ -70,8 +70,8 @@ public class SchematronBuilder implements Builderpath.toUpperCase().endsWith("."+e.name())).findFirst().orElse(Mediatype.MD);
+ return Arrays.stream(values()).filter(e -> path.toUpperCase().endsWith("." + e.name())).findFirst().orElse(Mediatype.MD);
}
}
}
diff --git a/src/main/java/de/kosit/validationtool/impl/ConversionService.java b/src/main/java/de/kosit/validationtool/impl/ConversionService.java
index 5a362bf..2370f80 100644
--- a/src/main/java/de/kosit/validationtool/impl/ConversionService.java
+++ b/src/main/java/de/kosit/validationtool/impl/ConversionService.java
@@ -81,6 +81,7 @@ public class ConversionService {
}
private static final int MAX_LOG_CONTENT = 50;
+
// context setup
private JAXBContext jaxbContext;
@@ -233,9 +234,6 @@ public class ConversionService {
}
}
-
-
-
public T readDocument(final Source source, final Class type) {
try {
final Unmarshaller u = getJaxbContext().createUnmarshaller();
diff --git a/src/main/java/de/kosit/validationtool/impl/DateFactory.java b/src/main/java/de/kosit/validationtool/impl/DateFactory.java
index 0c9fe9a..6abd95c 100644
--- a/src/main/java/de/kosit/validationtool/impl/DateFactory.java
+++ b/src/main/java/de/kosit/validationtool/impl/DateFactory.java
@@ -19,9 +19,9 @@ public class DateFactory {
@SneakyThrows
public static XMLGregorianCalendar createTimestamp() {
- final GregorianCalendar cal = new GregorianCalendar();
- cal.setTime(new Date());
- return DatatypeFactory.newInstance().newXMLGregorianCalendar(cal);
+ final GregorianCalendar cal = new GregorianCalendar();
+ cal.setTime(new Date());
+ return DatatypeFactory.newInstance().newXMLGregorianCalendar(cal);
}
}
diff --git a/src/main/java/de/kosit/validationtool/impl/EngineInformation.java b/src/main/java/de/kosit/validationtool/impl/EngineInformation.java
index d781f94..85a51ad 100644
--- a/src/main/java/de/kosit/validationtool/impl/EngineInformation.java
+++ b/src/main/java/de/kosit/validationtool/impl/EngineInformation.java
@@ -1,7 +1,5 @@
package de.kosit.validationtool.impl;
-import lombok.SneakyThrows;
-
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
diff --git a/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java b/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java
index a8ddc26..522be56 100644
--- a/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java
+++ b/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java
@@ -74,8 +74,7 @@ public class ScenarioRepository {
*/
public Result selectScenario(final XdmNode document) {
final Result result;
- final List collect = getScenarios().stream().filter(s -> match(document, s))
- .collect(Collectors.toList());
+ final List collect = getScenarios().stream().filter(s -> match(document, s)).collect(Collectors.toList());
if (collect.size() == 1) {
result = new Result<>(collect.get(0));
} else if (collect.isEmpty()) {
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 1973a5b..cae816f 100644
--- a/src/main/java/de/kosit/validationtool/impl/tasks/CheckAction.java
+++ b/src/main/java/de/kosit/validationtool/impl/tasks/CheckAction.java
@@ -125,9 +125,9 @@ public interface CheckAction {
void check(Bag results);
/**
- * Ermittlung, ob ein Schritt u.U. ausgelassen werden kann. Die Funktion wird vor der eigentlichen Prüfaktion aufgerufen
- * und kann somit eine Ausführung des Prüfschrittes verhindern. Entwickler können diese Funktion überschreiben, um den
- * Prüfschritt bedingt auszuführen.
+ * Ermittlung, ob ein Schritt u.U. ausgelassen werden kann. Die Funktion wird vor der eigentlichen Prüfaktion
+ * aufgerufen und kann somit eine Ausführung des Prüfschrittes verhindern. Entwickler können diese Funktion
+ * überschreiben, um den Prüfschritt bedingt auszuführen.
*
* @param results die bisher gesammelten Information
* @return true wenn der Schritt ausgelassen werden soll
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 83e9554..7e49f76 100644
--- a/src/main/java/de/kosit/validationtool/impl/tasks/CreateReportAction.java
+++ b/src/main/java/de/kosit/validationtool/impl/tasks/CreateReportAction.java
@@ -70,8 +70,9 @@ import net.sf.saxon.s9api.XsltTransformer;
public class CreateReportAction implements CheckAction {
/**
- * Wrapper to fix some inconsistencies between sax and saxon. Saxon tries to set some properties which has no effect on
- * {@link JAXBSource}'s XMLReader, but it throws exceptions on unknown properties. This just drops this exceptions.
+ * Wrapper to fix some inconsistencies between sax and saxon. Saxon tries to set some properties which has no effect
+ * on {@link JAXBSource}'s XMLReader, but it throws exceptions on unknown properties. This just drops this
+ * exceptions.
*/
private static class ReaderWrapper implements XMLReader {
diff --git a/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java b/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java
index 22cca81..6337641 100644
--- a/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java
+++ b/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java
@@ -103,7 +103,6 @@ public class SchemaValidationAction implements CheckAction {
private static class FileSerializedDocument implements SerializedDocument {
-
private final Path file;
private final Processor processor;
diff --git a/src/main/java/de/kosit/validationtool/impl/xml/RelativeUriResolver.java b/src/main/java/de/kosit/validationtool/impl/xml/RelativeUriResolver.java
index 5c5d3b0..19c9828 100644
--- a/src/main/java/de/kosit/validationtool/impl/xml/RelativeUriResolver.java
+++ b/src/main/java/de/kosit/validationtool/impl/xml/RelativeUriResolver.java
@@ -105,5 +105,4 @@ public class RelativeUriResolver implements URIResolver, UnparsedTextURIResolver
}
}
-
}
\ No newline at end of file
diff --git a/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java b/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java
index b392d27..7b8ccc7 100644
--- a/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java
+++ b/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java
@@ -44,7 +44,6 @@ import de.kosit.validationtool.impl.tasks.CheckAction;
*/
public class ExtractHtmlActionTest {
-
private ExtractHtmlContentAction action;
private Path tmpDirectory;
diff --git a/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java b/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java
index b5b614d..5f0319c 100644
--- a/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java
+++ b/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java
@@ -38,7 +38,6 @@ import de.kosit.validationtool.impl.tasks.CheckAction;
*/
public class PrintReportActionTest {
-
private CommandLine commandLine;
private PrintReportAction action;
diff --git a/src/test/java/de/kosit/validationtool/cmd/SerializeReportActionTest.java b/src/test/java/de/kosit/validationtool/cmd/SerializeReportActionTest.java
index c35d23b..5bb7994 100644
--- a/src/test/java/de/kosit/validationtool/cmd/SerializeReportActionTest.java
+++ b/src/test/java/de/kosit/validationtool/cmd/SerializeReportActionTest.java
@@ -42,7 +42,6 @@ import de.kosit.validationtool.impl.tasks.CheckAction;
*/
public class SerializeReportActionTest {
-
private Path tmpDirectory;
private SerializeReportAction action;
@@ -70,9 +69,9 @@ public class SerializeReportActionTest {
assertThat(this.tmpDirectory.toFile().listFiles()).hasSize(1);
}
- //ERPT-83
+ // ERPT-83
@Test
- public void testName(){
+ public void testName() {
final String name = "some.name.with.dots";
final CheckAction.Bag b = new CheckAction.Bag(InputFactory.read("ega".getBytes(), name + ".xml"));
assertThat(b.getName()).isEqualTo(name);
diff --git a/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java b/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java
index 8db79ad..f03d2fd 100644
--- a/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java
+++ b/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java
@@ -26,7 +26,4 @@ public class SimpleConfigTest {
assertThat(result).isNotNull();
}
-
-
-
}
diff --git a/src/test/java/de/kosit/validationtool/daemon/GuiHandlerIT.java b/src/test/java/de/kosit/validationtool/daemon/GuiHandlerIT.java
index bd62201..3d7501c 100644
--- a/src/test/java/de/kosit/validationtool/daemon/GuiHandlerIT.java
+++ b/src/test/java/de/kosit/validationtool/daemon/GuiHandlerIT.java
@@ -1,9 +1,10 @@
package de.kosit.validationtool.daemon;
-import io.restassured.http.ContentType;
+import static io.restassured.RestAssured.given;
+
import org.junit.Test;
-import static io.restassured.RestAssured.given;
+import io.restassured.http.ContentType;
public class GuiHandlerIT extends BaseIT {
diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java b/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java
index 3bb04b2..4621ea6 100644
--- a/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java
@@ -23,6 +23,7 @@ import net.sf.saxon.s9api.XPathExecutable;
public class ComputeAcceptanceActionTest {
private static final String DOESNOT_EXIST = "count(//doesnotExist) = 0";
+
private final ComputeAcceptanceAction action = new ComputeAcceptanceAction();
@Test
@@ -103,7 +104,6 @@ public class ComputeAcceptanceActionTest {
assertThat(bag.getAcceptStatus()).isEqualTo(AcceptRecommendation.REJECT);
}
-
private static XPathExecutable createXpath(final String expression) {
return new ContentRepository(ResolvingMode.STRICT_RELATIVE.getStrategy(), null).createXPath(expression, new HashMap<>());
}
diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java b/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java
index 6425366..5cb73f6 100644
--- a/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java
@@ -35,7 +35,6 @@ public class CreateReportActionTest {
private ContentRepository repository;
-
@Before
public void setup() {
this.repository = Simple.createContentRepository();
diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java b/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java
index 716023f..f8d0c37 100644
--- a/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java
+++ b/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java
@@ -57,13 +57,13 @@ public class TestBagBuilder {
private static Scenario createScenario(final URI schemafile) {
try {
- final ScenarioType t = new ScenarioType();
- final ValidateWithXmlSchema v = new ValidateWithXmlSchema();
- final ResourceType r = new ResourceType();
- r.setLocation(schemafile.getRawPath());
- r.setName("invoice");
- v.getResource().add(r);
- t.setValidateWithXmlSchema(v);
+ final ScenarioType t = new ScenarioType();
+ final ValidateWithXmlSchema v = new ValidateWithXmlSchema();
+ final ResourceType r = new ResourceType();
+ r.setLocation(schemafile.getRawPath());
+ r.setName("invoice");
+ v.getResource().add(r);
+ t.setValidateWithXmlSchema(v);
final Scenario scenario = new Scenario(t);
scenario.setSchema(createSchema(schemafile.toURL()));
return scenario;
diff --git a/src/test/java/de/kosit/validationtool/impl/xml/SaxonSecurityTest.java b/src/test/java/de/kosit/validationtool/impl/xml/SaxonSecurityTest.java
index 0a63475..b254022 100644
--- a/src/test/java/de/kosit/validationtool/impl/xml/SaxonSecurityTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/xml/SaxonSecurityTest.java
@@ -49,7 +49,6 @@ import net.sf.saxon.s9api.XsltCompiler;
import net.sf.saxon.s9api.XsltExecutable;
import net.sf.saxon.s9api.XsltTransformer;
-
/**
* Testet verschiedene Saxon Security Einstellungen.
*
@@ -77,7 +76,8 @@ public class SaxonSecurityTest {
transformer.setDestination(result);
transformer.transform();
- // wenn der Punkt erreicht wird, sollte wenigstens, das Element evil nicht mit 'bösen' Inhalten gefüllt sein!
+ // wenn der Punkt erreicht wird, sollte wenigstens, das Element evil nicht mit 'bösen' Inhalten gefüllt
+ // sein!
if (StringUtils.isNotBlank(result.getXdmNode().getStringValue())) {
fail(String.format("Saxon configuration should prevent expansion within %s", resource));
}
From 258ecb45450bdc72a40c75bf4b524709361b8574 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Mon, 14 Sep 2020 08:14:16 +0200
Subject: [PATCH 028/210] https://github.com/itplr-kosit/validator/issues/55
Improve XSD documentation
---
src/main/model/xsd/scenarios.xsd | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/main/model/xsd/scenarios.xsd b/src/main/model/xsd/scenarios.xsd
index 2f41a1f..66a0224 100644
--- a/src/main/model/xsd/scenarios.xsd
+++ b/src/main/model/xsd/scenarios.xsd
@@ -85,9 +85,13 @@
-
-
-
+
+
+
+ Optional: An XPATH expression to be applied to a generated validation report as defined in the createReport element
+
+
+
From 3cb103777155a4d3aee059b57d45d385b7886351 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Mon, 14 Sep 2020 08:16:43 +0200
Subject: [PATCH 029/210] https://github.com/itplr-kosit/validator/issues/54
Fix reference to command line option
---
src/main/model/xsd/assertions.xsd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/model/xsd/assertions.xsd b/src/main/model/xsd/assertions.xsd
index 4a5bdcc..e7d5e73 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 --implemenation-assertions übergeben werden.
+ solches Dokument kann der Kommandozeilenversion des Prüftools über --check-assertions übergeben werden.
From 65f6914c3cf204b07a8fba778e2c6955fcbf3a50 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Fri, 2 Oct 2020 09:47:28 +0200
Subject: [PATCH 030/210] https://github.com/itplr-kosit/validator/issues/57
fix read stream
---
pom.xml | 3 +-
.../validationtool/daemon/CheckHandler.java | 30 +++++++++++++---
.../impl/input/StreamHelper.java | 36 +++++++++++++++++++
3 files changed, 64 insertions(+), 5 deletions(-)
diff --git a/pom.xml b/pom.xml
index 2fc00c3..5481c7f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -507,7 +507,7 @@
net.revelc.code.formatterformatter-maven-plugin
- 2.12.2
+ 2.13.0validate
@@ -519,6 +519,7 @@
${project.basedir}/formatter.xml
+ LF
diff --git a/src/main/java/de/kosit/validationtool/daemon/CheckHandler.java b/src/main/java/de/kosit/validationtool/daemon/CheckHandler.java
index ff7cb5b..96073e1 100644
--- a/src/main/java/de/kosit/validationtool/daemon/CheckHandler.java
+++ b/src/main/java/de/kosit/validationtool/daemon/CheckHandler.java
@@ -1,11 +1,13 @@
package de.kosit.validationtool.daemon;
+import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.io.InputStream;
import java.net.URI;
import java.util.concurrent.atomic.AtomicLong;
+import org.apache.commons.lang3.StringUtils;
+
import com.sun.net.httpserver.HttpExchange;
import lombok.RequiredArgsConstructor;
@@ -15,6 +17,7 @@ import de.kosit.validationtool.api.Check;
import de.kosit.validationtool.api.InputFactory;
import de.kosit.validationtool.api.Result;
import de.kosit.validationtool.impl.input.SourceInput;
+import de.kosit.validationtool.impl.input.StreamHelper;
import net.sf.saxon.s9api.Processor;
import net.sf.saxon.s9api.SaxonApiException;
@@ -47,9 +50,9 @@ class CheckHandler extends BaseHandler {
final String requestMethod = httpExchange.getRequestMethod();
// check neccessary, since gui can be disabled
if (requestMethod.equals("POST")) {
- final InputStream inputStream = httpExchange.getRequestBody();
- if (inputStream.available() > 0) {
- final SourceInput serverInput = (SourceInput) InputFactory.read(inputStream,
+ final BufferedInputStream buffered = StreamHelper.wrapPeekable(httpExchange.getRequestBody());
+ if (!isMultipartFormData(httpExchange) && isContentAvailable(httpExchange, buffered)) {
+ final SourceInput serverInput = (SourceInput) InputFactory.read(buffered,
resolveInputName(httpExchange.getRequestURI()));
final Result result = this.implemenation.checkInput(serverInput);
write(httpExchange, serialize(result), APPLICATION_XML, resolveStatus(result));
@@ -61,10 +64,29 @@ class CheckHandler extends BaseHandler {
error(httpExchange, HttpStatus.SC_METHOD_NOT_ALLOWED, "Method not supported");
}
} catch (final Exception e) {
+ log.error("Error checking entity", e);
error(httpExchange, HttpStatus.SC_INTERNAL_SERVER_ERROR, "Internal error: " + e.getMessage());
}
}
+ private static boolean isContentAvailable(final com.sun.net.httpserver.HttpExchange httpExchange, final BufferedInputStream buffered)
+ throws IOException {
+ final String length = httpExchange.getRequestHeaders().getFirst("Content-length");
+ if (StringUtils.isNumeric(length)) {
+ return Integer.parseInt(length) > 0;
+ }
+ return streamContainsContent(buffered);
+ }
+
+ private static boolean isMultipartFormData(final HttpExchange httpExchange) {
+ return httpExchange.getRequestHeaders().getFirst("Content-type").startsWith("multipart");
+ }
+
+ private static boolean streamContainsContent(final BufferedInputStream requestBody) throws IOException {
+ return requestBody.available() > 0;
+
+ }
+
private static String resolveInputName(final URI requestURI) {
final String path = requestURI.getPath();
if (path.equalsIgnoreCase("/")) {
diff --git a/src/main/java/de/kosit/validationtool/impl/input/StreamHelper.java b/src/main/java/de/kosit/validationtool/impl/input/StreamHelper.java
index ad94155..62604a2 100644
--- a/src/main/java/de/kosit/validationtool/impl/input/StreamHelper.java
+++ b/src/main/java/de/kosit/validationtool/impl/input/StreamHelper.java
@@ -1,5 +1,6 @@
package de.kosit.validationtool.impl.input;
+import java.io.BufferedInputStream;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -45,6 +46,35 @@ public class StreamHelper {
}
+ private static class PeekableInputStream extends BufferedInputStream {
+
+ public PeekableInputStream(final InputStream in) {
+ super(in);
+ }
+
+ @Override
+ public synchronized int available() throws IOException {
+ int count = super.available();
+ if (count == 0) {
+ count = peek();
+ }
+ return count;
+ }
+
+ @SuppressWarnings("ResultOfMethodCallIgnored")
+ private int peek() throws IOException {
+ try {
+ mark(2);
+ read();
+ read();
+ reset();
+ } catch (final IOException e) {
+ return 0;
+ }
+ return super.available();
+ }
+ }
+
@SuppressWarnings("squid:S4929") // efficient read is done by internally used stream
private static class CountInputStream extends FilterInputStream {
@@ -103,6 +133,10 @@ public class StreamHelper {
return new DigestingInputStream(input, stream, createDigest(digestAlgorithm));
}
+ public static BufferedInputStream wrapPeekable(final InputStream stream) {
+ return new PeekableInputStream(stream);
+ }
+
/**
* Drains the {@link Input} without further processing. This is useful to computing hashcode etc.
*
@@ -129,8 +163,10 @@ public class StreamHelper {
public static void drain(final InputStream input) throws IOException {
final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
+ // noinspection unused
int n;
+ // noinspection StatementWithEmptyBody,UnusedAssignment
while (EOF != (n = input.read(buffer))) {
// nothing
}
From ef1ce56f2aec24d110c29f6778cab7b60bc31680 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Fri, 2 Oct 2020 10:06:29 +0200
Subject: [PATCH 031/210] https://github.com/itplr-kosit/validator/issues/56
trim namespaces and other strings when reading the scenarios
---
.../impl/ContentRepository.java | 5 ++--
.../impl/xml/StringTrimAdapter.java | 29 +++++++++++++++++++
src/main/model/binding/global.xjb | 7 ++++-
.../resources/examples/simple/scenarios.xml | 6 ++--
4 files changed, 42 insertions(+), 5 deletions(-)
create mode 100644 src/main/java/de/kosit/validationtool/impl/xml/StringTrimAdapter.java
diff --git a/src/main/java/de/kosit/validationtool/impl/ContentRepository.java b/src/main/java/de/kosit/validationtool/impl/ContentRepository.java
index 84cd418..b178892 100644
--- a/src/main/java/de/kosit/validationtool/impl/ContentRepository.java
+++ b/src/main/java/de/kosit/validationtool/impl/ContentRepository.java
@@ -47,6 +47,7 @@ import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.api.ResolvingConfigurationStrategy;
import de.kosit.validationtool.impl.Scenario.Transformation;
import de.kosit.validationtool.impl.xml.RelativeUriResolver;
+import de.kosit.validationtool.impl.xml.StringTrimAdapter;
import de.kosit.validationtool.model.scenarios.NamespaceType;
import de.kosit.validationtool.model.scenarios.ResourceType;
import de.kosit.validationtool.model.scenarios.ScenarioType;
@@ -284,13 +285,13 @@ public class ContentRepository {
public XPathExecutable createMatchExecutable(final ScenarioType s) {
final Map namespaces = s.getNamespace().stream()
- .collect(Collectors.toMap(NamespaceType::getPrefix, NamespaceType::getValue));
+ .collect(Collectors.toMap(NamespaceType::getPrefix, ns -> StringTrimAdapter.trim(ns.getValue())));
return createXPath(s.getMatch(), namespaces);
}
public XPathExecutable createAccepptExecutable(final ScenarioType s) {
final Map namespaces = s.getNamespace().stream()
- .collect(Collectors.toMap(NamespaceType::getPrefix, NamespaceType::getValue));
+ .collect(Collectors.toMap(NamespaceType::getPrefix, ns -> StringTrimAdapter.trim(ns.getValue())));
return createXPath(s.getAcceptMatch(), namespaces);
}
diff --git a/src/main/java/de/kosit/validationtool/impl/xml/StringTrimAdapter.java b/src/main/java/de/kosit/validationtool/impl/xml/StringTrimAdapter.java
new file mode 100644
index 0000000..c6c59b3
--- /dev/null
+++ b/src/main/java/de/kosit/validationtool/impl/xml/StringTrimAdapter.java
@@ -0,0 +1,29 @@
+package de.kosit.validationtool.impl.xml;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+public class StringTrimAdapter extends XmlAdapter {
+
+ @Override
+ public String unmarshal(final String v) {
+ if (v == null) {
+ return null;
+ }
+ return v.trim();
+ }
+
+ @Override
+ public String marshal(final String v) {
+ if (v == null) {
+ return null;
+ }
+ return v.trim();
+ }
+
+ public static String trim(final String v) {
+ if (v == null) {
+ return null;
+ }
+ return v.trim();
+ }
+}
\ No newline at end of file
diff --git a/src/main/model/binding/global.xjb b/src/main/model/binding/global.xjb
index be1e39c..a101944 100644
--- a/src/main/model/binding/global.xjb
+++ b/src/main/model/binding/global.xjb
@@ -26,7 +26,12 @@
jaxb:extensionBindingPrefixes="inheritance"
version="2.1">
-
+
+
+
diff --git a/src/test/resources/examples/simple/scenarios.xml b/src/test/resources/examples/simple/scenarios.xml
index 1513b5d..1e56b26 100644
--- a/src/test/resources/examples/simple/scenarios.xml
+++ b/src/test/resources/examples/simple/scenarios.xml
@@ -31,8 +31,10 @@
Nur Schemaprüfung.
- http://www.xoev.de/de/validator/framework/1/createreportinput
- http://validator.kosit.de/test-sample
+ http://www.xoev.de/de/validator/framework/1/createreportinput
+
+
+ http://validator.kosit.de/test-samplehttp://validator.kosit.de/test-report/test:simple
From 55986c2e8dc637d91ea4d17463c10461ca37fbe3 Mon Sep 17 00:00:00 2001
From: Andreas Penski <18-andreas.penski@users.noreply.projekte.kosit.org>
Date: Fri, 2 Oct 2020 08:30:39 +0000
Subject: [PATCH 032/210] https://github.com/itplr-kosit/validator/issues/53
Fix copyright and licensing information
---
.idea/copyright/KoSIT_Validator.xml | 6 ++++
.idea/copyright/profiles_settings.xml | 7 ++++
LICENSE | 25 -------------
NOTICE | 6 ++--
formatter.xml | 16 +++++++++
.../1.0.1/packaged-test-scenarios-1.0.1.pom | 16 +++++++++
.../maven-metadata-local.xml | 16 +++++++++
pom.xml | 36 +++++++++----------
src/assembly/assembly-dist.xml | 25 ++++++-------
.../api/AcceptRecommendation.java | 16 +++++++++
.../de/kosit/validationtool/api/Check.java | 25 ++++++-------
.../api/CheckConfiguration.java | 25 ++++++-------
.../validationtool/api/Configuration.java | 16 +++++++++
.../de/kosit/validationtool/api/Input.java | 25 ++++++-------
.../validationtool/api/InputFactory.java | 25 ++++++-------
.../api/ResolvingConfigurationStrategy.java | 16 +++++++++
.../de/kosit/validationtool/api/Result.java | 16 +++++++++
.../de/kosit/validationtool/api/XmlError.java | 16 +++++++++
.../cmd/CheckAssertionAction.java | 25 ++++++-------
.../cmd/CommandLineApplication.java | 25 ++++++-------
.../cmd/CommandLineOptions.java | 16 +++++++++
.../cmd/DefaultNamingStrategy.java | 16 +++++++++
.../cmd/ExtractHtmlContentAction.java | 25 ++++++-------
.../validationtool/cmd/InternalCheck.java | 25 ++++++-------
.../validationtool/cmd/NamingStrategy.java | 16 +++++++++
.../validationtool/cmd/PrintMemoryStats.java | 25 ++++++-------
.../validationtool/cmd/PrintReportAction.java | 25 ++++++-------
.../kosit/validationtool/cmd/ReturnValue.java | 16 +++++++++
.../cmd/SerializeReportAction.java | 25 ++++++-------
.../cmd/SerializeReportInputAction.java | 16 +++++++++
.../kosit/validationtool/cmd/Validator.java | 16 +++++++++
.../validationtool/cmd/report/Format.java | 16 +++++++++
.../kosit/validationtool/cmd/report/Grid.java | 16 +++++++++
.../validationtool/cmd/report/Justify.java | 16 +++++++++
.../kosit/validationtool/cmd/report/Line.java | 16 +++++++++
.../kosit/validationtool/cmd/report/Text.java | 16 +++++++++
.../kosit/validationtool/config/Builder.java | 16 +++++++++
.../config/ConfigurationBuilder.java | 16 +++++++++
.../config/ConfigurationLoader.java | 16 +++++++++
.../config/DefaultConfiguration.java | 16 +++++++++
.../config/FallbackBuilder.java | 16 +++++++++
.../de/kosit/validationtool/config/Keys.java | 16 +++++++++
.../validationtool/config/ReportBuilder.java | 16 +++++++++
.../config/ScenarioBuilder.java | 16 +++++++++
.../validationtool/config/SchemaBuilder.java | 16 +++++++++
.../config/SchematronBuilder.java | 16 +++++++++
.../validationtool/config/XPathBuilder.java | 16 +++++++++
.../validationtool/daemon/BaseHandler.java | 16 +++++++++
.../validationtool/daemon/CheckHandler.java | 16 +++++++++
.../validationtool/daemon/ConfigHandler.java | 16 +++++++++
.../kosit/validationtool/daemon/Daemon.java | 16 +++++++++
.../validationtool/daemon/GuiHandler.java | 16 +++++++++
.../validationtool/daemon/HealthHandler.java | 16 +++++++++
.../validationtool/daemon/HttpStatus.java | 16 +++++++++
.../validationtool/daemon/RoutingHandler.java | 16 +++++++++
.../impl/ClassPathResourceResolver.java | 25 ++++++-------
.../impl/CollectingErrorEventHandler.java | 25 ++++++-------
.../impl/ContentRepository.java | 25 ++++++-------
.../impl/ConversionService.java | 25 ++++++-------
.../validationtool/impl/DateFactory.java | 16 +++++++++
.../validationtool/impl/DefaultCheck.java | 25 ++++++-------
.../validationtool/impl/DefaultResult.java | 16 +++++++++
.../impl/EngineInformation.java | 16 +++++++++
.../validationtool/impl/HtmlExtractor.java | 16 +++++++++
.../de/kosit/validationtool/impl/Printer.java | 16 +++++++++
.../validationtool/impl/ResolvingMode.java | 16 +++++++++
.../kosit/validationtool/impl/Scenario.java | 16 +++++++++
.../impl/ScenarioRepository.java | 25 ++++++-------
.../impl/input/AbstractInput.java | 16 +++++++++
.../impl/input/ByteArrayInput.java | 16 +++++++++
.../impl/input/LazyReadInput.java | 16 +++++++++
.../impl/input/ResourceInput.java | 16 +++++++++
.../impl/input/SourceInput.java | 16 +++++++++
.../impl/input/StreamHelper.java | 16 +++++++++
.../impl/input/XdmNodeInput.java | 16 +++++++++
.../validationtool/impl/model/BaseOutput.java | 16 +++++++++
.../impl/model/BaseXMLSyntaxError.java | 25 ++++++-------
.../validationtool/impl/model/Result.java | 25 ++++++-------
.../impl/tasks/CheckAction.java | 25 ++++++-------
.../impl/tasks/ComputeAcceptanceAction.java | 16 +++++++++
.../CreateDocumentIdentificationAction.java | 16 +++++++++
.../impl/tasks/CreateReportAction.java | 25 ++++++-------
.../impl/tasks/DocumentParseAction.java | 25 ++++++-------
.../impl/tasks/ScenarioSelectionAction.java | 25 ++++++-------
.../impl/tasks/SchemaValidationAction.java | 25 ++++++-------
.../tasks/SchematronValidationAction.java | 25 ++++++-------
.../impl/tasks/ValidateReportInputAction.java | 25 ++++++-------
.../impl/xml/BaseResolvingStrategy.java | 16 +++++++++
.../impl/xml/RelativeUriResolver.java | 25 ++++++-------
.../impl/xml/RemoteResolvingStrategy.java | 16 +++++++++
.../xml/StrictLocalResolvingStrategy.java | 16 +++++++++
.../xml/StrictRelativeResolvingStrategy.java | 16 +++++++++
.../impl/xml/StringTrimAdapter.java | 16 +++++++++
src/main/model/binding/global.xjb | 25 ++++++-------
src/main/model/xsd/assertions.xsd | 25 ++++++-------
src/main/model/xsd/createReportInput.xsd | 25 ++++++-------
src/main/model/xsd/daemon.xsd | 16 +++++++++
src/main/model/xsd/scenarios.xsd | 25 ++++++-------
src/main/model/xsd/svrl-kosit.xsd | 16 +++++++++
src/main/model/xsd/xml.xsd | 16 +++++++++
src/main/resources/app-info.properties | 15 ++++++++
src/main/resources/gui/index.html | 30 ++++++++++++----
src/main/resources/simplelogger.properties | 25 +++++++------
.../api/CheckConfigurationTest.java | 16 +++++++++
.../validationtool/api/InputFactoryTest.java | 25 ++++++-------
.../cmd/CheckAssertionActionTest.java | 25 ++++++-------
.../kosit/validationtool/cmd/CommandLine.java | 25 ++++++-------
.../cmd/CommandlineApplicationTest.java | 25 ++++++-------
.../cmd/DefaultNamingStrategyTest.java | 16 +++++++++
.../cmd/ExtractHtmlActionTest.java | 25 ++++++-------
.../cmd/PrintReportActionTest.java | 25 ++++++-------
.../cmd/SerializeReportActionTest.java | 25 ++++++-------
.../cmd/SerializeReportInputActionTest.java | 25 ++++++-------
.../config/ConfigurationBuilderTest.java | 16 +++++++++
.../config/ConfigurationLoaderTest.java | 16 +++++++++
.../config/ScenarioBuilderTest.java | 16 +++++++++
.../config/SchemaBuilderTest.java | 16 +++++++++
.../config/SimpleConfigTest.java | 16 +++++++++
.../config/TestConfiguration.java | 16 +++++++++
.../config/TestConfigurationFactory.java | 16 +++++++++
.../config/XPathBuilderTest.java | 16 +++++++++
.../kosit/validationtool/daemon/BaseIT.java | 16 +++++++++
.../validationtool/daemon/CheckHandlerIT.java | 16 +++++++++
.../daemon/ConfigHandlerIT.java | 16 +++++++++
.../daemon/ConfigHandlerTest.java | 16 +++++++++
.../validationtool/daemon/GuiHandlerIT.java | 16 +++++++++
.../daemon/HealthHandlerIT.java | 16 +++++++++
.../impl/ContentRepositoryTest.java | 25 ++++++-------
.../impl/ConversionServiceTest.java | 25 ++++++-------
.../validationtool/impl/DefaultCheckTest.java | 25 ++++++-------
.../de/kosit/validationtool/impl/Helper.java | 25 ++++++-------
.../impl/RelativeUriResolverTest.java | 25 ++++++-------
.../impl/ScenarioRepositoryTest.java | 25 ++++++-------
.../impl/SimpleScenarioCheckTest.java | 16 +++++++++
.../impl/TestObjectFactory.java | 16 +++++++++
.../validationtool/impl/VersioningTest.java | 25 ++++++-------
.../tasks/ComputeAcceptanceActionTest.java | 16 +++++++++
.../impl/tasks/CreateReportActionTest.java | 16 +++++++++
.../impl/tasks/DocumentParseActionTest.java | 25 ++++++-------
.../impl/tasks/SchemaValidatorActionTest.java | 25 ++++++-------
.../tasks/SchematronValidationActionTest.java | 16 +++++++++
.../impl/tasks/TestBagBuilder.java | 16 +++++++++
.../xml/BaseResolverConfigurationTest.java | 16 +++++++++
.../impl/xml/RemoteResolvingStrategyTest.java | 16 +++++++++
.../impl/xml/SaxonSecurityTest.java | 25 ++++++-------
.../impl/xml/StrictLocalResolvingTest.java | 16 +++++++++
.../impl/xml/StrictRelativeResolvingTest.java | 16 +++++++++
src/test/resources/evil/evil1.xsl | 25 ++++++-------
src/test/resources/evil/evil2.xsl | 25 ++++++-------
src/test/resources/evil/evil3.xsl | 16 +++++++++
src/test/resources/evil/evil4.xsl | 16 +++++++++
src/test/resources/evil/evil5.xsl | 25 ++++++-------
src/test/resources/evil/xxe.xml | 16 +++++++++
.../examples/assertions/tests-xrechnung.xml | 25 ++++++-------
.../examples/assertions/ubl-0001-report.xml | 25 ++++++-------
.../examples/assertions/ubl-0001.xml | 25 ++++++-------
.../examples/assertions/ubl-0002.xml | 25 ++++++-------
.../examples/invalid/scenarios-illforned.xml | 25 ++++++-------
.../resources/examples/invalid/scenarios.xml | 25 ++++++-------
.../resources/examples/resolving/main.xsd | 16 +++++++++
.../resolving/resources/reference.xsd | 16 +++++++++
.../examples/resolving/withRemote.xsd | 16 +++++++++
.../resources/examples/simple/assertions.xml | 25 ++++++-------
.../simple/input/foo-schematron-invalid.xml | 16 +++++++++
.../resources/examples/simple/input/foo.xml | 16 +++++++++
.../simple/input/simple-not-wellformed.xml | 16 +++++++++
.../simple/input/simple-schema-invalid.xml | 16 +++++++++
.../input/simple-schematron-invalid.xml | 16 +++++++++
.../examples/simple/input/simple.xml | 16 +++++++++
.../examples/simple/input/unknown.xml | 16 +++++++++
.../simple/input/withManualReject.xml | 16 +++++++++
.../examples/simple/repository/report.xsl | 25 ++++++-------
.../repository/simple-schematron-error.xsl | 16 +++++++++
.../examples/simple/repository/simple.xsd | 16 +++++++++
.../examples/simple/repository/simple.xsl | 16 +++++++++
.../examples/simple/scenarios-with-errors.xml | 25 ++++++-------
.../resources/examples/simple/scenarios.xml | 25 ++++++-------
.../examples/versioning/scenarios-base.xml | 25 ++++++-------
.../versioning/scenarios-increment.xml | 25 ++++++-------
.../versioning/scenarios-newfeature.xml | 25 ++++++-------
.../versioning/scenarios-newversion.xml | 25 ++++++-------
src/test/resources/loading/main.xsd | 16 +++++++++
.../resources/loading/resources/reference.xsd | 16 +++++++++
183 files changed, 2551 insertions(+), 1002 deletions(-)
create mode 100644 .idea/copyright/KoSIT_Validator.xml
create mode 100644 .idea/copyright/profiles_settings.xml
diff --git a/.idea/copyright/KoSIT_Validator.xml b/.idea/copyright/KoSIT_Validator.xml
new file mode 100644
index 0000000..114e72d
--- /dev/null
+++ b/.idea/copyright/KoSIT_Validator.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml
new file mode 100644
index 0000000..bc6a0ba
--- /dev/null
+++ b/.idea/copyright/profiles_settings.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index 8dada3e..d9a10c0 100644
--- a/LICENSE
+++ b/LICENSE
@@ -174,28 +174,3 @@
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- Licensed 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.
diff --git a/NOTICE b/NOTICE
index 00c8dd0..9f0c845 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
-KoSIT Validaor
-Copyright 2019 Koordinierungsstelle für IT-Standards
+KoSIT Validator
+Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
This product includes software developed by
-Koordinierungsstelle für IT-Standards (https://www.kosit.de/).
+Koordinierungsstelle für IT-Standards (https://www.xoev.de/).
diff --git a/formatter.xml b/formatter.xml
index 1623387..5ddad2b 100644
--- a/formatter.xml
+++ b/formatter.xml
@@ -1,4 +1,20 @@
+
+
diff --git a/libs/de/kosit/validationtool/packaged-test-scenarios/1.0.1/packaged-test-scenarios-1.0.1.pom b/libs/de/kosit/validationtool/packaged-test-scenarios/1.0.1/packaged-test-scenarios-1.0.1.pom
index be718d2..e76786b 100644
--- a/libs/de/kosit/validationtool/packaged-test-scenarios/1.0.1/packaged-test-scenarios-1.0.1.pom
+++ b/libs/de/kosit/validationtool/packaged-test-scenarios/1.0.1/packaged-test-scenarios-1.0.1.pom
@@ -1,4 +1,20 @@
+
+
diff --git a/libs/de/kosit/validationtool/packaged-test-scenarios/maven-metadata-local.xml b/libs/de/kosit/validationtool/packaged-test-scenarios/maven-metadata-local.xml
index 4b08828..5197bbc 100644
--- a/libs/de/kosit/validationtool/packaged-test-scenarios/maven-metadata-local.xml
+++ b/libs/de/kosit/validationtool/packaged-test-scenarios/maven-metadata-local.xml
@@ -1,4 +1,20 @@
+
+
de.kosit.validationtoolpackaged-test-scenarios
diff --git a/pom.xml b/pom.xml
index 5481c7f..88e3412 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,5 +1,20 @@
-
+
+
4.0.0
@@ -565,21 +580,4 @@
v1.1.0
-
+
diff --git a/src/assembly/assembly-dist.xml b/src/assembly/assembly-dist.xml
index 7398bf9..5b4204c 100644
--- a/src/assembly/assembly-dist.xml
+++ b/src/assembly/assembly-dist.xml
@@ -1,20 +1,17 @@
diff --git a/src/main/model/xsd/createReportInput.xsd b/src/main/model/xsd/createReportInput.xsd
index f0377f9..1d628b5 100644
--- a/src/main/model/xsd/createReportInput.xsd
+++ b/src/main/model/xsd/createReportInput.xsd
@@ -1,21 +1,18 @@
diff --git a/src/main/model/xsd/daemon.xsd b/src/main/model/xsd/daemon.xsd
index c5f9b8c..cbd8db5 100644
--- a/src/main/model/xsd/daemon.xsd
+++ b/src/main/model/xsd/daemon.xsd
@@ -1,4 +1,20 @@
+
+
diff --git a/src/main/model/xsd/scenarios.xsd b/src/main/model/xsd/scenarios.xsd
index 66a0224..b626c06 100644
--- a/src/main/model/xsd/scenarios.xsd
+++ b/src/main/model/xsd/scenarios.xsd
@@ -1,21 +1,18 @@
diff --git a/src/main/model/xsd/svrl-kosit.xsd b/src/main/model/xsd/svrl-kosit.xsd
index 2fd478a..721db44 100644
--- a/src/main/model/xsd/svrl-kosit.xsd
+++ b/src/main/model/xsd/svrl-kosit.xsd
@@ -1,4 +1,20 @@
+
+
diff --git a/src/main/model/xsd/xml.xsd b/src/main/model/xsd/xml.xsd
index d3847fc..74b14a8 100644
--- a/src/main/model/xsd/xml.xsd
+++ b/src/main/model/xsd/xml.xsd
@@ -1,4 +1,20 @@
+
+
diff --git a/src/main/resources/app-info.properties b/src/main/resources/app-info.properties
index d3b04cf..d0ccfa1 100644
--- a/src/main/resources/app-info.properties
+++ b/src/main/resources/app-info.properties
@@ -1,3 +1,18 @@
+#
+# Copyright 2017-2020 Koordinierungsstelle fr IT-Standards (KoSIT)
+#
+# Licensed 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.
+#
# do not edit this file
# this properties are overriden by build process
project_version=${project.version}
diff --git a/src/main/resources/gui/index.html b/src/main/resources/gui/index.html
index 1eb48c4..3473141 100644
--- a/src/main/resources/gui/index.html
+++ b/src/main/resources/gui/index.html
@@ -1,3 +1,19 @@
+
+
@@ -51,13 +67,13 @@
Loading validator...
+ window.$docsify = {
+ repo: "itplr-kosit/validator",
+ loadSidebar: false,
+ hideSidebar: true,
+ autoHeader: true,
+ }
+
diff --git a/src/main/resources/simplelogger.properties b/src/main/resources/simplelogger.properties
index a157795..231ef65 100644
--- a/src/main/resources/simplelogger.properties
+++ b/src/main/resources/simplelogger.properties
@@ -1,37 +1,42 @@
-
+#
+# Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+#
+# Licensed 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.
+#
# SLF4J's SimpleLogger configuration file for the command line client
# Simple implementation of Logger that sends all enabled log messages, for all defined loggers, to System.err.
-
# Default logging detail level for all instances of SimpleLogger.
# Must be one of ("trace", "debug", "info", "warn", or "error").
# If not specified, defaults to "info".
org.slf4j.simpleLogger.defaultLogLevel=info
-
-
# Set to true if you want the current date and time to be included in output messages.
# Default is false, and will output the number of milliseconds elapsed since startup.
org.slf4j.simpleLogger.showDateTime=true
-
# The date and time format to be used in the output messages.
# The pattern describing the date and time format is the same that is used in java.text.SimpleDateFormat.
# If the format is not specified or is invalid, the default format is used.
# The default format is yyyy-MM-dd HH:mm:ss:SSS Z.
org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss
-
# Set to true if you want to output the current thread name.
# Defaults to true.
org.slf4j.simpleLogger.showThreadName=false
-
# Set to true if you want the Logger instance name to be included in output messages.
# Defaults to true.
org.slf4j.simpleLogger.showLogName=false
-
# Set to true if you want the last component of the name to be included in output messages.
# Defaults to false.
org.slf4j.simpleLogger.showShortLogName=false
-
org.slf4j.simpleLogger.levelInBrackets=true
-
#
# Licensed to the Koordinierungsstelle f�r IT-Standards (KoSIT) under
# one or more contributor license agreements. See the NOTICE file
diff --git a/src/test/java/de/kosit/validationtool/api/CheckConfigurationTest.java b/src/test/java/de/kosit/validationtool/api/CheckConfigurationTest.java
index 717a59d..eac3627 100644
--- a/src/test/java/de/kosit/validationtool/api/CheckConfigurationTest.java
+++ b/src/test/java/de/kosit/validationtool/api/CheckConfigurationTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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.api;
import static org.assertj.core.api.Assertions.assertThat;
diff --git a/src/test/java/de/kosit/validationtool/api/InputFactoryTest.java b/src/test/java/de/kosit/validationtool/api/InputFactoryTest.java
index 55c294d..7431bdb 100644
--- a/src/test/java/de/kosit/validationtool/api/InputFactoryTest.java
+++ b/src/test/java/de/kosit/validationtool/api/InputFactoryTest.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * 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.api;
diff --git a/src/test/java/de/kosit/validationtool/cmd/CheckAssertionActionTest.java b/src/test/java/de/kosit/validationtool/cmd/CheckAssertionActionTest.java
index 29e8e7c..bf2d196 100644
--- a/src/test/java/de/kosit/validationtool/cmd/CheckAssertionActionTest.java
+++ b/src/test/java/de/kosit/validationtool/cmd/CheckAssertionActionTest.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * 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;
diff --git a/src/test/java/de/kosit/validationtool/cmd/CommandLine.java b/src/test/java/de/kosit/validationtool/cmd/CommandLine.java
index cae55e8..472e54d 100644
--- a/src/test/java/de/kosit/validationtool/cmd/CommandLine.java
+++ b/src/test/java/de/kosit/validationtool/cmd/CommandLine.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * 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;
diff --git a/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java b/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java
index 285a059..8894056 100644
--- a/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java
+++ b/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * 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;
diff --git a/src/test/java/de/kosit/validationtool/cmd/DefaultNamingStrategyTest.java b/src/test/java/de/kosit/validationtool/cmd/DefaultNamingStrategyTest.java
index da13c79..781235a 100644
--- a/src/test/java/de/kosit/validationtool/cmd/DefaultNamingStrategyTest.java
+++ b/src/test/java/de/kosit/validationtool/cmd/DefaultNamingStrategyTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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 static org.assertj.core.api.Assertions.assertThat;
diff --git a/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java b/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java
index 7b8ccc7..ab11ac7 100644
--- a/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java
+++ b/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * 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;
diff --git a/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java b/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java
index 5f0319c..01116cb 100644
--- a/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java
+++ b/src/test/java/de/kosit/validationtool/cmd/PrintReportActionTest.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * 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;
diff --git a/src/test/java/de/kosit/validationtool/cmd/SerializeReportActionTest.java b/src/test/java/de/kosit/validationtool/cmd/SerializeReportActionTest.java
index 5bb7994..2858b3a 100644
--- a/src/test/java/de/kosit/validationtool/cmd/SerializeReportActionTest.java
+++ b/src/test/java/de/kosit/validationtool/cmd/SerializeReportActionTest.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * 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;
diff --git a/src/test/java/de/kosit/validationtool/cmd/SerializeReportInputActionTest.java b/src/test/java/de/kosit/validationtool/cmd/SerializeReportInputActionTest.java
index a520643..4202c0d 100644
--- a/src/test/java/de/kosit/validationtool/cmd/SerializeReportInputActionTest.java
+++ b/src/test/java/de/kosit/validationtool/cmd/SerializeReportInputActionTest.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * 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;
diff --git a/src/test/java/de/kosit/validationtool/config/ConfigurationBuilderTest.java b/src/test/java/de/kosit/validationtool/config/ConfigurationBuilderTest.java
index 9b98549..83303d0 100644
--- a/src/test/java/de/kosit/validationtool/config/ConfigurationBuilderTest.java
+++ b/src/test/java/de/kosit/validationtool/config/ConfigurationBuilderTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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.config;
import static de.kosit.validationtool.config.ConfigurationBuilder.report;
diff --git a/src/test/java/de/kosit/validationtool/config/ConfigurationLoaderTest.java b/src/test/java/de/kosit/validationtool/config/ConfigurationLoaderTest.java
index 4c3f626..43791c7 100644
--- a/src/test/java/de/kosit/validationtool/config/ConfigurationLoaderTest.java
+++ b/src/test/java/de/kosit/validationtool/config/ConfigurationLoaderTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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.config;
import static org.assertj.core.api.Assertions.assertThat;
diff --git a/src/test/java/de/kosit/validationtool/config/ScenarioBuilderTest.java b/src/test/java/de/kosit/validationtool/config/ScenarioBuilderTest.java
index 43170cc..0cb27eb 100644
--- a/src/test/java/de/kosit/validationtool/config/ScenarioBuilderTest.java
+++ b/src/test/java/de/kosit/validationtool/config/ScenarioBuilderTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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.config;
import static de.kosit.validationtool.config.TestConfigurationFactory.createScenario;
diff --git a/src/test/java/de/kosit/validationtool/config/SchemaBuilderTest.java b/src/test/java/de/kosit/validationtool/config/SchemaBuilderTest.java
index bff1c7d..7fea4a5 100644
--- a/src/test/java/de/kosit/validationtool/config/SchemaBuilderTest.java
+++ b/src/test/java/de/kosit/validationtool/config/SchemaBuilderTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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.config;
import static de.kosit.validationtool.config.ConfigurationBuilder.schema;
diff --git a/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java b/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java
index f03d2fd..45f182f 100644
--- a/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java
+++ b/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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.config;
import static de.kosit.validationtool.config.TestConfigurationFactory.createSimpleConfiguration;
diff --git a/src/test/java/de/kosit/validationtool/config/TestConfiguration.java b/src/test/java/de/kosit/validationtool/config/TestConfiguration.java
index 4de67c1..7263cd2 100644
--- a/src/test/java/de/kosit/validationtool/config/TestConfiguration.java
+++ b/src/test/java/de/kosit/validationtool/config/TestConfiguration.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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.config;
import java.util.List;
diff --git a/src/test/java/de/kosit/validationtool/config/TestConfigurationFactory.java b/src/test/java/de/kosit/validationtool/config/TestConfigurationFactory.java
index b471e44..6e920dc 100644
--- a/src/test/java/de/kosit/validationtool/config/TestConfigurationFactory.java
+++ b/src/test/java/de/kosit/validationtool/config/TestConfigurationFactory.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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.config;
import static de.kosit.validationtool.config.ConfigurationBuilder.fallback;
diff --git a/src/test/java/de/kosit/validationtool/config/XPathBuilderTest.java b/src/test/java/de/kosit/validationtool/config/XPathBuilderTest.java
index 30d3af1..d4795fe 100644
--- a/src/test/java/de/kosit/validationtool/config/XPathBuilderTest.java
+++ b/src/test/java/de/kosit/validationtool/config/XPathBuilderTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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.config;
import static org.assertj.core.api.Assertions.assertThat;
diff --git a/src/test/java/de/kosit/validationtool/daemon/BaseIT.java b/src/test/java/de/kosit/validationtool/daemon/BaseIT.java
index e719345..cce00b2 100644
--- a/src/test/java/de/kosit/validationtool/daemon/BaseIT.java
+++ b/src/test/java/de/kosit/validationtool/daemon/BaseIT.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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.daemon;
import org.junit.Before;
diff --git a/src/test/java/de/kosit/validationtool/daemon/CheckHandlerIT.java b/src/test/java/de/kosit/validationtool/daemon/CheckHandlerIT.java
index edb5997..d32ada2 100644
--- a/src/test/java/de/kosit/validationtool/daemon/CheckHandlerIT.java
+++ b/src/test/java/de/kosit/validationtool/daemon/CheckHandlerIT.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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.daemon;
import static io.restassured.RestAssured.given;
diff --git a/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerIT.java b/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerIT.java
index baba2d4..4c19067 100644
--- a/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerIT.java
+++ b/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerIT.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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.daemon;
import static io.restassured.RestAssured.given;
diff --git a/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerTest.java b/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerTest.java
index e1552e7..090fede 100644
--- a/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerTest.java
+++ b/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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.daemon;
import static org.assertj.core.api.Assertions.assertThat;
diff --git a/src/test/java/de/kosit/validationtool/daemon/GuiHandlerIT.java b/src/test/java/de/kosit/validationtool/daemon/GuiHandlerIT.java
index 3d7501c..d28192a 100644
--- a/src/test/java/de/kosit/validationtool/daemon/GuiHandlerIT.java
+++ b/src/test/java/de/kosit/validationtool/daemon/GuiHandlerIT.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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.daemon;
import static io.restassured.RestAssured.given;
diff --git a/src/test/java/de/kosit/validationtool/daemon/HealthHandlerIT.java b/src/test/java/de/kosit/validationtool/daemon/HealthHandlerIT.java
index d706624..5d6ffa2 100644
--- a/src/test/java/de/kosit/validationtool/daemon/HealthHandlerIT.java
+++ b/src/test/java/de/kosit/validationtool/daemon/HealthHandlerIT.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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.daemon;
import static io.restassured.RestAssured.given;
diff --git a/src/test/java/de/kosit/validationtool/impl/ContentRepositoryTest.java b/src/test/java/de/kosit/validationtool/impl/ContentRepositoryTest.java
index 90a0355..d315420 100644
--- a/src/test/java/de/kosit/validationtool/impl/ContentRepositoryTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/ContentRepositoryTest.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package de.kosit.validationtool.impl;
diff --git a/src/test/java/de/kosit/validationtool/impl/ConversionServiceTest.java b/src/test/java/de/kosit/validationtool/impl/ConversionServiceTest.java
index 2bbef72..d58495a 100644
--- a/src/test/java/de/kosit/validationtool/impl/ConversionServiceTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/ConversionServiceTest.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package de.kosit.validationtool.impl;
diff --git a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
index 5217705..900b648 100644
--- a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package de.kosit.validationtool.impl;
diff --git a/src/test/java/de/kosit/validationtool/impl/Helper.java b/src/test/java/de/kosit/validationtool/impl/Helper.java
index 88f048e..94386b0 100644
--- a/src/test/java/de/kosit/validationtool/impl/Helper.java
+++ b/src/test/java/de/kosit/validationtool/impl/Helper.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package de.kosit.validationtool.impl;
diff --git a/src/test/java/de/kosit/validationtool/impl/RelativeUriResolverTest.java b/src/test/java/de/kosit/validationtool/impl/RelativeUriResolverTest.java
index 925fa26..858f7a6 100644
--- a/src/test/java/de/kosit/validationtool/impl/RelativeUriResolverTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/RelativeUriResolverTest.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package de.kosit.validationtool.impl;
diff --git a/src/test/java/de/kosit/validationtool/impl/ScenarioRepositoryTest.java b/src/test/java/de/kosit/validationtool/impl/ScenarioRepositoryTest.java
index 9cf456f..dff5dfe 100644
--- a/src/test/java/de/kosit/validationtool/impl/ScenarioRepositoryTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/ScenarioRepositoryTest.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package de.kosit.validationtool.impl;
diff --git a/src/test/java/de/kosit/validationtool/impl/SimpleScenarioCheckTest.java b/src/test/java/de/kosit/validationtool/impl/SimpleScenarioCheckTest.java
index 0ac2c9f..16de703 100644
--- a/src/test/java/de/kosit/validationtool/impl/SimpleScenarioCheckTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/SimpleScenarioCheckTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package de.kosit.validationtool.impl;
import static org.assertj.core.api.Assertions.assertThat;
diff --git a/src/test/java/de/kosit/validationtool/impl/TestObjectFactory.java b/src/test/java/de/kosit/validationtool/impl/TestObjectFactory.java
index e647843..12857be 100644
--- a/src/test/java/de/kosit/validationtool/impl/TestObjectFactory.java
+++ b/src/test/java/de/kosit/validationtool/impl/TestObjectFactory.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package de.kosit.validationtool.impl;
import de.kosit.validationtool.impl.xml.StrictLocalResolvingStrategy;
diff --git a/src/test/java/de/kosit/validationtool/impl/VersioningTest.java b/src/test/java/de/kosit/validationtool/impl/VersioningTest.java
index 38cb77a..06a281c 100644
--- a/src/test/java/de/kosit/validationtool/impl/VersioningTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/VersioningTest.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package de.kosit.validationtool.impl;
diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java b/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java
index 4621ea6..5e60731 100644
--- a/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package de.kosit.validationtool.impl.tasks;
import static de.kosit.validationtool.impl.tasks.TestBagBuilder.createBag;
diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java b/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java
index 5cb73f6..11d7316 100644
--- a/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package de.kosit.validationtool.impl.tasks;
import static de.kosit.validationtool.config.TestConfigurationFactory.createScenario;
diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/DocumentParseActionTest.java b/src/test/java/de/kosit/validationtool/impl/tasks/DocumentParseActionTest.java
index 8e276ad..0715f49 100644
--- a/src/test/java/de/kosit/validationtool/impl/tasks/DocumentParseActionTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/tasks/DocumentParseActionTest.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package de.kosit.validationtool.impl.tasks;
diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java b/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java
index 642df80..a573668 100644
--- a/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package de.kosit.validationtool.impl.tasks;
diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/SchematronValidationActionTest.java b/src/test/java/de/kosit/validationtool/impl/tasks/SchematronValidationActionTest.java
index 809a412..a91711e 100644
--- a/src/test/java/de/kosit/validationtool/impl/tasks/SchematronValidationActionTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/tasks/SchematronValidationActionTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package de.kosit.validationtool.impl.tasks;
import static de.kosit.validationtool.impl.tasks.TestBagBuilder.createBag;
diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java b/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java
index f8d0c37..86e6489 100644
--- a/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java
+++ b/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package de.kosit.validationtool.impl.tasks;
import java.net.MalformedURLException;
diff --git a/src/test/java/de/kosit/validationtool/impl/xml/BaseResolverConfigurationTest.java b/src/test/java/de/kosit/validationtool/impl/xml/BaseResolverConfigurationTest.java
index a37718d..8d2c822 100644
--- a/src/test/java/de/kosit/validationtool/impl/xml/BaseResolverConfigurationTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/xml/BaseResolverConfigurationTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package de.kosit.validationtool.impl.xml;
import static org.mockito.ArgumentMatchers.any;
diff --git a/src/test/java/de/kosit/validationtool/impl/xml/RemoteResolvingStrategyTest.java b/src/test/java/de/kosit/validationtool/impl/xml/RemoteResolvingStrategyTest.java
index a60244c..1fa085b 100644
--- a/src/test/java/de/kosit/validationtool/impl/xml/RemoteResolvingStrategyTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/xml/RemoteResolvingStrategyTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package de.kosit.validationtool.impl.xml;
import static org.assertj.core.api.Assertions.assertThat;
diff --git a/src/test/java/de/kosit/validationtool/impl/xml/SaxonSecurityTest.java b/src/test/java/de/kosit/validationtool/impl/xml/SaxonSecurityTest.java
index b254022..9a532ef 100644
--- a/src/test/java/de/kosit/validationtool/impl/xml/SaxonSecurityTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/xml/SaxonSecurityTest.java
@@ -1,20 +1,17 @@
/*
- * 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
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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
*
- * 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.
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package de.kosit.validationtool.impl.xml;
diff --git a/src/test/java/de/kosit/validationtool/impl/xml/StrictLocalResolvingTest.java b/src/test/java/de/kosit/validationtool/impl/xml/StrictLocalResolvingTest.java
index 7be18d8..5881716 100644
--- a/src/test/java/de/kosit/validationtool/impl/xml/StrictLocalResolvingTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/xml/StrictLocalResolvingTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package de.kosit.validationtool.impl.xml;
import static org.assertj.core.api.Assertions.assertThat;
diff --git a/src/test/java/de/kosit/validationtool/impl/xml/StrictRelativeResolvingTest.java b/src/test/java/de/kosit/validationtool/impl/xml/StrictRelativeResolvingTest.java
index c6a1fff..f254171 100644
--- a/src/test/java/de/kosit/validationtool/impl/xml/StrictRelativeResolvingTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/xml/StrictRelativeResolvingTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package de.kosit.validationtool.impl.xml;
import static org.assertj.core.api.Assertions.assertThat;
diff --git a/src/test/resources/evil/evil1.xsl b/src/test/resources/evil/evil1.xsl
index 601ff6c..75cdb30 100644
--- a/src/test/resources/evil/evil1.xsl
+++ b/src/test/resources/evil/evil1.xsl
@@ -1,21 +1,18 @@
+
+
+
+
+
+
]>&xxe;
diff --git a/src/test/resources/examples/assertions/tests-xrechnung.xml b/src/test/resources/examples/assertions/tests-xrechnung.xml
index 2927700..650c431 100644
--- a/src/test/resources/examples/assertions/tests-xrechnung.xml
+++ b/src/test/resources/examples/assertions/tests-xrechnung.xml
@@ -1,21 +1,18 @@
diff --git a/src/test/resources/examples/invalid/scenarios.xml b/src/test/resources/examples/invalid/scenarios.xml
index 4dea43b..149cb46 100644
--- a/src/test/resources/examples/invalid/scenarios.xml
+++ b/src/test/resources/examples/invalid/scenarios.xml
@@ -1,21 +1,18 @@
diff --git a/src/test/resources/examples/resolving/main.xsd b/src/test/resources/examples/resolving/main.xsd
index 16234da..28e2637 100644
--- a/src/test/resources/examples/resolving/main.xsd
+++ b/src/test/resources/examples/resolving/main.xsd
@@ -1,4 +1,20 @@
+
+
diff --git a/src/test/resources/examples/resolving/resources/reference.xsd b/src/test/resources/examples/resolving/resources/reference.xsd
index 6f92671..9064e2c 100644
--- a/src/test/resources/examples/resolving/resources/reference.xsd
+++ b/src/test/resources/examples/resolving/resources/reference.xsd
@@ -1,4 +1,20 @@
+
+
diff --git a/src/test/resources/examples/resolving/withRemote.xsd b/src/test/resources/examples/resolving/withRemote.xsd
index 89c51b9..e76b7d8 100644
--- a/src/test/resources/examples/resolving/withRemote.xsd
+++ b/src/test/resources/examples/resolving/withRemote.xsd
@@ -1,4 +1,20 @@
+
+
diff --git a/src/test/resources/examples/simple/assertions.xml b/src/test/resources/examples/simple/assertions.xml
index 40a4242..4a40b89 100644
--- a/src/test/resources/examples/simple/assertions.xml
+++ b/src/test/resources/examples/simple/assertions.xml
@@ -1,21 +1,18 @@
+
+
diff --git a/src/test/resources/examples/simple/input/foo.xml b/src/test/resources/examples/simple/input/foo.xml
index 7122648..b8d8276 100644
--- a/src/test/resources/examples/simple/input/foo.xml
+++ b/src/test/resources/examples/simple/input/foo.xml
@@ -1,5 +1,21 @@
+
+
asldkfj
diff --git a/src/test/resources/examples/simple/input/simple-not-wellformed.xml b/src/test/resources/examples/simple/input/simple-not-wellformed.xml
index 389ca94..33802c7 100644
--- a/src/test/resources/examples/simple/input/simple-not-wellformed.xml
+++ b/src/test/resources/examples/simple/input/simple-not-wellformed.xml
@@ -1,4 +1,20 @@
+
+
asldkfj
\ No newline at end of file
diff --git a/src/test/resources/examples/simple/input/simple-schema-invalid.xml b/src/test/resources/examples/simple/input/simple-schema-invalid.xml
index 4844ae9..1ec548e 100644
--- a/src/test/resources/examples/simple/input/simple-schema-invalid.xml
+++ b/src/test/resources/examples/simple/input/simple-schema-invalid.xml
@@ -1,5 +1,21 @@
+
+
asldkfj
diff --git a/src/test/resources/examples/simple/input/simple-schematron-invalid.xml b/src/test/resources/examples/simple/input/simple-schematron-invalid.xml
index 9c95879..a74fe8e 100644
--- a/src/test/resources/examples/simple/input/simple-schematron-invalid.xml
+++ b/src/test/resources/examples/simple/input/simple-schematron-invalid.xml
@@ -1,5 +1,21 @@
+
+
adsds
diff --git a/src/test/resources/examples/simple/input/simple.xml b/src/test/resources/examples/simple/input/simple.xml
index 4f0df5a..99e4045 100644
--- a/src/test/resources/examples/simple/input/simple.xml
+++ b/src/test/resources/examples/simple/input/simple.xml
@@ -1,5 +1,21 @@
+
+
asldkfj
diff --git a/src/test/resources/examples/simple/input/unknown.xml b/src/test/resources/examples/simple/input/unknown.xml
index 3cfc388..b34c9f3 100644
--- a/src/test/resources/examples/simple/input/unknown.xml
+++ b/src/test/resources/examples/simple/input/unknown.xml
@@ -1,5 +1,21 @@
+
+
asldkfj
\ No newline at end of file
diff --git a/src/test/resources/examples/simple/input/withManualReject.xml b/src/test/resources/examples/simple/input/withManualReject.xml
index ed81f6d..02f65c0 100644
--- a/src/test/resources/examples/simple/input/withManualReject.xml
+++ b/src/test/resources/examples/simple/input/withManualReject.xml
@@ -1,5 +1,21 @@
+
+
asldkfj
diff --git a/src/test/resources/examples/simple/repository/report.xsl b/src/test/resources/examples/simple/repository/report.xsl
index fdb6006..175b0a2 100644
--- a/src/test/resources/examples/simple/repository/report.xsl
+++ b/src/test/resources/examples/simple/repository/report.xsl
@@ -1,21 +1,18 @@
+
+
+
+
diff --git a/src/test/resources/examples/simple/repository/simple.xsl b/src/test/resources/examples/simple/repository/simple.xsl
index 95f6304..cc170ec 100644
--- a/src/test/resources/examples/simple/repository/simple.xsl
+++ b/src/test/resources/examples/simple/repository/simple.xsl
@@ -1,4 +1,20 @@
+
+
diff --git a/src/test/resources/examples/simple/scenarios.xml b/src/test/resources/examples/simple/scenarios.xml
index 1e56b26..549817c 100644
--- a/src/test/resources/examples/simple/scenarios.xml
+++ b/src/test/resources/examples/simple/scenarios.xml
@@ -1,21 +1,18 @@
diff --git a/src/test/resources/examples/versioning/scenarios-base.xml b/src/test/resources/examples/versioning/scenarios-base.xml
index 1673d90..90286e3 100644
--- a/src/test/resources/examples/versioning/scenarios-base.xml
+++ b/src/test/resources/examples/versioning/scenarios-base.xml
@@ -1,21 +1,18 @@
diff --git a/src/test/resources/examples/versioning/scenarios-increment.xml b/src/test/resources/examples/versioning/scenarios-increment.xml
index c656458..bf5b63d 100644
--- a/src/test/resources/examples/versioning/scenarios-increment.xml
+++ b/src/test/resources/examples/versioning/scenarios-increment.xml
@@ -1,21 +1,18 @@
diff --git a/src/test/resources/examples/versioning/scenarios-newfeature.xml b/src/test/resources/examples/versioning/scenarios-newfeature.xml
index fc8c9c5..534f449 100644
--- a/src/test/resources/examples/versioning/scenarios-newfeature.xml
+++ b/src/test/resources/examples/versioning/scenarios-newfeature.xml
@@ -1,21 +1,18 @@
diff --git a/src/test/resources/examples/versioning/scenarios-newversion.xml b/src/test/resources/examples/versioning/scenarios-newversion.xml
index 694f75a..f0891c9 100644
--- a/src/test/resources/examples/versioning/scenarios-newversion.xml
+++ b/src/test/resources/examples/versioning/scenarios-newversion.xml
@@ -1,21 +1,18 @@
diff --git a/src/test/resources/loading/main.xsd b/src/test/resources/loading/main.xsd
index 71f89b9..cf64e62 100644
--- a/src/test/resources/loading/main.xsd
+++ b/src/test/resources/loading/main.xsd
@@ -1,4 +1,20 @@
+
+
diff --git a/src/test/resources/loading/resources/reference.xsd b/src/test/resources/loading/resources/reference.xsd
index 6f92671..9064e2c 100644
--- a/src/test/resources/loading/resources/reference.xsd
+++ b/src/test/resources/loading/resources/reference.xsd
@@ -1,4 +1,20 @@
+
+
From dd071da3b82ee00158127a40555551b3e2308e50 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Fri, 2 Oct 2020 11:32:42 +0200
Subject: [PATCH 033/210] (chore) fix typo
---
.../1.0.1/packaged-test-scenarios-1.0.1.pom | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/de/kosit/validationtool/packaged-test-scenarios/1.0.1/packaged-test-scenarios-1.0.1.pom b/libs/de/kosit/validationtool/packaged-test-scenarios/1.0.1/packaged-test-scenarios-1.0.1.pom
index e76786b..783a6b0 100644
--- a/libs/de/kosit/validationtool/packaged-test-scenarios/1.0.1/packaged-test-scenarios-1.0.1.pom
+++ b/libs/de/kosit/validationtool/packaged-test-scenarios/1.0.1/packaged-test-scenarios-1.0.1.pom
@@ -21,6 +21,6 @@
4.0.0de.kosit.validationtoolpackaged-test-scenarios
- 1.0.1/version>
+ 1.0.1POM was created from install:install-file
From 972badb37e7addbe169c2c32fd2cfef1d0ad0ca0 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Fri, 2 Oct 2020 11:37:45 +0200
Subject: [PATCH 034/210] (chore) Update CHANGELOG.md
---
CHANGELOG.md | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3b9af62..6de7afd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,7 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Fixed
- date conversion when using [ConfigurationBuilder#date(Date)](https://github.com/itplr-kosit/validator/blob/d7beb1040418ae5cbeb9427532fd87482f55756c/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java#L109)
-- [#51](https://github.com/itplr-kosit/validator/issues/51) Suffix of report xml is missing
+- [CLI] [#51](https://github.com/itplr-kosit/validator/issues/51) Suffix of report xml is missing
+- [#53](https://github.com/itplr-kosit/validator/issues/53) Fix copyright and licensing information
+- [#56](https://github.com/itplr-kosit/validator/issues/56) `namespace` element content needs trimming
+- [DAEMON] [#57](https://github.com/itplr-kosit/validator/issues/57) Reading large inputs correctly
### Added
- read saxon XdmNode with InputFactory
@@ -16,13 +19,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [CLI] options to set the log level (`-X` = full debug output, `-l ` set a specific level)
- [CLI] return code ist <> 0 on rejected results
- [CLI] read (single) test target from stdin
-- [DAEMON] name inputs via request URI (see [daemon documentation](./docs/daemon.md#status-codes))
+- [DAEMON] name inputs via request URI
### Changed
- InputFactory has methods to read any java.xml.transform.Source as Input not only StreamSources
- InputFactory uses a generated UUID as name for SourceInput, if no "real" name can be derived
- saxon dependency update (minor, 9.9.1-7)
-- [DAEMON] proper status codes when returning results
+- [DAEMON] proper status codes when returning results (see [daemon documentation](./docs/daemon.md#status-codes))
## 1.3.1
### Fixed
From 2c453fa17d71374efdcf71e3ab181eb78e228164 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Wed, 7 Oct 2020 16:59:57 +0200
Subject: [PATCH 035/210] (chore) update version
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 88e3412..1a773a8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
KoSIT XML Prüftool Implementierungde.kosit
- 1.3.2-SNAPSHOT
+ 1.4.0-SNAPSHOTvalidationtoolKoSIT XML Validator against XSD and Schematron based on defined scenarios.
From 2623fba56db601274063cb9c5c335eef8215d895 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Wed, 7 Oct 2020 17:02:35 +0200
Subject: [PATCH 036/210] [maven-release-plugin] prepare release v1.4.0
---
pom.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pom.xml b/pom.xml
index 1a773a8..67bc4a6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,13 +15,13 @@
~ limitations under the License.
-->
-
+4.0.0KoSIT XML Prüftool Implementierungde.kosit
- 1.4.0-SNAPSHOT
+ 1.4.0validationtoolKoSIT XML Validator against XSD and Schematron based on defined scenarios.
@@ -577,7 +577,7 @@
https://github.com/itplr-kosit/validationtool.gitscm:git:https://projekte.kosit.org/kosit/validator.git
- v1.1.0
+ v1.4.0
From 49152f004f788716ad3dbee16884354b717933cf Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Wed, 7 Oct 2020 17:02:40 +0200
Subject: [PATCH 037/210] [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 67bc4a6..ebe2131 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
KoSIT XML Prüftool Implementierungde.kosit
- 1.4.0
+ 1.4.1-SNAPSHOTvalidationtoolKoSIT XML Validator against XSD and Schematron based on defined scenarios.
@@ -577,7 +577,7 @@
https://github.com/itplr-kosit/validationtool.gitscm:git:https://projekte.kosit.org/kosit/validator.git
- v1.4.0
+ v1.1.0
From 4a6200b055c28177504db68a384a5db3e1df05da Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Wed, 7 Oct 2020 17:28:21 +0200
Subject: [PATCH 038/210] (chore) set version in CHANGELOG.md
---
CHANGELOG.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6de7afd..3378748 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,7 +5,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-## Unreleased
+## 1.4.0
+
### Fixed
- date conversion when using [ConfigurationBuilder#date(Date)](https://github.com/itplr-kosit/validator/blob/d7beb1040418ae5cbeb9427532fd87482f55756c/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java#L109)
- [CLI] [#51](https://github.com/itplr-kosit/validator/issues/51) Suffix of report xml is missing
From fd3451fef1d740deebff4c824fef7fbd3e4151ac Mon Sep 17 00:00:00 2001
From: Christian Schlichtherle
Date: Fri, 9 Oct 2020 22:46:34 +0200
Subject: [PATCH 039/210] Improve metadata for release to Maven Central.
---
.gitignore | 2 ++
pom.xml | 29 +++++++++++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/.gitignore b/.gitignore
index b0d4fc1..aecfb3a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,3 +41,5 @@ src/generated
# Testing stuff
xrechnung
+
+/.idea
diff --git a/pom.xml b/pom.xml
index ebe2131..ccaa9e9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -537,6 +537,18 @@
LF
+
+ maven-gpg-plugin
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
@@ -578,6 +590,23 @@
https://github.com/itplr-kosit/validationtool.gitscm:git:https://projekte.kosit.org/kosit/validator.gitv1.1.0
+ https://github.com/itplr-kosit/validator
+ https://github.com/itplr-kosit/validator
+
+
+ Apache License, Version 2.0
+ http://www.apache.org/licenses/LICENSE-2.0.txt
+ repo
+
+
+
+
+ sonatype-nexus-staging
+ Nexus Release Repository
+ https://oss.sonatype.org/service/local/staging/deploy/maven2
+
+
+
From 6ac1346fa9bc4915b2ef56f622df37e98b39e8f6 Mon Sep 17 00:00:00 2001
From: Stefan Blanke
Date: Mon, 12 Oct 2020 19:05:53 +0200
Subject: [PATCH 040/210] Add PHP example for using the HTTP daemon in docs.
(#61)
* Add PHP example for using the HTTP daemon in docs.
* Use procedural code for example snippet
* Remove this variable
---
docs/daemon.md | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/docs/daemon.md b/docs/daemon.md
index e3f7996..d49af40 100644
--- a/docs/daemon.md
+++ b/docs/daemon.md
@@ -86,6 +86,22 @@ fetch("http://localhost:8080", requestOptions)
.then(result => console.log(result))
.catch(error => console.log('error', error));
```
+
+* `PHP` (Symfony HttpClient)
+```php
+$httpClient = HttpClient::create();
+
+$response = $httpClient->request('POST', 'http://localhost:8080', [
+ 'headers' => [
+ 'Content-Type' => 'application/xml',
+ ],
+ 'body' => fopen('/path/to/some.xml', 'r'),
+]);
+
+echo $response->getContent();
+
+```
+
## Status codes
| code | description |
|-|-|
From f22fe6528024e5e284fa844d71fbdaa7863d232c Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 14 Oct 2020 13:30:23 +0200
Subject: [PATCH 041/210] Bump junit from 4.13 to 4.13.1 (#63)
Bumps [junit](https://github.com/junit-team/junit4) from 4.13 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.13...r4.13.1)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index ebe2131..e98c658 100644
--- a/pom.xml
+++ b/pom.xml
@@ -124,7 +124,7 @@
junitjunit
- 4.13
+ 4.13.1test
From 2c09da5f9d4c595b55b81b7ac4a84897cb893c82 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Wed, 14 Oct 2020 15:51:11 +0200
Subject: [PATCH 042/210] (chore) eol style defined
---
.gitattributes | 1 +
1 file changed, 1 insertion(+)
create mode 100644 .gitattributes
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..07764a7
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+* text eol=lf
\ No newline at end of file
From 4438038f225f98db213550a095d447da578cc21a Mon Sep 17 00:00:00 2001
From: Christian Schlichtherle
Date: Fri, 30 Oct 2020 18:54:43 +0100
Subject: [PATCH 043/210] Fix documentation.
---
docs/api.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/api.md b/docs/api.md
index 7999743..0e969f6 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -54,7 +54,7 @@ public class StandardExample {
// Load scenarios.xml from classpath
URL scenarios = this.getClass().getClassLoader().getResource("scenarios.xml");
// Load the rest of the specific Validator configuration from classpath
- Configuration config = Configuration.load(scenarios.toURI());
+ Configuration config = Configuration.load(scenarios.toURI()).build();
// Use the default validation procedure
Check validator = new DefaultCheck(config);
// Validate a single document
From 5f32e1d3b7f525ca9119486578acd1560ccd6c0c Mon Sep 17 00:00:00 2001
From: Christian Schlichtherle
Date: Fri, 30 Oct 2020 18:55:38 +0100
Subject: [PATCH 044/210] Ensure English locale for English messages.
---
src/main/java/de/kosit/validationtool/impl/Printer.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/main/java/de/kosit/validationtool/impl/Printer.java b/src/main/java/de/kosit/validationtool/impl/Printer.java
index 7e122d1..4a1e414 100644
--- a/src/main/java/de/kosit/validationtool/impl/Printer.java
+++ b/src/main/java/de/kosit/validationtool/impl/Printer.java
@@ -17,6 +17,7 @@
package de.kosit.validationtool.impl;
import java.text.MessageFormat;
+import java.util.Locale;
/**
* Wrapper for {@link System Systems} printing capability.
@@ -37,7 +38,7 @@ public class Printer {
* @param params the params.
*/
public static void writeOut(final String message, final Object... params) {
- System.out.println(MessageFormat.format(message, params));
+ System.out.println(new MessageFormat(message, Locale.ENGLISH).format(params));
}
/**
@@ -47,6 +48,6 @@ public class Printer {
* @param params the params.
*/
public static void writeErr(final String message, final Object... params) {
- System.err.println(MessageFormat.format(message, params));
+ System.err.println(new MessageFormat(message, Locale.ENGLISH).format(params));
}
}
From 555dad2ede44e40012f6e3c4ec79e168bc22084d Mon Sep 17 00:00:00 2001
From: Christian Schlichtherle
Date: Fri, 30 Oct 2020 18:56:03 +0100
Subject: [PATCH 045/210] Fix language.
---
src/main/java/de/kosit/validationtool/api/InputFactory.java | 4 ++--
.../de/kosit/validationtool/cmd/CommandLineApplication.java | 2 +-
src/main/java/de/kosit/validationtool/cmd/InternalCheck.java | 4 ++--
.../de/kosit/validationtool/config/ConfigurationLoader.java | 2 +-
.../java/de/kosit/validationtool/impl/ConversionService.java | 2 +-
src/main/java/de/kosit/validationtool/impl/ResolvingMode.java | 2 +-
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/main/java/de/kosit/validationtool/api/InputFactory.java b/src/main/java/de/kosit/validationtool/api/InputFactory.java
index 2f9a149..9a07430 100644
--- a/src/main/java/de/kosit/validationtool/api/InputFactory.java
+++ b/src/main/java/de/kosit/validationtool/api/InputFactory.java
@@ -133,7 +133,7 @@ public class InputFactory {
try {
return read(uri.toURL(), digestAlgorithm);
} catch (final MalformedURLException e) {
- throw new IllegalArgumentException(String.format("Can not read from uri %s Not a valid uri supplied", uri));
+ throw new IllegalArgumentException(String.format("URL invalid or protocol not supported: %s", uri), e);
}
}
@@ -149,7 +149,7 @@ public class InputFactory {
}
/**
- * Liest einen Prüfling von der übergebenen URL. Es wird ein definierter Algorithmis zur Ermittlung der Prüfsumme
+ * Liest einen Prüfling von der übergebenen URL. Es wird ein definierter Algorithmus zur Ermittlung der Prüfsumme
* genutzt.
*
* @param url URL des Prüflings
diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java
index ed3d474..de56cf5 100644
--- a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java
+++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java
@@ -67,7 +67,7 @@ public class CommandLineApplication {
private static void sayGoodby(final ReturnValue resultStatus) {
Printer.writeOut("\n##############################");
if (resultStatus.equals(ReturnValue.SUCCESS)) {
- Printer.writeOut("# " + new Line(Code.GREEN).add("Validation succesful!").render(false, false) + " #");
+ Printer.writeOut("# " + new Line(Code.GREEN).add("Validation successful!").render(false, false) + " #");
} else {
Printer.writeOut("# " + new Line(Code.RED).add("Validation failed!").render(false, false) + " #");
}
diff --git a/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java b/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
index 89c62ef..1f41d0a 100644
--- a/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
+++ b/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
@@ -38,8 +38,8 @@ import de.kosit.validationtool.impl.DefaultCheck;
import de.kosit.validationtool.impl.tasks.CheckAction;
/**
- * 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!
+ * Simple Erweiterung der Klasse {@link DefaultCheck} um das Ergebnis der Assertion-Prüfung auszuwerten und auszugeben.
+ * Diese Klasse stellt keine fachliche Erweiterung des eigentlichen Prüfvorganges dar!
*
* @author Andreas Penski
*/
diff --git a/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java b/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java
index bb78427..6e2f788 100644
--- a/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java
+++ b/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java
@@ -55,7 +55,7 @@ import net.sf.saxon.s9api.XdmNode;
import net.sf.saxon.s9api.XdmNodeKind;
/**
- * Configuration class that loads neccessary {@link Check} configuration from an existing scenario.xml specification.
+ * Configuration class that loads necessary {@link Check} configuration from an existing scenario.xml specification.
* This is the recommended option when an official configuration exists as is the case with 'xrechnung'.
*
* @author Andreas Penski
diff --git a/src/main/java/de/kosit/validationtool/impl/ConversionService.java b/src/main/java/de/kosit/validationtool/impl/ConversionService.java
index aa32859..dfc16d1 100644
--- a/src/main/java/de/kosit/validationtool/impl/ConversionService.java
+++ b/src/main/java/de/kosit/validationtool/impl/ConversionService.java
@@ -147,7 +147,7 @@ public class ConversionService {
}
/**
- * Unmarshalls a specifc xml model into a defined java object.
+ * Unmarshalls a specific XML model into a defined Java object.
*
* @param xml the xml
* @param type the expected type created
diff --git a/src/main/java/de/kosit/validationtool/impl/ResolvingMode.java b/src/main/java/de/kosit/validationtool/impl/ResolvingMode.java
index 7a0ab65..a668bf1 100644
--- a/src/main/java/de/kosit/validationtool/impl/ResolvingMode.java
+++ b/src/main/java/de/kosit/validationtool/impl/ResolvingMode.java
@@ -33,7 +33,7 @@ import de.kosit.validationtool.impl.xml.StrictRelativeResolvingStrategy;
public enum ResolvingMode {
/**
- * Resolving using only the configured content repository. No furthing resolving allowed. This
+ * Resolving using only the configured content repository.
*/
STRICT_RELATIVE(new StrictRelativeResolvingStrategy()) {
From 06c89f40a95b9c483806a2cd56b50f0ce96de326 Mon Sep 17 00:00:00 2001
From: Raphael <4246780+reitzig@users.noreply.github.com>
Date: Mon, 9 Nov 2020 12:13:28 +0100
Subject: [PATCH 046/210] Update README.md
Add a note on dependencies with Java 11+
---
README.md | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 6b91c6c..0fd508e 100644
--- a/README.md
+++ b/README.md
@@ -83,6 +83,10 @@ Result validationResult = validator.checkInput(document);
The [API documentation](./docs/api.md) shows further configuration options.
+**Note:** With Java 11+, you need to include a dependency to `org.glassfish.jaxb:jaxb-runtime` in your project explicitly,
+as that dependency is marked `optional` in this project and
+will thus not be resolved transitively.
+
### Daemon-Mode
You can also start the validator as a HTTP-Server. Just start it in _Daemon-Mode_ with the `-D` option.
@@ -101,4 +105,4 @@ The validator distribution contains the following artifacts:
1. **validationtool-``.jar**: Java library for embedded use within an application
1. **validationtool-`-standalone.jar**: Uber-JAR for standalone usage containing all dependencies in one jar file. This file comes with JAXB *embedded* and can be used with Java 8 and Java >= 11)
1. **validationtool-`-java8-standalone.jar**: Uber-JAR for standalone usage with Java JDK 8 containing all dependencies in one jar file. This file file *does not* contain JAXB and depends on the bundled version of the JDK.
-1. **libs/***: directory containing all (incl. optional) dependencies of the validator
\ No newline at end of file
+1. **libs/***: directory containing all (incl. optional) dependencies of the validator
From 34a109d8e6044e2ecb4a958ab5435685a4860fa4 Mon Sep 17 00:00:00 2001
From: Andreas Penski
Date: Thu, 17 Dec 2020 07:20:10 +0000
Subject: [PATCH 047/210] (chore) fix api usage
---
docs/api.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/api.md b/docs/api.md
index 7999743..0e969f6 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -54,7 +54,7 @@ public class StandardExample {
// Load scenarios.xml from classpath
URL scenarios = this.getClass().getClassLoader().getResource("scenarios.xml");
// Load the rest of the specific Validator configuration from classpath
- Configuration config = Configuration.load(scenarios.toURI());
+ Configuration config = Configuration.load(scenarios.toURI()).build();
// Use the default validation procedure
Check validator = new DefaultCheck(config);
// Validate a single document
From 705d31fdc81dae750af4d23ce2253aca30d3729b Mon Sep 17 00:00:00 2001
From: Renzo Kottmann
Date: Mon, 21 Dec 2020 07:26:36 +0000
Subject: [PATCH 048/210] Resolve "Allow more than 3 customLevel elements in
scenarios"
---
.gitignore | 2 +-
CHANGELOG.md | 13 ++++++++++---
src/main/model/xsd/scenarios.xsd | 2 +-
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/.gitignore b/.gitignore
index b0d4fc1..8d2ff7e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,6 +38,6 @@ src/generated
.settings
.vscode
*.code-workspace
-
+*.xpr
# Testing stuff
xrechnung
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3378748..afc518e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,16 +5,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+### Fixed
+
+- Allow more than 3 customLevel elements in scenarios
+
## 1.4.0
### Fixed
-- date conversion when using [ConfigurationBuilder#date(Date)](https://github.com/itplr-kosit/validator/blob/d7beb1040418ae5cbeb9427532fd87482f55756c/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java#L109)
+
+- date conversion when
+ using [ConfigurationBuilder#date(Date)](https://github.com/itplr-kosit/validator/blob/d7beb1040418ae5cbeb9427532fd87482f55756c/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java#L109)
- [CLI] [#51](https://github.com/itplr-kosit/validator/issues/51) Suffix of report xml is missing
- [#53](https://github.com/itplr-kosit/validator/issues/53) Fix copyright and licensing information
-- [#56](https://github.com/itplr-kosit/validator/issues/56) `namespace` element content needs trimming
-- [DAEMON] [#57](https://github.com/itplr-kosit/validator/issues/57) Reading large inputs correctly
+- [#56](https://github.com/itplr-kosit/validator/issues/56) `namespace` element content needs trimming
+- [DAEMON] [#57](https://github.com/itplr-kosit/validator/issues/57) Reading large inputs correctly
### Added
+
- read saxon XdmNode with InputFactory
- [CLI] custom output without the various log messages
- [CLI] options to set the log level (`-X` = full debug output, `-l ` set a specific level)
diff --git a/src/main/model/xsd/scenarios.xsd b/src/main/model/xsd/scenarios.xsd
index b626c06..ef432e2 100644
--- a/src/main/model/xsd/scenarios.xsd
+++ b/src/main/model/xsd/scenarios.xsd
@@ -126,7 +126,7 @@
-
+
From 7b8647c8c4a68ed66da5efded60d23d44f357e0e Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Mon, 21 Dec 2020 08:48:14 +0100
Subject: [PATCH 049/210] (fix) remove saxon signatature from uber-jar see
https://github.com/itplr-kosit/validator-configuration-xrechnung/issues/49
---
CHANGELOG.md | 4 +++-
pom.xml | 17 ++++++++++++-----
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index afc518e..924ed33 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
-- Allow more than 3 customLevel elements in scenarios
+- Allow more than 3 customLevel elements in scenarios (see xrechnung
+ configuration [ issue 49](https://github.com/itplr-kosit/validator-configuration-xrechnung/issues/49))
+- Remove saxon signature from java8 uber-jar (see [67](https://github.com/itplr-kosit/validator/issues/67))
## 1.4.0
diff --git a/pom.xml b/pom.xml
index e98c658..e8459c9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,7 +15,7 @@
~ limitations under the License.
-->
-
+4.0.0KoSIT XML Prüftool Implementierung
@@ -273,11 +273,18 @@
de.kosit.validationtool.cmd.CommandLineApplication
-
-
- META-INF/TE-050AC.SF
-
+
+
+ *:*
+
+ META-INF/*.SF
+ META-INF/*.DSA
+ META-INF/*.RSA
+ **/module-info.class
+
+
+
From 5f8a64d9da998b137c784dc61f47195e985863d7 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Mon, 21 Dec 2020 08:58:09 +0100
Subject: [PATCH 050/210] (chore) prepare release
---
CHANGELOG.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 924ed33..7219df8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## 1.4.1
+
### Fixed
- Allow more than 3 customLevel elements in scenarios (see xrechnung
From fb29933d98d2b1822f1d385b21597c2ecdac753d Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Mon, 21 Dec 2020 09:00:58 +0100
Subject: [PATCH 051/210] [maven-release-plugin] prepare release v1.4.1
---
pom.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pom.xml b/pom.xml
index e8459c9..231bbd0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,13 +15,13 @@
~ limitations under the License.
-->
-
+4.0.0KoSIT XML Prüftool Implementierungde.kosit
- 1.4.1-SNAPSHOT
+ 1.4.1validationtoolKoSIT XML Validator against XSD and Schematron based on defined scenarios.
@@ -584,7 +584,7 @@
https://github.com/itplr-kosit/validationtool.gitscm:git:https://projekte.kosit.org/kosit/validator.git
- v1.1.0
+ v1.4.1
From 7e5f0093d42de47f6c95b0697349f45bc6e27c81 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Mon, 21 Dec 2020 09:01:04 +0100
Subject: [PATCH 052/210] [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 231bbd0..97aa594 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
KoSIT XML Prüftool Implementierungde.kosit
- 1.4.1
+ 1.4.2-SNAPSHOTvalidationtoolKoSIT XML Validator against XSD and Schematron based on defined scenarios.
@@ -584,7 +584,7 @@
https://github.com/itplr-kosit/validationtool.gitscm:git:https://projekte.kosit.org/kosit/validator.git
- v1.4.1
+ v1.1.0
From ea3c9d294f91c2deb4cbb96b68a7901dfe74a7e6 Mon Sep 17 00:00:00 2001
From: Christian Schlichtherle
Date: Mon, 21 Dec 2020 19:21:38 +0100
Subject: [PATCH 053/210] Revert change.
---
.gitignore | 2 --
1 file changed, 2 deletions(-)
diff --git a/.gitignore b/.gitignore
index d05cb58..8d2ff7e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,5 +41,3 @@ src/generated
*.xpr
# Testing stuff
xrechnung
-
-/.idea
From 69a2f8503467fe17b6e3605f1d3bb75b9fa472d3 Mon Sep 17 00:00:00 2001
From: Christian Schlichtherle
Date: Mon, 21 Dec 2020 19:32:40 +0100
Subject: [PATCH 054/210] Add version for maven-gpg-plugin.
---
pom.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/pom.xml b/pom.xml
index 66c5325..4d8dc45 100644
--- a/pom.xml
+++ b/pom.xml
@@ -546,6 +546,7 @@
maven-gpg-plugin
+ 1.6sign-artifacts
From 44403d82c90b86452e0cd19ee09d5330f870240e Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Tue, 2 Feb 2021 08:55:20 +0100
Subject: [PATCH 055/210] Update copyright year to 2021.
---
.idea/copyright/KoSIT_Validator.xml | 2 +-
formatter.xml | 2 +-
.../1.0.1/packaged-test-scenarios-1.0.1.pom | 2 +-
.../packaged-test-scenarios/maven-metadata-local.xml | 2 +-
pom.xml | 2 +-
src/assembly/assembly-dist.xml | 2 +-
.../de/kosit/validationtool/api/AcceptRecommendation.java | 2 +-
src/main/java/de/kosit/validationtool/api/Check.java | 2 +-
.../de/kosit/validationtool/api/CheckConfiguration.java | 2 +-
.../java/de/kosit/validationtool/api/Configuration.java | 2 +-
src/main/java/de/kosit/validationtool/api/Input.java | 2 +-
.../java/de/kosit/validationtool/api/InputFactory.java | 2 +-
.../validationtool/api/ResolvingConfigurationStrategy.java | 2 +-
src/main/java/de/kosit/validationtool/api/Result.java | 2 +-
src/main/java/de/kosit/validationtool/api/XmlError.java | 2 +-
.../de/kosit/validationtool/cmd/CheckAssertionAction.java | 2 +-
.../kosit/validationtool/cmd/CommandLineApplication.java | 2 +-
.../de/kosit/validationtool/cmd/CommandLineOptions.java | 2 +-
.../de/kosit/validationtool/cmd/DefaultNamingStrategy.java | 2 +-
.../kosit/validationtool/cmd/ExtractHtmlContentAction.java | 2 +-
.../java/de/kosit/validationtool/cmd/InternalCheck.java | 2 +-
.../java/de/kosit/validationtool/cmd/NamingStrategy.java | 2 +-
.../java/de/kosit/validationtool/cmd/PrintMemoryStats.java | 2 +-
.../de/kosit/validationtool/cmd/PrintReportAction.java | 2 +-
src/main/java/de/kosit/validationtool/cmd/ReturnValue.java | 2 +-
.../de/kosit/validationtool/cmd/SerializeReportAction.java | 2 +-
.../validationtool/cmd/SerializeReportInputAction.java | 2 +-
src/main/java/de/kosit/validationtool/cmd/Validator.java | 2 +-
.../java/de/kosit/validationtool/cmd/report/Format.java | 2 +-
src/main/java/de/kosit/validationtool/cmd/report/Grid.java | 2 +-
.../java/de/kosit/validationtool/cmd/report/Justify.java | 2 +-
src/main/java/de/kosit/validationtool/cmd/report/Line.java | 2 +-
src/main/java/de/kosit/validationtool/cmd/report/Text.java | 2 +-
src/main/java/de/kosit/validationtool/config/Builder.java | 2 +-
.../kosit/validationtool/config/ConfigurationBuilder.java | 2 +-
.../kosit/validationtool/config/ConfigurationLoader.java | 2 +-
.../kosit/validationtool/config/DefaultConfiguration.java | 2 +-
.../de/kosit/validationtool/config/FallbackBuilder.java | 2 +-
src/main/java/de/kosit/validationtool/config/Keys.java | 2 +-
.../java/de/kosit/validationtool/config/ReportBuilder.java | 2 +-
.../de/kosit/validationtool/config/ScenarioBuilder.java | 2 +-
.../java/de/kosit/validationtool/config/SchemaBuilder.java | 2 +-
.../de/kosit/validationtool/config/SchematronBuilder.java | 2 +-
.../java/de/kosit/validationtool/config/XPathBuilder.java | 2 +-
.../java/de/kosit/validationtool/daemon/BaseHandler.java | 2 +-
.../java/de/kosit/validationtool/daemon/CheckHandler.java | 2 +-
.../java/de/kosit/validationtool/daemon/ConfigHandler.java | 2 +-
src/main/java/de/kosit/validationtool/daemon/Daemon.java | 2 +-
.../java/de/kosit/validationtool/daemon/GuiHandler.java | 2 +-
.../java/de/kosit/validationtool/daemon/HealthHandler.java | 2 +-
.../java/de/kosit/validationtool/daemon/HttpStatus.java | 2 +-
.../de/kosit/validationtool/daemon/RoutingHandler.java | 2 +-
.../validationtool/impl/ClassPathResourceResolver.java | 2 +-
.../validationtool/impl/CollectingErrorEventHandler.java | 2 +-
.../de/kosit/validationtool/impl/ContentRepository.java | 2 +-
.../de/kosit/validationtool/impl/ConversionService.java | 2 +-
.../java/de/kosit/validationtool/impl/DateFactory.java | 2 +-
.../java/de/kosit/validationtool/impl/DefaultCheck.java | 2 +-
.../java/de/kosit/validationtool/impl/DefaultResult.java | 2 +-
.../de/kosit/validationtool/impl/EngineInformation.java | 2 +-
.../java/de/kosit/validationtool/impl/HtmlExtractor.java | 2 +-
src/main/java/de/kosit/validationtool/impl/Printer.java | 2 +-
.../java/de/kosit/validationtool/impl/ResolvingMode.java | 2 +-
src/main/java/de/kosit/validationtool/impl/Scenario.java | 2 +-
.../de/kosit/validationtool/impl/ScenarioRepository.java | 2 +-
.../de/kosit/validationtool/impl/input/AbstractInput.java | 2 +-
.../de/kosit/validationtool/impl/input/ByteArrayInput.java | 2 +-
.../de/kosit/validationtool/impl/input/LazyReadInput.java | 2 +-
.../de/kosit/validationtool/impl/input/ResourceInput.java | 2 +-
.../de/kosit/validationtool/impl/input/SourceInput.java | 2 +-
.../de/kosit/validationtool/impl/input/StreamHelper.java | 2 +-
.../de/kosit/validationtool/impl/input/XdmNodeInput.java | 2 +-
.../de/kosit/validationtool/impl/model/BaseOutput.java | 2 +-
.../validationtool/impl/model/BaseXMLSyntaxError.java | 2 +-
.../java/de/kosit/validationtool/impl/model/Result.java | 2 +-
.../de/kosit/validationtool/impl/tasks/CheckAction.java | 2 +-
.../validationtool/impl/tasks/ComputeAcceptanceAction.java | 2 +-
.../impl/tasks/CreateDocumentIdentificationAction.java | 2 +-
.../validationtool/impl/tasks/CreateReportAction.java | 2 +-
.../validationtool/impl/tasks/DocumentParseAction.java | 2 +-
.../validationtool/impl/tasks/ScenarioSelectionAction.java | 2 +-
.../validationtool/impl/tasks/SchemaValidationAction.java | 2 +-
.../impl/tasks/SchematronValidationAction.java | 2 +-
.../impl/tasks/ValidateReportInputAction.java | 2 +-
.../validationtool/impl/xml/BaseResolvingStrategy.java | 2 +-
.../kosit/validationtool/impl/xml/RelativeUriResolver.java | 2 +-
.../validationtool/impl/xml/RemoteResolvingStrategy.java | 2 +-
.../impl/xml/StrictLocalResolvingStrategy.java | 2 +-
.../impl/xml/StrictRelativeResolvingStrategy.java | 2 +-
.../kosit/validationtool/impl/xml/StringTrimAdapter.java | 2 +-
src/main/model/binding/global.xjb | 2 +-
src/main/model/xsd/assertions.xsd | 2 +-
src/main/model/xsd/createReportInput.xsd | 2 +-
src/main/model/xsd/daemon.xsd | 2 +-
src/main/model/xsd/scenarios.xsd | 2 +-
src/main/model/xsd/svrl-kosit.xsd | 2 +-
src/main/model/xsd/xml.xsd | 2 +-
src/main/resources/app-info.properties | 2 +-
src/main/resources/gui/index.html | 2 +-
src/main/resources/simplelogger.properties | 7 +------
.../kosit/validationtool/api/CheckConfigurationTest.java | 2 +-
.../java/de/kosit/validationtool/api/InputFactoryTest.java | 2 +-
.../kosit/validationtool/cmd/CheckAssertionActionTest.java | 2 +-
src/test/java/de/kosit/validationtool/cmd/CommandLine.java | 2 +-
.../validationtool/cmd/CommandlineApplicationTest.java | 2 +-
.../validationtool/cmd/DefaultNamingStrategyTest.java | 2 +-
.../de/kosit/validationtool/cmd/ExtractHtmlActionTest.java | 2 +-
.../de/kosit/validationtool/cmd/PrintReportActionTest.java | 2 +-
.../validationtool/cmd/SerializeReportActionTest.java | 2 +-
.../validationtool/cmd/SerializeReportInputActionTest.java | 2 +-
.../validationtool/config/ConfigurationBuilderTest.java | 2 +-
.../validationtool/config/ConfigurationLoaderTest.java | 2 +-
.../kosit/validationtool/config/ScenarioBuilderTest.java | 2 +-
.../de/kosit/validationtool/config/SchemaBuilderTest.java | 2 +-
.../de/kosit/validationtool/config/SimpleConfigTest.java | 2 +-
.../de/kosit/validationtool/config/TestConfiguration.java | 2 +-
.../validationtool/config/TestConfigurationFactory.java | 2 +-
.../de/kosit/validationtool/config/XPathBuilderTest.java | 2 +-
src/test/java/de/kosit/validationtool/daemon/BaseIT.java | 2 +-
.../de/kosit/validationtool/daemon/CheckHandlerIT.java | 2 +-
.../de/kosit/validationtool/daemon/ConfigHandlerIT.java | 2 +-
.../de/kosit/validationtool/daemon/ConfigHandlerTest.java | 2 +-
.../java/de/kosit/validationtool/daemon/GuiHandlerIT.java | 2 +-
.../de/kosit/validationtool/daemon/HealthHandlerIT.java | 2 +-
.../kosit/validationtool/impl/ContentRepositoryTest.java | 2 +-
.../kosit/validationtool/impl/ConversionServiceTest.java | 2 +-
.../de/kosit/validationtool/impl/DefaultCheckTest.java | 2 +-
src/test/java/de/kosit/validationtool/impl/Helper.java | 2 +-
.../kosit/validationtool/impl/RelativeUriResolverTest.java | 2 +-
.../kosit/validationtool/impl/ScenarioRepositoryTest.java | 2 +-
.../kosit/validationtool/impl/SimpleScenarioCheckTest.java | 2 +-
.../de/kosit/validationtool/impl/TestObjectFactory.java | 2 +-
.../java/de/kosit/validationtool/impl/VersioningTest.java | 2 +-
.../impl/tasks/ComputeAcceptanceActionTest.java | 2 +-
.../validationtool/impl/tasks/CreateReportActionTest.java | 2 +-
.../validationtool/impl/tasks/DocumentParseActionTest.java | 2 +-
.../impl/tasks/SchemaValidatorActionTest.java | 2 +-
.../impl/tasks/SchematronValidationActionTest.java | 2 +-
.../de/kosit/validationtool/impl/tasks/TestBagBuilder.java | 2 +-
.../impl/xml/BaseResolverConfigurationTest.java | 2 +-
.../impl/xml/RemoteResolvingStrategyTest.java | 2 +-
.../kosit/validationtool/impl/xml/SaxonSecurityTest.java | 2 +-
.../validationtool/impl/xml/StrictLocalResolvingTest.java | 2 +-
.../impl/xml/StrictRelativeResolvingTest.java | 2 +-
src/test/resources/evil/evil1.xsl | 2 +-
src/test/resources/evil/evil2.xsl | 2 +-
src/test/resources/evil/evil3.xsl | 2 +-
src/test/resources/evil/evil4.xsl | 2 +-
src/test/resources/evil/evil5.xsl | 2 +-
src/test/resources/evil/xxe.xml | 2 +-
src/test/resources/examples/assertions/tests-xrechnung.xml | 2 +-
src/test/resources/examples/assertions/ubl-0001-report.xml | 2 +-
src/test/resources/examples/assertions/ubl-0001.xml | 2 +-
src/test/resources/examples/assertions/ubl-0002.xml | 2 +-
.../resources/examples/invalid/scenarios-illforned.xml | 2 +-
src/test/resources/examples/invalid/scenarios.xml | 2 +-
src/test/resources/examples/resolving/main.xsd | 2 +-
.../resources/examples/resolving/resources/reference.xsd | 2 +-
src/test/resources/examples/resolving/withRemote.xsd | 2 +-
src/test/resources/examples/simple/assertions.xml | 2 +-
.../examples/simple/input/foo-schematron-invalid.xml | 2 +-
src/test/resources/examples/simple/input/foo.xml | 2 +-
.../examples/simple/input/simple-not-wellformed.xml | 2 +-
.../examples/simple/input/simple-schema-invalid.xml | 2 +-
.../examples/simple/input/simple-schematron-invalid.xml | 2 +-
src/test/resources/examples/simple/input/simple.xml | 2 +-
src/test/resources/examples/simple/input/unknown.xml | 2 +-
.../resources/examples/simple/input/withManualReject.xml | 2 +-
src/test/resources/examples/simple/repository/report.xsl | 2 +-
.../examples/simple/repository/simple-schematron-error.xsl | 2 +-
src/test/resources/examples/simple/repository/simple.xsd | 2 +-
src/test/resources/examples/simple/repository/simple.xsl | 2 +-
.../resources/examples/simple/scenarios-with-errors.xml | 2 +-
src/test/resources/examples/simple/scenarios.xml | 2 +-
src/test/resources/examples/versioning/scenarios-base.xml | 2 +-
.../resources/examples/versioning/scenarios-increment.xml | 2 +-
.../resources/examples/versioning/scenarios-newfeature.xml | 2 +-
.../resources/examples/versioning/scenarios-newversion.xml | 2 +-
src/test/resources/loading/main.xsd | 2 +-
src/test/resources/loading/resources/reference.xsd | 2 +-
180 files changed, 180 insertions(+), 185 deletions(-)
diff --git a/.idea/copyright/KoSIT_Validator.xml b/.idea/copyright/KoSIT_Validator.xml
index 114e72d..d519937 100644
--- a/.idea/copyright/KoSIT_Validator.xml
+++ b/.idea/copyright/KoSIT_Validator.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/formatter.xml b/formatter.xml
index 5ddad2b..b1b38c0 100644
--- a/formatter.xml
+++ b/formatter.xml
@@ -1,6 +1,6 @@
-
+4.0.0KoSIT XML Prüftool Implementierung
@@ -544,6 +544,7 @@
LF
+
From 6379da2e8f6b1f46600e468ceed3584616ad4d77 Mon Sep 17 00:00:00 2001
From: Raphael <4246780+reitzig@users.noreply.github.com>
Date: Wed, 3 Feb 2021 10:41:36 +0100
Subject: [PATCH 057/210] Do not log error on invalid document
Relates to issue #75
---
.../validationtool/impl/tasks/ScenarioSelectionAction.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/de/kosit/validationtool/impl/tasks/ScenarioSelectionAction.java b/src/main/java/de/kosit/validationtool/impl/tasks/ScenarioSelectionAction.java
index f441797..c1b8f15 100644
--- a/src/main/java/de/kosit/validationtool/impl/tasks/ScenarioSelectionAction.java
+++ b/src/main/java/de/kosit/validationtool/impl/tasks/ScenarioSelectionAction.java
@@ -53,7 +53,7 @@ public class ScenarioSelectionAction implements CheckAction {
report.setScenario(scenarioTypeResult.getObject().getConfiguration());
log.info("Scenario {} identified for {}", scenarioTypeResult.getObject().getName(), results.getInput().getName());
} else {
- log.error("No valid scenario configuration found for {}", results.getInput().getName());
+ log.info("No valid scenario configuration found for {}", results.getInput().getName());
}
}
From 1d586699f690d40b3405f774e8b5f0467ff83303 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Wed, 7 Apr 2021 15:28:00 +0200
Subject: [PATCH 058/210] (chore) gpg sign within specific profile
---
pom.xml | 44 ++++++++++++++++++++++++++++----------------
1 file changed, 28 insertions(+), 16 deletions(-)
diff --git a/pom.xml b/pom.xml
index b34647f..c255bce 100644
--- a/pom.xml
+++ b/pom.xml
@@ -544,25 +544,38 @@
LF
-
+
+
+
+ release-sign-artifacts
+
+
+ performRelease
+ true
+
+
+
+
+
+ maven-gpg-plugin
+ 1.6
+
+
+ sign-artifacts
+ verify
+
+ sign
+
+
+
+
+
+
+ formatfalse
@@ -602,7 +615,6 @@
v1.1.0https://github.com/itplr-kosit/validator
-
https://github.com/itplr-kosit/validator
From 2747eeb42d25b34be8aa1985ac4172016e506f59 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Fri, 9 Apr 2021 09:29:04 +0200
Subject: [PATCH 059/210] #74 Initialize ANSI console correctly
---
.../de/kosit/validationtool/cmd/CommandLineApplication.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java
index a9a81aa..54001a3 100644
--- a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java
+++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java
@@ -29,6 +29,7 @@ import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
+import org.fusesource.jansi.AnsiConsole;
import org.fusesource.jansi.AnsiRenderer.Code;
import de.kosit.validationtool.cmd.report.Line;
@@ -55,6 +56,7 @@ public class CommandLineApplication {
* @param args die Eingabe-Argumente
*/
public static void main(final String[] args) {
+ AnsiConsole.systemInstall();
final ReturnValue resultStatus = mainProgram(args);
if (!resultStatus.equals(ReturnValue.DAEMON_MODE)) {
sayGoodby(resultStatus);
From 456c315d2374c8397a4cc1c00eccbb2e939c4eab Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Fri, 9 Apr 2021 09:40:40 +0200
Subject: [PATCH 060/210] (chore) add ansi fix to CHANGELOG.md
---
CHANGELOG.md | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7219df8..280eb9c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## 1.4.2
+
+### Fixed
+
+- [CLI] [#74](https://projekte.kosit.org/kosit/validator/-/issues/74) fix ansi output of the cli version
+
## 1.4.1
### Fixed
From 7726a63a006f58fa5fc95b9da85e462c082f7b87 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Fri, 9 Apr 2021 09:45:06 +0200
Subject: [PATCH 061/210] https://github.com/itplr-kosit/validator/issues/80
use classloader to initialize jaxb context
---
CHANGELOG.md | 2 ++
.../java/de/kosit/validationtool/impl/ConversionService.java | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 280eb9c..39f7386 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- [CLI] [#74](https://projekte.kosit.org/kosit/validator/-/issues/74) fix ansi output of the cli version
+- [#80](https://github.com/itplr-kosit/validator/issues/80) using classloader to initialize jaxb context (to support usage in OSGi
+ environments)
## 1.4.1
diff --git a/src/main/java/de/kosit/validationtool/impl/ConversionService.java b/src/main/java/de/kosit/validationtool/impl/ConversionService.java
index 8871b43..190433d 100644
--- a/src/main/java/de/kosit/validationtool/impl/ConversionService.java
+++ b/src/main/java/de/kosit/validationtool/impl/ConversionService.java
@@ -140,7 +140,7 @@ public class ConversionService {
*/
private void initialize(final String contextPath) {
try {
- this.jaxbContext = JAXBContext.newInstance(contextPath);
+ this.jaxbContext = JAXBContext.newInstance(contextPath, ConversionService.class.getClassLoader());
} catch (final JAXBException e) {
throw new IllegalStateException(String.format("Can not create JAXB context for given context: %s", contextPath), e);
}
From 259accd726259b84e8a797f7a3e5ee5328d5b7dd Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 18 May 2021 09:17:03 +0000
Subject: [PATCH 062/210] Bump commons-io from 2.6 to 2.7
Bumps commons-io from 2.6 to 2.7.
Signed-off-by: dependabot[bot]
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index c255bce..ea492fe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -130,7 +130,7 @@
commons-iocommons-io
- 2.6
+ 2.7io.rest-assured
From 59c48f3918b12ac4d580fbbcccda55d4e854cc77 Mon Sep 17 00:00:00 2001
From: Andreas Penski
Date: Wed, 19 May 2021 09:06:35 +0000
Subject: [PATCH 063/210] Optimize ci
---
.gitlab-ci.yml | 28 +++++++++++++++++++++++++++-
.settings/settings.xml | 31 +++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+), 1 deletion(-)
create mode 100644 .settings/settings.xml
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 039bbdd..14ee8cb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,16 +2,22 @@ image: maven:latest
variables:
BUILD_PROPS: "-Dbuild.revision=$CI_COMMIT_SHA -Dbuild.branch=$CI_COMMIT_REF_NAME -Dbuild.number=$CI_PIPELINE_IID "
- MAVEN_CLI_OPTS: " --batch-mode -Dmaven.repo.local=/cache/repository -Dfile.encoding=UTF-8"
+ MAVEN_CLI_OPTS: " --batch-mode -Dmaven.repo.local=repository -Dfile.encoding=UTF-8 -s .settings/settings.xml"
before_script:
- export CI_JOB_TIMESTAMP="-Dbuild.timestamp=$(date --utc --iso-8601=seconds)"
+cache:
+ key: maven
+ paths:
+ - repository
+
build-amazoncorretto:
stage: build
image: maven:amazoncorretto
script:
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
+ retry: 2
artifacts:
name: amazoncorretto
paths:
@@ -26,6 +32,7 @@ build-java-14:
image: maven:3-jdk-14
script:
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
+ retry: 2
artifacts:
when: on_failure
name: java-14
@@ -41,6 +48,7 @@ build-java-11-openj9:
image: maven:3-jdk-11-openj9
script:
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
+ retry: 2
artifacts:
name: java-11-openj9
paths:
@@ -55,6 +63,7 @@ build-java-11:
image: maven:3-jdk-11
script:
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
+ retry: 2
artifacts:
name: java-11
paths:
@@ -70,6 +79,7 @@ build-java-8-openj9:
image: maven:3-jdk-8-openj9
script:
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
+ retry: 2
artifacts:
name: java-8-open-j9
paths:
@@ -84,6 +94,7 @@ build-java8:
image: maven:3-jdk-8-alpine
script:
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
+ retry: 2
artifacts:
name: java-8-alpine
paths:
@@ -92,3 +103,18 @@ build-java8:
junit:
- target/surefire-reports/*.xml
- target/failsafe-reports/*.xml
+
+deploy:
+ stage: deploy
+ image: maven:3-jdk-11
+ dependencies:
+ - build-java-11
+ script:
+ - export PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
+ - mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}.zip -DgroupId=kosit -DartifactId=validator -Dclassifier="distribution" -Dversion=${PROJECT_VERSION} -Dpackaging=zip -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
+ - mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}.jar -DgroupId=kosit -DartifactId=validator -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
+ - mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}-javadoc.jar -DgroupId=kosit -DartifactId=validator -Dclassifier="javadoc" -Dversion=${PROJECT_VERSION} -Dpackaging=zip -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
+ - mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}-standalone.jar -DgroupId=kosit -DartifactId=validator -Dclassifier="standalone" -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
+ - mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}-java8-standalone.jar -DgroupId=kosit -DartifactId=validator -Dclassifier="java8-standalone" -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
+ - mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}-sources.jar -DgroupId=kosit -DartifactId=validator -Dclassifier="sources" -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
+ when: manual
diff --git a/.settings/settings.xml b/.settings/settings.xml
new file mode 100644
index 0000000..fea048f
--- /dev/null
+++ b/.settings/settings.xml
@@ -0,0 +1,31 @@
+
+
+
+
+ gitlab-maven
+
+
+
+ Job-Token
+ ${env.CI_JOB_TOKEN}
+
+
+
+
+
+
\ No newline at end of file
From 2e16883cc94b1f79f8a1382331424a11e7bc540c Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Wed, 19 May 2021 12:20:07 +0200
Subject: [PATCH 064/210] fix link
---
docs/architecture.md | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/docs/architecture.md b/docs/architecture.md
index 18eb16c..73ded1e 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -1,9 +1,10 @@
# General Architecture
-The validator itself is just an engine which executes validation according to a certain configuration (see [configuration documentation](docs/configurations.md)).
+The validator itself is just an engine which executes validation according to a certain configuration (
+see [configuration documentation](configurations.md)).
-The validator takes a scenario.xml and the configured directory with all artifacts necessary for validation (scenario repository). Then it performs
-the validation and generates a report in XML format. This report is then the input to an XSLT provided by the configuration.
+The validator takes a scenario.xml and the configured directory with all artifacts necessary for validation (scenario repository). Then it
+performs the validation and generates a report in XML format. This report is then the input to an XSLT provided by the configuration.
## Separation of concerns
From 941becc694febe87d50fe94c1cda8078395151bb Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Thu, 20 May 2021 10:59:50 +0200
Subject: [PATCH 065/210] (chore) upgrade jaxb version
---
pom.xml | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index ea492fe..83720d0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,6 +55,7 @@
UTF-80.8.5
+ 2.3.41.18.129.9.1-71.7.25
@@ -112,7 +113,7 @@
org.glassfish.jaxbjaxb-runtime
- 2.3.3
+ ${version.jaxb}true
@@ -342,6 +343,14 @@
+
+
+ org.glassfish.jaxb
+ jaxb-runtime
+ ${version.jaxb}
+ true
+
+
From cd2eb9a0a01fd2045fd8d4bcc92b0cf5123b5592 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Thu, 20 May 2021 11:00:04 +0200
Subject: [PATCH 066/210] (chore) upgrade lombok
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 83720d0..c27a373 100644
--- a/pom.xml
+++ b/pom.xml
@@ -56,7 +56,7 @@
UTF-80.8.52.3.4
- 1.18.12
+ 1.18.209.9.1-71.7.25
From c1b5c0ab81d0c19db0c55d4f126e40ab63a902ab Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Thu, 20 May 2021 11:37:14 +0200
Subject: [PATCH 067/210] (chore) upgrade jacoco
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index c27a373..44e3f80 100644
--- a/pom.xml
+++ b/pom.xml
@@ -54,7 +54,7 @@
UTF-8
- 0.8.5
+ 0.8.72.3.41.18.209.9.1-7
From 99ffe18d2b0964ae5fa9800ec2e22ebdf53b2a29 Mon Sep 17 00:00:00 2001
From: Andreas Penski
Date: Thu, 20 May 2021 10:30:18 +0000
Subject: [PATCH 068/210] Optimize ci
---
.gitlab-ci.yml | 140 +++++++++++-------
.mvn/createBuildImages.sh | 15 ++
.mvn/jvm.config | 1 +
.mvn/settings.xml | 47 ++++++
pom.xml | 1 +
.../xml/BaseResolverConfigurationTest.java | 6 +-
6 files changed, 153 insertions(+), 57 deletions(-)
create mode 100644 .mvn/createBuildImages.sh
create mode 100644 .mvn/jvm.config
create mode 100644 .mvn/settings.xml
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 14ee8cb..97c8077 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,7 +2,7 @@ image: maven:latest
variables:
BUILD_PROPS: "-Dbuild.revision=$CI_COMMIT_SHA -Dbuild.branch=$CI_COMMIT_REF_NAME -Dbuild.number=$CI_PIPELINE_IID "
- MAVEN_CLI_OPTS: " --batch-mode -Dmaven.repo.local=repository -Dfile.encoding=UTF-8 -s .settings/settings.xml"
+ MAVEN_CLI_OPTS: " --batch-mode -Dfile.encoding=UTF-8 -s .mvn/settings.xml -Dmaven.repo.local=.mvn/repository -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false"
before_script:
- export CI_JOB_TIMESTAMP="-Dbuild.timestamp=$(date --utc --iso-8601=seconds)"
@@ -10,57 +10,11 @@ before_script:
cache:
key: maven
paths:
- - repository
-
-build-amazoncorretto:
- stage: build
- image: maven:amazoncorretto
- script:
- - mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
- retry: 2
- artifacts:
- name: amazoncorretto
- paths:
- - target/*.jar
- reports:
- junit:
- - target/surefire-reports/*.xml
- - target/failsafe-reports/*.xml
-
-build-java-14:
- stage: build
- image: maven:3-jdk-14
- script:
- - mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
- retry: 2
- artifacts:
- when: on_failure
- name: java-14
- paths:
- - target/*
- reports:
- junit:
- - target/surefire-reports/*.xml
- - target/failsafe-reports/*.xml
-
-build-java-11-openj9:
- stage: build
- image: maven:3-jdk-11-openj9
- script:
- - mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
- retry: 2
- artifacts:
- name: java-11-openj9
- paths:
- - target/*.jar
- reports:
- junit:
- - target/surefire-reports/*.xml
- - target/failsafe-reports/*.xml
+ - .mvn/repository
build-java-11:
stage: build
- image: maven:3-jdk-11
+ image: $CI_REGISTRY_IMAGE/maven:3-jdk-11
script:
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
retry: 2
@@ -74,9 +28,39 @@ build-java-11:
- target/surefire-reports/*.xml
- target/failsafe-reports/*.xml
+build-java-11-openj9:
+ stage: build
+ image: $CI_REGISTRY_IMAGE/maven:3-jdk-11-openj9
+ script:
+ - mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
+ retry: 2
+ artifacts:
+ name: java-11-openj9
+ paths:
+ - target/*.jar
+ reports:
+ junit:
+ - target/surefire-reports/*.xml
+ - target/failsafe-reports/*.xml
+
+build-java8:
+ stage: build
+ image: $CI_REGISTRY_IMAGE/maven:3-jdk-8
+ script:
+ - mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
+ retry: 2
+ artifacts:
+ name: java-8
+ paths:
+ - target/*.jar
+ reports:
+ junit:
+ - target/surefire-reports/*.xml
+ - target/failsafe-reports/*.xml
+
build-java-8-openj9:
stage: build
- image: maven:3-jdk-8-openj9
+ image: $CI_REGISTRY_IMAGE/maven:3-jdk-8-openj9
script:
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
retry: 2
@@ -89,16 +73,49 @@ build-java-8-openj9:
- target/surefire-reports/*.xml
- target/failsafe-reports/*.xml
-build-java8:
+build-java-15:
stage: build
- image: maven:3-jdk-8-alpine
+ image: $CI_REGISTRY_IMAGE/maven:3-openjdk-15
script:
- mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
retry: 2
artifacts:
- name: java-8-alpine
+ when: on_failure
+ name: java-15
paths:
- - target/*.jar
+ - target/*
+ reports:
+ junit:
+ - target/surefire-reports/*.xml
+ - target/failsafe-reports/*.xml
+
+build-java-16:
+ stage: build
+ image: $CI_REGISTRY_IMAGE/maven:3-openjdk-16
+ script:
+ - mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
+ retry: 2
+ artifacts:
+ when: on_failure
+ name: java-16
+ paths:
+ - target/*
+ reports:
+ junit:
+ - target/surefire-reports/*.xml
+ - target/failsafe-reports/*.xml
+
+build-java-17:
+ stage: build
+ image: $CI_REGISTRY_IMAGE/maven:3-openjdk-17
+ script:
+ - mvn $MAVEN_CLI_OPTS $BUILD_PROPS $CI_JOB_TIMESTAMP verify
+ retry: 2
+ artifacts:
+ when: on_failure
+ name: java-17
+ paths:
+ - target/*
reports:
junit:
- target/surefire-reports/*.xml
@@ -106,7 +123,7 @@ build-java8:
deploy:
stage: deploy
- image: maven:3-jdk-11
+ image: $CI_REGISTRY_IMAGE/maven:3-jdk-11
dependencies:
- build-java-11
script:
@@ -118,3 +135,16 @@ deploy:
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}-java8-standalone.jar -DgroupId=kosit -DartifactId=validator -Dclassifier="java8-standalone" -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}-sources.jar -DgroupId=kosit -DartifactId=validator -Dclassifier="sources" -Dversion=${PROJECT_VERSION} -Dpackaging=jar -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
when: manual
+
+create-build-image:
+ stage: deploy
+ image: docker:latest
+ needs: [ ]
+ services:
+ - docker:dind
+ script:
+ - apk add bash
+ - bash .mvn/createBuildImages.sh
+ when: manual
+
+
diff --git a/.mvn/createBuildImages.sh b/.mvn/createBuildImages.sh
new file mode 100644
index 0000000..e3a0111
--- /dev/null
+++ b/.mvn/createBuildImages.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+TAGS=("3-openjdk-16" "3-jdk-11" "3-jdk-11-openj9" "3-jdk-8" "3-jdk-8-openj9", "3-openjdk-15", "3-openjdk-17")
+
+docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
+for i in "${TAGS[@]}"
+do
+ echo Creating build image for "$i"
+ {
+ echo "FROM maven:${i}"
+ } >> Dockerfile
+ docker build -t "$CI_REGISTRY_IMAGE/maven:$i" .
+ docker push "$CI_REGISTRY_IMAGE/maven:${i}"
+ rm Dockerfile
+done
\ No newline at end of file
diff --git a/.mvn/jvm.config b/.mvn/jvm.config
new file mode 100644
index 0000000..423c21f
--- /dev/null
+++ b/.mvn/jvm.config
@@ -0,0 +1 @@
+-Xms128m -Xmx512m
\ No newline at end of file
diff --git a/.mvn/settings.xml b/.mvn/settings.xml
new file mode 100644
index 0000000..9e2bfbe
--- /dev/null
+++ b/.mvn/settings.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ gitlab-maven
+
+
+
+ Job-Token
+ ${env.CI_JOB_TOKEN}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 44e3f80..1c37d2f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -463,6 +463,7 @@
${jacocoFailsafe}
+ -Xmx256m-classpathde.kosit.validationtool.cmd.CommandLineApplication
diff --git a/src/test/java/de/kosit/validationtool/impl/xml/BaseResolverConfigurationTest.java b/src/test/java/de/kosit/validationtool/impl/xml/BaseResolverConfigurationTest.java
index ca86c93..3d97a4c 100644
--- a/src/test/java/de/kosit/validationtool/impl/xml/BaseResolverConfigurationTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/xml/BaseResolverConfigurationTest.java
@@ -45,10 +45,12 @@ public class BaseResolverConfigurationTest {
private class TestResolvingStrategy extends StrictRelativeResolvingStrategy {
void setInternalProperty(final SchemaFactory factory, final boolean lenient) {
- allowExternalSchema(factory, lenient, "quatsch");
+ allowExternalSchema(factory, lenient, NOT_EXISTING_SCHEME);
}
}
+ public static final String NOT_EXISTING_SCHEME = "not-existing-scheme";
+
@Rule
public ExpectedException expectedException = ExpectedException.none();
@@ -75,7 +77,7 @@ public class BaseResolverConfigurationTest {
final TestResolvingStrategy s = new TestResolvingStrategy();
s.setInternalProperty(sf, true);
s.setInternalProperty(sf, false);
- verify(sf, times(2)).setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "quatsch");
+ verify(sf, times(2)).setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, BaseResolverConfigurationTest.NOT_EXISTING_SCHEME);
}
}
From 1055866d169d37fb22bb6886e5731dc4f5de8c55 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Thu, 20 May 2021 13:19:21 +0200
Subject: [PATCH 069/210] (chore) rename jobs
---
.gitlab-ci.yml | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 97c8077..dd6e758 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,7 +12,7 @@ cache:
paths:
- .mvn/repository
-build-java-11:
+java-11:
stage: build
image: $CI_REGISTRY_IMAGE/maven:3-jdk-11
script:
@@ -28,7 +28,7 @@ build-java-11:
- target/surefire-reports/*.xml
- target/failsafe-reports/*.xml
-build-java-11-openj9:
+java-11-openj9:
stage: build
image: $CI_REGISTRY_IMAGE/maven:3-jdk-11-openj9
script:
@@ -43,7 +43,7 @@ build-java-11-openj9:
- target/surefire-reports/*.xml
- target/failsafe-reports/*.xml
-build-java8:
+java8:
stage: build
image: $CI_REGISTRY_IMAGE/maven:3-jdk-8
script:
@@ -58,7 +58,7 @@ build-java8:
- target/surefire-reports/*.xml
- target/failsafe-reports/*.xml
-build-java-8-openj9:
+java-8-openj9:
stage: build
image: $CI_REGISTRY_IMAGE/maven:3-jdk-8-openj9
script:
@@ -73,7 +73,7 @@ build-java-8-openj9:
- target/surefire-reports/*.xml
- target/failsafe-reports/*.xml
-build-java-15:
+java-15:
stage: build
image: $CI_REGISTRY_IMAGE/maven:3-openjdk-15
script:
@@ -89,7 +89,7 @@ build-java-15:
- target/surefire-reports/*.xml
- target/failsafe-reports/*.xml
-build-java-16:
+java-16:
stage: build
image: $CI_REGISTRY_IMAGE/maven:3-openjdk-16
script:
@@ -105,7 +105,7 @@ build-java-16:
- target/surefire-reports/*.xml
- target/failsafe-reports/*.xml
-build-java-17:
+java-17:
stage: build
image: $CI_REGISTRY_IMAGE/maven:3-openjdk-17
script:
@@ -125,7 +125,7 @@ deploy:
stage: deploy
image: $CI_REGISTRY_IMAGE/maven:3-jdk-11
dependencies:
- - build-java-11
+ - java-11
script:
- export PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- mvn $MAVEN_CLI_OPTS deploy:deploy-file -Dfile=target/validationtool-${PROJECT_VERSION}.zip -DgroupId=kosit -DartifactId=validator -Dclassifier="distribution" -Dversion=${PROJECT_VERSION} -Dpackaging=zip -DrepositoryId="gitlab-maven" -Durl=https://projekte.kosit.org/api/v4/projects/7/packages/maven
From 955ec45bd1609c82c129eab332e0b77cdd974cc3 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Thu, 20 May 2021 16:11:52 +0200
Subject: [PATCH 070/210] (chore) update CHANGELOG.md
---
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 39f7386..f77e8e6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [CLI] [#74](https://projekte.kosit.org/kosit/validator/-/issues/74) fix ansi output of the cli version
- [#80](https://github.com/itplr-kosit/validator/issues/80) using classloader to initialize jaxb context (to support usage in OSGi
environments)
+- [#75] (https://github.com/itplr-kosit/validator/issues/75) Improve logging on invalid documents
## 1.4.1
From bc8d8223608398a2f13769c789042ba3441a47ff Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Thu, 20 May 2021 16:36:55 +0200
Subject: [PATCH 071/210] [maven-release-plugin] prepare release v1.4.2
---
pom.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pom.xml b/pom.xml
index 1c37d2f..f6b4491 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,13 +15,13 @@
~ limitations under the License.
-->
-
+4.0.0KoSIT XML Prüftool Implementierungde.kosit
- 1.4.2-SNAPSHOT
+ 1.4.2validationtoolKoSIT XML Validator against XSD and Schematron based on defined scenarios.
@@ -622,7 +622,7 @@
https://github.com/itplr-kosit/validationtool.gitscm:git:https://projekte.kosit.org/kosit/validator.git
- v1.1.0
+ v1.4.2https://github.com/itplr-kosit/validatorhttps://github.com/itplr-kosit/validator
From 730d7fefe95a7d95df3d048d886754ddbdf29981 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Thu, 20 May 2021 16:36:59 +0200
Subject: [PATCH 072/210] [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 f6b4491..5fa4032 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
KoSIT XML Prüftool Implementierungde.kosit
- 1.4.2
+ 1.5.0-SNAPSHOTvalidationtoolKoSIT XML Validator against XSD and Schematron based on defined scenarios.
@@ -622,7 +622,7 @@
https://github.com/itplr-kosit/validationtool.gitscm:git:https://projekte.kosit.org/kosit/validator.git
- v1.4.2
+ v1.1.0https://github.com/itplr-kosit/validatorhttps://github.com/itplr-kosit/validator
From 511265bb1016fc11f0ebbd750f47a4d20f1d2e44 Mon Sep 17 00:00:00 2001
From: "Andreas Penski (init)"
Date: Fri, 21 May 2021 13:14:08 +0200
Subject: [PATCH 073/210] (chore) further reduce memory consumption
---
.mvn/jvm.config | 2 +-
pom.xml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.mvn/jvm.config b/.mvn/jvm.config
index 423c21f..f023f5e 100644
--- a/.mvn/jvm.config
+++ b/.mvn/jvm.config
@@ -1 +1 @@
--Xms128m -Xmx512m
\ No newline at end of file
+-Xms128m -Xmx384m
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 5fa4032..2e525bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,7 +15,7 @@
~ limitations under the License.
-->
-
+4.0.0KoSIT XML Prüftool Implementierung
@@ -463,7 +463,7 @@
${jacocoFailsafe}
- -Xmx256m
+ -Xmx128m-classpathde.kosit.validationtool.cmd.CommandLineApplication
From 2e6efdd16f36153fdc4f265c360e8d0f7a03201a Mon Sep 17 00:00:00 2001
From: Andreas Penski
Date: Fri, 21 May 2021 11:16:20 +0000
Subject: [PATCH 074/210] support multiple configuration
---
.idea/compiler.xml | 2 +-
CHANGELOG.md | 12 +
docs/api.md | 1 -
docs/cli.md | 31 +-
.../packaged-test-scenarios-1.0.2.jar} | Bin 8954 -> 10017 bytes
.../packaged-test-scenarios-1.0.2.pom} | 2 +-
.../maven-metadata-local.xml | 6 +-
pom.xml | 8 +-
.../api/CheckConfiguration.java | 5 +-
.../validationtool/api/Configuration.java | 2 +-
.../api/ResolvingConfigurationStrategy.java | 12 -
.../cmd/CommandLineApplication.java | 75 ++---
.../cmd/CommandLineOptions.java | 232 ++++++++++-----
.../validationtool/cmd/InternalCheck.java | 6 +-
.../kosit/validationtool/cmd/ReturnValue.java | 3 +
.../validationtool/cmd/TypeConverter.java | 99 +++++++
.../kosit/validationtool/cmd/Validator.java | 274 ++++++++----------
.../config/ConfigurationBuilder.java | 9 +-
.../config/ConfigurationLoader.java | 13 +-
.../config/FallbackBuilder.java | 3 +
.../config/ScenarioBuilder.java | 3 +
.../validationtool/daemon/ConfigHandler.java | 8 +-
.../kosit/validationtool/daemon/Daemon.java | 16 +-
.../validationtool/daemon/HealthHandler.java | 5 +-
.../impl/ContentRepository.java | 47 +--
.../validationtool/impl/DefaultCheck.java | 30 +-
.../de/kosit/validationtool/impl/Printer.java | 16 +
.../kosit/validationtool/impl/Scenario.java | 9 +
.../impl/ScenarioRepository.java | 25 +-
.../validationtool/impl/SchemaProvider.java | 87 ++++++
.../impl/tasks/CreateReportAction.java | 14 +-
.../impl/tasks/SchemaValidationAction.java | 5 +-
.../tasks/SchematronValidationAction.java | 11 +-
.../impl/xml/BaseResolvingStrategy.java | 20 --
.../{ => xml}/ClassPathResourceResolver.java | 6 +-
.../impl/xml/ProcessorProvider.java | 117 ++++++++
.../xml/StrictRelativeResolvingStrategy.java | 79 +----
.../kosit/validationtool/cmd/CommandLine.java | 10 +-
.../cmd/CommandlineApplicationTest.java | 94 +++++-
.../config/ConfigurationBuilderTest.java | 25 +-
.../config/ConfigurationLoaderTest.java | 3 +-
.../config/SimpleConfigTest.java | 3 +-
.../validationtool/daemon/CheckHandlerIT.java | 8 +
.../daemon/ConfigHandlerTest.java | 6 +-
.../impl/ContentRepositoryTest.java | 37 +--
.../validationtool/impl/DefaultCheckTest.java | 10 +-
.../de/kosit/validationtool/impl/Helper.java | 9 +-
.../impl/ScenarioRepositoryTest.java | 22 +-
.../impl/SimpleScenarioCheckTest.java | 2 +-
.../impl/TestObjectFactory.java | 4 +-
.../validationtool/impl/VersioningTest.java | 8 +-
.../impl/input/StreamHelperTest.java | 61 ++++
.../tasks/ComputeAcceptanceActionTest.java | 4 +-
.../impl/tasks/CreateReportActionTest.java | 5 +-
.../impl/tasks/SchemaValidatorActionTest.java | 6 +-
.../tasks/SchematronValidationActionTest.java | 3 +-
.../impl/tasks/TestBagBuilder.java | 6 +-
.../impl/xml/SchemaProviderTest.java | 30 ++
.../examples/simple/otherScenarios.xml | 95 ++++++
59 files changed, 1136 insertions(+), 608 deletions(-)
rename libs/de/kosit/validationtool/packaged-test-scenarios/{1.0.1/packaged-test-scenarios-1.0.1.jar => 1.0.2/packaged-test-scenarios-1.0.2.jar} (70%)
rename libs/de/kosit/validationtool/packaged-test-scenarios/{1.0.1/packaged-test-scenarios-1.0.1.pom => 1.0.2/packaged-test-scenarios-1.0.2.pom} (97%)
create mode 100644 src/main/java/de/kosit/validationtool/cmd/TypeConverter.java
create mode 100644 src/main/java/de/kosit/validationtool/impl/SchemaProvider.java
rename src/main/java/de/kosit/validationtool/impl/{ => xml}/ClassPathResourceResolver.java (95%)
create mode 100644 src/main/java/de/kosit/validationtool/impl/xml/ProcessorProvider.java
create mode 100644 src/test/java/de/kosit/validationtool/impl/input/StreamHelperTest.java
create mode 100644 src/test/java/de/kosit/validationtool/impl/xml/SchemaProviderTest.java
create mode 100644 src/test/resources/examples/simple/otherScenarios.xml
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index bea581f..7a00605 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -7,8 +7,8 @@
-
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f77e8e6..4e367ed 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+# 1.5.0 (to be released)
+
+### Added
+
+- Support for multiple configurations and multiple repositories. See [cli documentation](docs/cli.md) for details
+- Possibility to use preconfigured Saxon `Processor` instance for validation
+
+### Changed
+
+- [ResolvingConfigurationStrategy.java#getProcessor()](de/kosit/validationtool/api/ResolvingConfigurationStrategy) is removed.
+- [INTERNAL] CLI parsing based on pico-cli, commons-cli is removed
+
## 1.4.2
### Fixed
diff --git a/docs/api.md b/docs/api.md
index 0e969f6..b26d428 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -174,7 +174,6 @@ When using XML related technologies you are supposed to handle certain security
* disables DTD validation completely
* allows loading/resolving only from a configured local content repository (a specific folder)
* tries to prevent known XML security issues (see [OWASP XML_Security_Cheat_Sheet.html](https://cheatsheetseries.owasp.org/cheatsheets/XML_Security_Cheat_Sheet.html))
-* only works with OpenJDK based XML stacks
However, you can configure certain aspects related to resolving and security yourself. The validator uses a single interface for accessing or creating the necessary XML API objects like `SchemaFactory`, `Validator`,`URIResolver` or `Processor`: [ResolvingConfigurationStrategy.java](https://github.com/itplr-kosit/validator/tree/master/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java)
diff --git a/docs/cli.md b/docs/cli.md
index 8287f81..071f6da 100644
--- a/docs/cli.md
+++ b/docs/cli.md
@@ -24,16 +24,33 @@ The help option displays further CLI options to customize the process:
java -jar validationtool--standalone.jar --help
```
+You can also use multiple scenario configurations and multiple repositories with resources for these. The validator either supports
+supplying the parameters in order or using named configuration. Valid usages are
+
+```shell
+# multiple scenarios, implicit repository
+java -jar validationtool--standalone.jar -s -s [OPTIONS] [FILE]
+
+# multiple scenarios, single defined repository
+java -jar validationtool--standalone.jar -s -s -r [OPTIONS] [FILE]
+
+# multiple scenarios, multiple repositories ordered
+java -jar validationtool--standalone.jar -s -r -s -r [OPTIONS] [FILE]
+java -jar validationtool--standalone.jar -s -s -r -r [OPTIONS] [FILE]
+
+# multiple scenarios, multiple repositories (named)
+java -jar validationtool--standalone.jar -s "NAME1=" -s "NAME2=" -r "NAME1=" -r "NAME2=" [OPTIONS] [FILE]
+```
+
## Special features
+
Besides the obvious functionality of validating, the cli provides additional functionality to customize the processing:
-|name | option | description |
-| - | - | - |
-| [Daemon mode](daemon.md) | `-D` | Starts the validator in daemon mode as an HTTP service |
-| print mode | `-p` | Print the report to stdout |
-| extract html | `-h` | Extracts any html blocks within the report and saves the content to the filesystem. Note: the file name is derived from the node name the html appears in |
-| print memory stats | `-m` | Prints some memory usage information. Mainly for debugging purposes on processing huge xml files |
-| check assertions | `-c ` | Check assertions on the generated reports. This is mainly useful for scenario developers. Ask KoSIT for documentation, if you want to use this feauture |
+|name | option | description | | - | - | - | | [Daemon mode](daemon.md) | `-D` | Starts the validator in daemon mode as an HTTP service | |
+print mode | `-p` | Print the report to stdout | | extract html | `-h` | Extracts any html blocks within the report and saves the content to
+the filesystem. Note: the file name is derived from the node name the html appears in | | print memory stats | `-m` | Prints some memory
+usage information. Mainly for debugging purposes on processing huge xml files | | check assertions | `-c ` | Check assertions on the
+generated reports. This is mainly useful for scenario developers. Ask KoSIT for documentation, if you want to use this feauture |
## Return codes
diff --git a/libs/de/kosit/validationtool/packaged-test-scenarios/1.0.1/packaged-test-scenarios-1.0.1.jar b/libs/de/kosit/validationtool/packaged-test-scenarios/1.0.2/packaged-test-scenarios-1.0.2.jar
similarity index 70%
rename from libs/de/kosit/validationtool/packaged-test-scenarios/1.0.1/packaged-test-scenarios-1.0.1.jar
rename to libs/de/kosit/validationtool/packaged-test-scenarios/1.0.2/packaged-test-scenarios-1.0.2.jar
index 984b0c3a0dcbb47eb40a96d58b3196f5f11f21bc..b1c3c648e77738f4cd6dba35c95d4ddf13228ee6 100644
GIT binary patch
delta 287
zcmez6y3lWf9rI*2Spi1n$^Oi88~sEXH`_4JV4j@JC^T7FP=0a~qY9%DP)cF)R>t3(
zudrQ_fU4dpuQRz&R)$aePRFe^3$8Ic_+>2<384W>WKKa+Cmb3)I4xwo6Rzl9r$R
VTuq0MkAaVYm5qVnz6=8p003i6CQ<+Z
diff --git a/libs/de/kosit/validationtool/packaged-test-scenarios/1.0.1/packaged-test-scenarios-1.0.1.pom b/libs/de/kosit/validationtool/packaged-test-scenarios/1.0.2/packaged-test-scenarios-1.0.2.pom
similarity index 97%
rename from libs/de/kosit/validationtool/packaged-test-scenarios/1.0.1/packaged-test-scenarios-1.0.1.pom
rename to libs/de/kosit/validationtool/packaged-test-scenarios/1.0.2/packaged-test-scenarios-1.0.2.pom
index 97cb27c..58a2f75 100644
--- a/libs/de/kosit/validationtool/packaged-test-scenarios/1.0.1/packaged-test-scenarios-1.0.1.pom
+++ b/libs/de/kosit/validationtool/packaged-test-scenarios/1.0.2/packaged-test-scenarios-1.0.2.pom
@@ -21,6 +21,6 @@
4.0.0de.kosit.validationtoolpackaged-test-scenarios
- 1.0.1
+ 1.0.2POM was created from install:install-file
diff --git a/libs/de/kosit/validationtool/packaged-test-scenarios/maven-metadata-local.xml b/libs/de/kosit/validationtool/packaged-test-scenarios/maven-metadata-local.xml
index 0faccfe..d0f6f5c 100644
--- a/libs/de/kosit/validationtool/packaged-test-scenarios/maven-metadata-local.xml
+++ b/libs/de/kosit/validationtool/packaged-test-scenarios/maven-metadata-local.xml
@@ -19,10 +19,10 @@
de.kosit.validationtoolpackaged-test-scenarios
- 1.0.1
+ 1.0.2
- 1.0.1
+ 1.0.2
- 20200507064929
+ 20201007064929
diff --git a/pom.xml b/pom.xml
index 5fa4032..bd8b758 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,9 +87,9 @@
${version.slf4j}
- commons-cli
- commons-cli
- 1.4
+ info.picocli
+ picocli
+ 4.5.1true
@@ -148,7 +148,7 @@
de.kosit.validationtoolpackaged-test-scenarios
- 1.0.1
+ 1.0.2test
diff --git a/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java b/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java
index 9afe4d3..12ec1ce 100644
--- a/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java
+++ b/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java
@@ -27,12 +27,13 @@ import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.impl.ContentRepository;
import de.kosit.validationtool.impl.Scenario;
+import de.kosit.validationtool.impl.xml.ProcessorProvider;
/**
* Zentrale Konfigration einer Prüf-Instanz.
*
* @author Andreas Penski
- * @deprecated since 1.3.0 use {@link Configuration} instead
+ * @deprecated since 1.3.0 use {@link Configuration} instead. Will be removed in 2.0
*/
@Getter
@Setter
@@ -55,7 +56,7 @@ public class CheckConfiguration implements Configuration {
private Configuration getDelegate() {
if (this.delegate == null) {
- this.delegate = Configuration.load(this.scenarioDefinition, this.scenarioRepository).build();
+ this.delegate = Configuration.load(this.scenarioDefinition, this.scenarioRepository).build(ProcessorProvider.getProcessor());
}
return this.delegate;
}
diff --git a/src/main/java/de/kosit/validationtool/api/Configuration.java b/src/main/java/de/kosit/validationtool/api/Configuration.java
index 84d2926..c341a36 100644
--- a/src/main/java/de/kosit/validationtool/api/Configuration.java
+++ b/src/main/java/de/kosit/validationtool/api/Configuration.java
@@ -81,7 +81,7 @@ public interface Configuration {
* Add some additional parameters to the validator configuration. Parameter usage depends on actual implementation
* of {@link Check}
*
- * @return
+ * @return A Map containing the additional Parameters to be added.
*/
Map getAdditionalParameters();
diff --git a/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java b/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java
index 8ad75bf..f07a3a8 100644
--- a/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java
+++ b/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java
@@ -24,7 +24,6 @@ import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
import net.sf.saxon.lib.UnparsedTextURIResolver;
-import net.sf.saxon.s9api.Processor;
/**
* Centralized construction and configuration of XML related infrastructure components. This interface allows to use
@@ -50,17 +49,6 @@ public interface ResolvingConfigurationStrategy {
*/
SchemaFactory createSchemaFactory();
- /**
- * Returns a preconfigured {@link Processor Saxon Processor} for various tasks within the Validator. The validator
- * leverages the saxon s9api for internal processing e.g. xml reading and writing. So this is the main object to
- * secure for reading, transforming and writing xml files.
- *
- * Note: you need exactly one instance for all validator related processing.
- *
- * @return a preconfigured {@link Processor}
- */
- Processor getProcessor();
-
/**
* Creates a specific implementation for resolving referenced objects in XML files. The URIResolver is used for
* dereferencing an absolute URI (after resolution) to return a {@link javax.xml.transform.Source}. It can be
diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java
index 54001a3..9a13ef0 100644
--- a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java
+++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java
@@ -16,25 +16,19 @@
package de.kosit.validationtool.cmd;
-import static de.kosit.validationtool.cmd.CommandLineOptions.HELP;
-import static de.kosit.validationtool.cmd.CommandLineOptions.createHelpOptions;
-import static de.kosit.validationtool.cmd.CommandLineOptions.createOptions;
-import static de.kosit.validationtool.cmd.CommandLineOptions.printHelp;
import static de.kosit.validationtool.impl.Printer.writeErr;
-import java.util.Arrays;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.DefaultParser;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
+import org.apache.commons.lang3.ObjectUtils;
+import org.fusesource.jansi.AnsiConsole;
import org.fusesource.jansi.AnsiConsole;
import org.fusesource.jansi.AnsiRenderer.Code;
import de.kosit.validationtool.cmd.report.Line;
import de.kosit.validationtool.impl.Printer;
+import picocli.CommandLine;
+import picocli.CommandLine.ParseResult;
+
/**
* Commandline interface of the validator. It parses the commandline args and hands over actual execution to
* {@link Validator}.
@@ -59,7 +53,9 @@ public class CommandLineApplication {
AnsiConsole.systemInstall();
final ReturnValue resultStatus = mainProgram(args);
if (!resultStatus.equals(ReturnValue.DAEMON_MODE)) {
- sayGoodby(resultStatus);
+ if (!resultStatus.equals(ReturnValue.HELP_REQUEST) && resultStatus.getCode() >= 0) {
+ sayGoodby(resultStatus);
+ }
System.exit(resultStatus.getCode());
} else {
Runtime.getRuntime().addShutdownHook(new Thread(() -> Printer.writeOut("Shutting down daemon ...")));
@@ -79,60 +75,37 @@ public class CommandLineApplication {
// for testing purposes. Unless jvm is terminated during tests. See above
static ReturnValue mainProgram(final String[] args) {
- final Options options = createOptions();
ReturnValue resultStatus;
+ final CommandLine commandLine = new CommandLine(new CommandLineOptions());
try {
- if (isHelpRequested(args)) {
- printHelp(options);
- resultStatus = ReturnValue.SUCCESS;
+ commandLine.setExecutionExceptionHandler(CommandLineApplication::logExecutionException);
+ commandLine.execute(args);
+ if (commandLine.isUsageHelpRequested()) {
+ resultStatus = ReturnValue.HELP_REQUEST;
} else {
- final CommandLineParser parser = new DefaultParser();
- final CommandLine cmd = parser.parse(options, args);
- configureLogging(cmd);
- resultStatus = Validator.mainProgram(cmd);
+ resultStatus = ObjectUtils.defaultIfNull(commandLine.getExecutionResult(), ReturnValue.PARSING_ERROR);
+ if (resultStatus.getCode() != ReturnValue.PARSING_ERROR.getCode()
+ && resultStatus.getCode() != ReturnValue.SUCCESS.getCode()) {
+ commandLine.usage(System.out);
+ }
}
- } catch (final ParseException e) {
+
+ } catch (final Exception e) {
writeErr("Error processing command line arguments: {0}", e.getMessage(), e);
- printHelp(options);
resultStatus = ReturnValue.PARSING_ERROR;
}
return resultStatus;
}
- private static boolean isHelpRequested(final String[] args) {
- final Options helpOptions = createHelpOptions();
- try {
- final CommandLineParser parser = new DefaultParser();
- final CommandLine cmd = parser.parse(helpOptions, args, true);
- if (cmd.hasOption(HELP.getOpt()) || args.length == 0) {
- return true;
- }
- } catch (final ParseException e) {
- // we can ignore that, we just look for the help parameters
- }
- return false;
+ private static int logExecutionException(final Exception ex, final CommandLine cli, final ParseResult parseResult) {
+ Printer.writeErr(ex, ex.getMessage());
+ return 1;
}
- private static void configureLogging(final CommandLine cmd) throws ParseException {
- if (cmd.hasOption(CommandLineOptions.DEBUG_LOG.getOpt())) {
- System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "DEBUG");
- } else if (cmd.hasOption(CommandLineOptions.LOG_LEVEL.getOpt())) {
-
- final String level = Level.resolve(cmd.getOptionValue(CommandLineOptions.LOG_LEVEL.getOpt()));
- System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, level);
- } else {
- System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "OFF");
- }
- }
-
- private enum Level {
+ enum Level {
INFO, WARN, DEBUG, TRACE, ERROR, OFF;
- static String resolve(final String optionValue) throws ParseException {
- return Arrays.stream(values()).filter(e -> e.name().equalsIgnoreCase(optionValue)).map(Enum::name).findFirst()
- .orElseThrow(() -> new ParseException("Either specify trace,debug,info,warn,error as log level"));
- }
}
}
diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java
index c460048..2511d48 100644
--- a/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java
+++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineOptions.java
@@ -16,100 +16,176 @@
package de.kosit.validationtool.cmd;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Option;
+import java.nio.file.Path;
+import java.util.List;
+import java.util.concurrent.Callable;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import de.kosit.validationtool.cmd.CommandLineApplication.Level;
+
+import picocli.CommandLine.ArgGroup;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.Help.Visibility;
+import picocli.CommandLine.Option;
+import picocli.CommandLine.Parameters;
/**
+ * Commandline Interface definition.
+ *
* @author Andreas Penski
*/
-public class CommandLineOptions {
+@Command(description = "Structural and semantic validation of xml files", name = "KoSIT Validator", mixinStandardHelpOptions = false,
+ separator = " ")
+@Getter
+public class CommandLineOptions implements Callable {
- static final Option HELP = Option.builder("?").longOpt("help").argName("Help").desc("Displays this help").build();
+ /**
+ * @author Andreas Penski
+ */
+ @Getter
+ @NoArgsConstructor
+ static class DaemonOptions {
- static final Option SCENARIOS = Option.builder("s").required().longOpt("scenarios").hasArg().desc("Location of scenarios.xml e.g.")
- .build();
+ @Option(names = { "-D", "--daemon" }, description = "Starts a daemon listing for validation requests", defaultValue = "false",
+ required = true)
+ private boolean daemonMode;
- static final Option REPOSITORY = Option.builder("r").longOpt("repository").hasArg().desc("Directory containing scenario content")
- .build();
+ @Option(names = { "-H", "--host" }, description = "The hostname / IP address to bind the daemon.", defaultValue = "localhost",
+ showDefaultValue = Visibility.ALWAYS)
+ private String host;
- static final Option PRINT = Option.builder("p").longOpt("print").desc("Prints the check result to stdout").build();
+ @Option(names = { "-P", "--port" }, description = "The port to bind the daemon.", defaultValue = "8080",
+ showDefaultValue = Visibility.ALWAYS)
+ private int port;
- static final Option OUTPUT = Option.builder("o").longOpt("output-directory")
- .desc("Defines the out directory for results. Defaults to cwd").hasArg().build();
+ @Option(names = { "-T", "--threads" },
+ description = "Number of threads processing validation requests. Default depends on processor count", defaultValue = "-1",
+ showDefaultValue = Visibility.NEVER)
+ private int workerCount;
- static final Option EXTRACT_HTML = Option.builder("h").longOpt("html")
- .desc("Extract and save any html content within result as a separate file ").build();
-
- static final Option DEBUG = Option.builder("d").longOpt("debug").desc("Prints some more debug information").build();
-
- static final Option SERIALIZE_REPORT_INPUT = Option.builder("c").longOpt("serialize-report-input")
- .desc("Serializes the report input to the cwd").build();
-
- static final Option CHECK_ASSERTIONS = Option.builder("c").longOpt("check-assertions").hasArg()
- .desc("Check the result using defined assertions").argName("assertions-file").build();
-
- static final Option SERVER = Option.builder("D").longOpt("daemon").desc("Starts a daemon listing for validation requests").build();
-
- static final Option HOST = Option.builder("H").longOpt("host").hasArg()
- .desc("The hostname / IP address to bind the daemon. Default is localhost").build();
-
- static final Option PORT = Option.builder("P").longOpt("port").hasArg().desc("The port to bind the daemon. Default is 8080").build();
-
- static final Option WORKER_COUNT = Option.builder("T").longOpt("threads").hasArg()
- .desc("Number of threads processing validation requests").build();
-
- static final Option DISABLE_GUI = Option.builder("G").longOpt("disable-gui").desc("Disables the GUI of the daemon mode").build();
-
- static final Option REPORT_POSTFIX = Option.builder(null).longOpt("report-postfix").hasArg()
- .desc("Postfix of the generated report name").build();
-
- static final Option REPORT_PREFIX = Option.builder(null).longOpt("report-prefix").hasArg().desc("Prefix of the generated report name")
- .build();
-
- static final Option DEBUG_LOG = Option.builder("X").longOpt("debug-logging").desc("Enables full debug log. Alias for -l debug").build();
-
- static final Option LOG_LEVEL = Option.builder("l").longOpt("log-level").hasArg()
- .desc("Enables a certain log level for debugging " + "purposes").build();
-
- static final Option PRINT_MEM_STATS = Option.builder("m").longOpt("memory-stats").desc("Prints some memory stats").build();
-
- private CommandLineOptions() {
- // hide
+ @Option(names = { "-G", "--disable-gui" }, description = "Disables the GUI of the daemon mode")
+ private boolean disableGUI;
}
- static org.apache.commons.cli.Options createOptions() {
- final org.apache.commons.cli.Options options = new org.apache.commons.cli.Options();
- options.addOption(HELP);
- options.addOption(SERVER);
- options.addOption(HOST);
- options.addOption(PORT);
- options.addOption(SCENARIOS);
- options.addOption(REPOSITORY);
- options.addOption(PRINT);
- options.addOption(OUTPUT);
- options.addOption(EXTRACT_HTML);
- options.addOption(DEBUG);
- options.addOption(CHECK_ASSERTIONS);
- options.addOption(PRINT_MEM_STATS);
- options.addOption(WORKER_COUNT);
- options.addOption(DISABLE_GUI);
- options.addOption(REPORT_POSTFIX);
- options.addOption(REPORT_PREFIX);
- options.addOption(LOG_LEVEL);
- options.addOption(DEBUG_LOG);
- return options;
+ /**
+ * @author Andreas Penski
+ */
+ @Getter
+ @NoArgsConstructor
+ static class CliOptions {
+
+ @Option(names = { "-o", "--output-directory" }, description = "Defines the out directory for results.", defaultValue = ".",
+ required = true)
+ private Path outputPath;
+
+ @Option(names = { "-h", "--html", "--extract-html" },
+ description = "Extract and save any html content within result as a separate file")
+ private boolean extractHtml;
+
+ @Option(names = { "--serialize-report-input" }, description = "Serializes the report input to the cwd", defaultValue = "false")
+ private boolean serializeInput;
+
+ @Option(names = { "-c", "--check-assertions" }, paramLabel = "assertions-file",
+ description = "Check the result using defined assertions")
+ private Path assertions;
+
+ @Option(names = { "--report-postfix" }, description = "Postfix of the generated report name")
+ private String reportPostfix;
+
+ @Option(names = { "--report-prefix" }, description = "Prefix of the generated report name")
+ private String reportPrefix;
+
+ @Option(names = { "-m", "--memory-stats" }, description = "Prints some memory stats")
+ private boolean printMemoryStats;
+
+ @Option(names = { "-p", "--print" }, description = "Prints the check result to stdout")
+ private boolean printReport;
+
+ @Parameters(arity = "1..*", description = "Files to validate")
+ private List files;
+
}
- static void printHelp(final org.apache.commons.cli.Options options) {
- // automatically generate the help statement
- final HelpFormatter formatter = new HelpFormatter();
- formatter.printHelp("check-tool -s [OPTIONS] [FILE]... ", options, false);
+ /**
+ * Definition of logical name and a path for a configuration artifact.
+ *
+ * @author Andreas Penski
+ */
+ @Getter
+ @Setter
+ public abstract static class Definition {
+
+ String name;
+
+ Path path;
}
- static org.apache.commons.cli.Options createHelpOptions() {
- final org.apache.commons.cli.Options options = new org.apache.commons.cli.Options();
- options.addOption(HELP);
- return options;
+ /**
+ * Definition of logical name and a path for a repository.
+ *
+ * @author Andreas Penski
+ */
+ public static class RepositoryDefinition extends Definition {
+ // just for type safety
}
+ /**
+ * Definition of logical name and a path for a scenario configuration file.
+ *
+ * @author Andreas Penski
+ */
+ public static class ScenarioDefinition extends Definition {
+ // just for type safety
+ }
+
+ @ArgGroup(exclusive = false, heading = "Daemon options\n")
+ private DaemonOptions daemonOptions;
+
+ @ArgGroup(exclusive = false, heading = "CLI usage options\n")
+ private CliOptions cliOptions;
+
+ @Option(names = { "-d", "--debug" }, description = "Prints some more debug information")
+ private boolean debugOutput;
+
+ @Option(names = { "-?", "--help" }, usageHelp = true, description = "display this help message")
+ boolean usageHelpRequested;
+
+ @Option(names = { "-X", "--debug-logging" }, description = "Enables full debug log. Alias for -l debug")
+ private boolean debugLog;
+
+ @Option(names = { "-l", "--log-level" }, description = "Enables a certain log level for debugging purposes", defaultValue = "OFF")
+ private Level logLevel;
+
+ @Option(names = { "-r", "--repository" }, paramLabel = "repository-path", description = "Directory containing scenario content",
+ converter = TypeConverter.RepositoryConverter.class)
+ private List repositories;
+
+ @Option(names = { "-s", "--scenarios" }, description = "Location of scenarios.xml", paramLabel = "scenario.xml", required = true,
+ converter = TypeConverter.ScenarioConverter.class)
+ private List scenarios;
+
+ @Override
+ public ReturnValue call() throws Exception {
+ configureLogging(this);
+ return Validator.mainProgram(this);
+ }
+
+ private static void configureLogging(final CommandLineOptions cmd) {
+ if (cmd.isDebugLog()) {
+ System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "DEBUG");
+ } else {
+ System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, cmd.getLogLevel().name());
+ }
+ }
+
+ public boolean isDaemonModeEnabled() {
+ return getDaemonOptions() != null;
+ }
+
+ public boolean isCliModeEnabled() {
+ return getCliOptions() != null;
+ }
}
diff --git a/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java b/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
index 6ec392d..7789189 100644
--- a/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
+++ b/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java
@@ -37,6 +37,8 @@ import de.kosit.validationtool.cmd.report.Line;
import de.kosit.validationtool.impl.DefaultCheck;
import de.kosit.validationtool.impl.tasks.CheckAction;
+import net.sf.saxon.s9api.Processor;
+
/**
* Simple Erweiterung der Klasse {@link DefaultCheck} um das Ergebnis der Assertion-Prüfung auszuwerten und auszugeben.
* Diese Klasse stellt keine fachliche Erweiterung des eigentlichen Prüfvorganges dar!
@@ -55,8 +57,8 @@ class InternalCheck extends DefaultCheck {
*
* @param configuration die Konfiguration
*/
- InternalCheck(final Configuration configuration) {
- super(configuration);
+ InternalCheck(final Processor processor, final Configuration... configuration) {
+ super(processor, configuration);
}
/**
diff --git a/src/main/java/de/kosit/validationtool/cmd/ReturnValue.java b/src/main/java/de/kosit/validationtool/cmd/ReturnValue.java
index 594f0ca..2a7d43c 100644
--- a/src/main/java/de/kosit/validationtool/cmd/ReturnValue.java
+++ b/src/main/java/de/kosit/validationtool/cmd/ReturnValue.java
@@ -30,6 +30,8 @@ public class ReturnValue {
public static final ReturnValue SUCCESS = new ReturnValue(0);
+ public static final ReturnValue HELP_REQUEST = new ReturnValue(0);
+
public static final ReturnValue CONFIGURATION_ERROR = new ReturnValue(-2);
public static final ReturnValue DAEMON_MODE = new ReturnValue(-100);
@@ -41,4 +43,5 @@ public class ReturnValue {
public static ReturnValue createFailed(final int count) {
return new ReturnValue(count);
}
+
}
diff --git a/src/main/java/de/kosit/validationtool/cmd/TypeConverter.java b/src/main/java/de/kosit/validationtool/cmd/TypeConverter.java
new file mode 100644
index 0000000..4878fcd
--- /dev/null
+++ b/src/main/java/de/kosit/validationtool/cmd/TypeConverter.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2017-2021 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed 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 static org.apache.commons.lang3.StringUtils.isNotBlank;
+
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import de.kosit.validationtool.cmd.CommandLineOptions.Definition;
+import de.kosit.validationtool.cmd.CommandLineOptions.RepositoryDefinition;
+import de.kosit.validationtool.cmd.CommandLineOptions.ScenarioDefinition;
+import de.kosit.validationtool.impl.ScenarioRepository;
+
+import picocli.CommandLine.ITypeConverter;
+
+/**
+ * Custom type converters for dealing with command line input.
+ *
+ * @author Andreas Penski
+ */
+class TypeConverter {
+
+ /**
+ * Type converter for a repository definition specification e.g. '-r somelocation.xml OR -r myid=somelocation.xml'
+ *
+ * @author Andreas Penski
+ */
+ public static class RepositoryConverter implements ITypeConverter {
+
+ @Override
+ public RepositoryDefinition convert(final String value) throws Exception {
+ return TypeConverter.convert(RepositoryDefinition.class, value);
+ }
+ }
+
+ /**
+ * Type converter for a scenario definition specification e.g. '-s somelocation.xml OR -s myid=somelocation.xml'
+ *
+ * @author Andreas Penski
+ */
+ public static class ScenarioConverter implements ITypeConverter {
+
+ @Override
+ public ScenarioDefinition convert(final String value) throws Exception {
+ return TypeConverter.convert(ScenarioDefinition.class, value);
+ }
+ }
+
+ final static Map, AtomicInteger> counter = new HashMap<>();
+
+ private static String getDefaultName(final Class> type) {
+ final AtomicInteger current = counter.computeIfAbsent(type, a -> new AtomicInteger(1));
+ return ScenarioRepository.DEFAULT + "_" + current.getAndIncrement();
+ }
+
+ private static T convert(final Class type, final String value) {
+ T def = null;
+ if (isNotBlank(value)) {
+ final String[] splitted = value.split("=");
+ if (splitted.length == 1) {
+ def = createNewInstance(type);
+ def.setName(getDefaultName(type));
+ def.setPath(Paths.get(splitted[0].trim()));
+ } else if (splitted.length == 2) {
+ def = createNewInstance(type);
+ def.setName(splitted[0].trim());
+ def.setPath(Paths.get(splitted[1].trim()));
+ } else {
+ throw new IllegalArgumentException("Not a valid repository specification " + value);
+ }
+ }
+ return def;
+ }
+
+ private static T createNewInstance(final Class type) {
+ try {
+ return type.getConstructor().newInstance();
+ } catch (final ReflectiveOperationException e) {
+ throw new IllegalStateException("Error creating instance of type " + type);
+ }
+ }
+}
diff --git a/src/main/java/de/kosit/validationtool/cmd/Validator.java b/src/main/java/de/kosit/validationtool/cmd/Validator.java
index f04ab4a..0fe487c 100644
--- a/src/main/java/de/kosit/validationtool/cmd/Validator.java
+++ b/src/main/java/de/kosit/validationtool/cmd/Validator.java
@@ -16,25 +16,9 @@
package de.kosit.validationtool.cmd;
-import static de.kosit.validationtool.cmd.CommandLineOptions.CHECK_ASSERTIONS;
-import static de.kosit.validationtool.cmd.CommandLineOptions.DEBUG;
-import static de.kosit.validationtool.cmd.CommandLineOptions.DISABLE_GUI;
-import static de.kosit.validationtool.cmd.CommandLineOptions.EXTRACT_HTML;
-import static de.kosit.validationtool.cmd.CommandLineOptions.HELP;
-import static de.kosit.validationtool.cmd.CommandLineOptions.HOST;
-import static de.kosit.validationtool.cmd.CommandLineOptions.OUTPUT;
-import static de.kosit.validationtool.cmd.CommandLineOptions.PORT;
-import static de.kosit.validationtool.cmd.CommandLineOptions.PRINT;
-import static de.kosit.validationtool.cmd.CommandLineOptions.PRINT_MEM_STATS;
-import static de.kosit.validationtool.cmd.CommandLineOptions.REPORT_POSTFIX;
-import static de.kosit.validationtool.cmd.CommandLineOptions.REPORT_PREFIX;
-import static de.kosit.validationtool.cmd.CommandLineOptions.REPOSITORY;
-import static de.kosit.validationtool.cmd.CommandLineOptions.SCENARIOS;
-import static de.kosit.validationtool.cmd.CommandLineOptions.SERIALIZE_REPORT_INPUT;
-import static de.kosit.validationtool.cmd.CommandLineOptions.SERVER;
-import static de.kosit.validationtool.cmd.CommandLineOptions.WORKER_COUNT;
-import static de.kosit.validationtool.cmd.CommandLineOptions.createOptions;
-import static de.kosit.validationtool.cmd.CommandLineOptions.printHelp;
+import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
+import static org.apache.commons.lang3.StringUtils.EMPTY;
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
import java.io.IOException;
import java.net.URI;
@@ -42,18 +26,15 @@ 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.HashMap;
+import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Option;
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.lang3.StringUtils;
import org.fusesource.jansi.AnsiRenderer.Code;
import lombok.extern.slf4j.Slf4j;
@@ -62,18 +43,23 @@ import de.kosit.validationtool.api.Configuration;
import de.kosit.validationtool.api.Input;
import de.kosit.validationtool.api.InputFactory;
import de.kosit.validationtool.api.Result;
+import de.kosit.validationtool.cmd.CommandLineOptions.CliOptions;
+import de.kosit.validationtool.cmd.CommandLineOptions.Definition;
+import de.kosit.validationtool.cmd.CommandLineOptions.RepositoryDefinition;
+import de.kosit.validationtool.cmd.CommandLineOptions.ScenarioDefinition;
import de.kosit.validationtool.cmd.assertions.Assertions;
import de.kosit.validationtool.cmd.report.Line;
-import de.kosit.validationtool.config.ConfigurationLoader;
import de.kosit.validationtool.daemon.Daemon;
import de.kosit.validationtool.impl.ConversionService;
import de.kosit.validationtool.impl.EngineInformation;
import de.kosit.validationtool.impl.Printer;
+import de.kosit.validationtool.impl.ScenarioRepository;
+import de.kosit.validationtool.impl.xml.ProcessorProvider;
import net.sf.saxon.s9api.Processor;
/**
- * Actual evaluation and processing of commandline argumtens.
+ * Actual evaluation and processing of CommandLineOptions argumtens.
*
* @author Andreas Penski
*/
@@ -90,23 +76,23 @@ public class Validator {
*
* @param cmd parsed commandline.
*/
- static ReturnValue mainProgram(final CommandLine cmd) {
+ static ReturnValue mainProgram(final CommandLineOptions cmd) {
greeting();
- final org.apache.commons.cli.Options options = createOptions();
final ReturnValue returnValue;
try {
- if (cmd.hasOption(SERVER.getOpt())) {
+ if (cmd.isDaemonModeEnabled()) {
startDaemonMode(cmd);
returnValue = ReturnValue.DAEMON_MODE;
- } else if (cmd.hasOption(HELP.getOpt()) || (cmd.getArgList().isEmpty() && !isPiped())) {
- printHelp(options);
- returnValue = ReturnValue.PARSING_ERROR;
- } else {
+ } else if (cmd.isCliModeEnabled() || isPiped()) {
returnValue = processActions(cmd);
+ } else {
+ Printer.writeErr("No test target found");
+ returnValue = ReturnValue.CONFIGURATION_ERROR;
}
} catch (final Exception e) {
+ e.printStackTrace();
Printer.writeErr(e.getMessage());
- if (cmd.hasOption(DEBUG.getOpt())) {
+ if (cmd.isDebugOutput()) {
log.error(e.getMessage(), e);
} else {
log.error(e.getMessage());
@@ -120,83 +106,55 @@ public class Validator {
Printer.writeOut("{0} version {1}", EngineInformation.getName(), EngineInformation.getVersion());
}
- private static int determinePort(final CommandLine cmd) {
- int port = 8080;
- if (checkOptionWithValue(PORT, cmd)) {
- port = Integer.parseInt(cmd.getOptionValue(PORT.getOpt()));
- }
- return port;
- }
-
- private static int determineThreads(final CommandLine cmd) {
+ private static int determineThreads(final CommandLineOptions.DaemonOptions cmd) {
int threads = Runtime.getRuntime().availableProcessors();
- if (checkOptionWithValue(WORKER_COUNT, cmd)) {
- threads = Integer.parseInt(cmd.getOptionValue(WORKER_COUNT.getOpt()));
+ if (cmd.getWorkerCount() > 0) {
+ threads = cmd.getWorkerCount();
}
return threads;
}
- private static String determineHost(final CommandLine cmd) {
- String host = "localhost";
- if (checkOptionWithValue(HOST, cmd)) {
- host = cmd.getOptionValue(HOST.getOpt());
+ private static void startDaemonMode(final CommandLineOptions cmd) {
+ if (cmd.isCliModeEnabled()) {
+ Printer.writeErr("Mixed mode configuration detected. Use either daemon mode or cli mode commandline options. They are mutual "
+ + "exclusive. Will ignore cli mode options");
}
- return host;
- }
-
- private static void startDaemonMode(final CommandLine cmd) {
- final Option[] unavailable = new Option[] { PRINT, CHECK_ASSERTIONS, DEBUG, OUTPUT, EXTRACT_HTML, REPORT_POSTFIX, REPORT_PREFIX };
- warnUnusedOptions(cmd, unavailable, true);
- final ConfigurationLoader config = getConfiguration(cmd);
- final Daemon validDaemon = new Daemon(determineHost(cmd), determinePort(cmd), determineThreads(cmd));
- if (cmd.hasOption(DISABLE_GUI.getOpt())) {
- validDaemon.setGuiEnabled(false);
- }
- final Configuration configuration = config.build();
- printScenarios(configuration);
+ final List configuration = getConfiguration(cmd);
+ final CommandLineOptions.DaemonOptions daemonOptions = cmd.getDaemonOptions();
+ final Daemon validDaemon = new Daemon(daemonOptions.getHost(), daemonOptions.getPort(), determineThreads(daemonOptions));
+ validDaemon.setGuiEnabled(!daemonOptions.isDisableGUI());
Printer.writeOut("\nStarting daemon mode ...");
- validDaemon.startServer(configuration);
+ validDaemon.startServer(ProcessorProvider.getProcessor(), configuration.toArray(new Configuration[configuration.size()]));
}
- private static void warnUnusedOptions(final CommandLine cmd, final Option[] unavailable, final 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 ReturnValue processActions(final CommandLine cmd) throws IOException {
+ private static ReturnValue processActions(final CommandLineOptions cmd) throws IOException {
long start = System.currentTimeMillis();
- final Option[] unavailable = new Option[] { HOST, PORT, WORKER_COUNT, DISABLE_GUI };
- warnUnusedOptions(cmd, unavailable, false);
- final Configuration config = getConfiguration(cmd).build();
- printScenarios(config);
- final InternalCheck check = new InternalCheck(config);
- final Path outputDirectory = determineOutputDirectory(cmd);
-
- final Processor processor = config.getContentRepository().getProcessor();
- if (cmd.hasOption(EXTRACT_HTML.getOpt())) {
+ final Processor processor = ProcessorProvider.getProcessor();
+ final List config = getConfiguration(cmd);
+ final InternalCheck check = new InternalCheck(processor, config.toArray(new Configuration[0]));
+ final CommandLineOptions.CliOptions cliOptions = defaultIfNull(cmd.getCliOptions(), new CliOptions());
+ final Path outputDirectory = determineOutputDirectory(cliOptions);
+ if (cliOptions.isExtractHtml()) {
check.getCheckSteps().add(new ExtractHtmlContentAction(processor, outputDirectory));
}
- check.getCheckSteps().add(new SerializeReportAction(outputDirectory, processor, determineNamingStrategy(cmd)));
- if (cmd.hasOption(SERIALIZE_REPORT_INPUT.getOpt())) {
+ check.getCheckSteps().add(new SerializeReportAction(outputDirectory, processor, determineNamingStrategy(cliOptions)));
+ if (cliOptions.isSerializeInput()) {
check.getCheckSteps().add(new SerializeReportInputAction(outputDirectory, check.getConversionService()));
}
- if (cmd.hasOption(PRINT.getOpt())) {
+ if (cliOptions.isPrintReport()) {
check.getCheckSteps().add(new PrintReportAction(processor));
}
- if (cmd.hasOption(CHECK_ASSERTIONS.getOpt())) {
- final Assertions assertions = loadAssertions(cmd.getOptionValue(CHECK_ASSERTIONS.getOpt()));
+ if (cliOptions.getAssertions() != null) {
+ final Assertions assertions = loadAssertions(cliOptions.getAssertions());
check.getCheckSteps().add(new CheckAssertionAction(assertions, processor));
}
- if (cmd.hasOption(PRINT_MEM_STATS.getOpt())) {
+ if (cliOptions.isPrintMemoryStats()) {
check.getCheckSteps().add(new PrintMemoryStats());
}
log.info("Setup completed in {}ms\n", System.currentTimeMillis() - start);
- final Collection targets = determineTestTargets(cmd);
+ final Collection targets = determineTestTargets(cliOptions);
start = System.currentTimeMillis();
final Map results = new HashMap<>();
Printer.writeOut("\nProcessing of {0} objects started", targets.size());
@@ -216,42 +174,79 @@ public class Validator {
return check.isSuccessful(results) ? ReturnValue.SUCCESS : ReturnValue.createFailed(check.getNotAcceptableCount(results));
}
- private static ConfigurationLoader getConfiguration(final CommandLine cmd) {
- final URI scenarioLocation = determineDefinition(cmd);
- final URI repositoryLocation = determineRepository(cmd);
- reportConfiguration(scenarioLocation, repositoryLocation);
- return Configuration.load(scenarioLocation, repositoryLocation);
+ /**
+ * @param cmd the Command Line Options
+ *
+ * @return a list of configurations of the scenarios and repositories passed in cmd
+ */
+ private static List getConfiguration(final CommandLineOptions cmd) {
+ final List scenarios = defaultIfNull(cmd.getScenarios(), Collections.emptyList());
+ final Map mappedScenarios = scenarios.stream()
+ .collect(Collectors.toMap(ScenarioDefinition::getName, ScenarioDefinition::getPath));
+ final List repos = defaultIfNull(cmd.getRepositories(), Collections.emptyList());
+ final Map mappedRepos = repos.stream().collect(Collectors.toMap(Definition::getName, Definition::getPath));
+ checkUnused(mappedScenarios, mappedRepos);
+
+ return mappedScenarios.entrySet().stream().map(e -> {
+ assertFileExistance(e.getValue(), "scenario");
+ final URI scenarioLocation = e.getValue().toUri();
+ final URI repositoryLocation = findRepository(e.getKey(), mappedRepos);
+
+ reportLoading(scenarioLocation, repositoryLocation);
+ final Configuration configuration = Configuration.load(scenarioLocation, repositoryLocation)
+ .build(ProcessorProvider.getProcessor());
+ reportConfiguration(configuration);
+ return configuration;
+ }).collect(Collectors.toList());
+
}
- private static void reportConfiguration(final URI scenarioLocation, final URI repositoryLocation) {
+ private static void checkUnused(final Map scenarios, final Map repositories) {
+ final List> unused = repositories.entrySet().stream().filter(e -> scenarios.get(e.getKey()) == null)
+ .collect(Collectors.toList());
+ unused.removeIf(e -> e.getKey().equals(ScenarioRepository.DEFAULT_ID));
+ unused.forEach(e -> Printer.writeErr("Warning: repository definition \"{0}\" is not used", e.getKey()));
+ }
+
+ private static URI findRepository(final String key, final Map repositories) {
+ final Path path = repositories.getOrDefault(key, repositories.get(ScenarioRepository.DEFAULT_ID));
+ if (path == null) {
+ throw new IllegalArgumentException(String.format("No repository location for scenario definition '%s' specified", key));
+ }
+ return determineRepository(path);
+ }
+
+ private static void reportLoading(final URI scenarioLocation, final URI repositoryLocation) {
Printer.writeOut("Loading scenarios from {0}", scenarioLocation);
Printer.writeOut("Using repository {0}", repositoryLocation);
+ Printer.writeOut(EMPTY);
}
- private static void printScenarios(final Configuration configuration) {
+ private static void reportConfiguration(final Configuration configuration) {
Printer.writeOut("Loaded \"{0}\" by {1} from {2} ", configuration.getName(), configuration.getAuthor(), configuration.getDate());
- Printer.writeOut("\nThe following scenarios are available:");
+ Printer.writeOut("The following scenarios are available:");
configuration.getScenarios().forEach(e -> {
final Line line = new Line(Code.GREEN);
line.add(" * " + e.getName());
Printer.writeOut(line.render(false, false));
+
});
+ Printer.writeOut(EMPTY);
+
}
- private static NamingStrategy determineNamingStrategy(final CommandLine cmd) {
+ private static NamingStrategy determineNamingStrategy(final CommandLineOptions.CliOptions cmd) {
final DefaultNamingStrategy namingStrategy = new DefaultNamingStrategy();
- if (cmd.hasOption(REPORT_PREFIX.getLongOpt())) {
- namingStrategy.setPrefix(cmd.getOptionValue(REPORT_PREFIX.getLongOpt()));
+ if (isNotEmpty(cmd.getReportPrefix())) {
+ namingStrategy.setPrefix(cmd.getReportPrefix());
}
- if (cmd.hasOption(REPORT_POSTFIX.getLongOpt())) {
- namingStrategy.setPostfix(cmd.getOptionValue(REPORT_POSTFIX.getLongOpt()));
+ if (isNotEmpty(cmd.getReportPostfix())) {
+ namingStrategy.setPostfix(cmd.getReportPostfix());
}
-
return namingStrategy;
}
- private static Assertions loadAssertions(final String optionValue) {
- final Path p = Paths.get(optionValue);
+ private static Assertions loadAssertions(final Path p) {
Assertions a = null;
if (Files.exists(p)) {
final ConversionService c = new ConversionService();
@@ -261,24 +256,23 @@ public class Validator {
return a;
}
- private static Path determineOutputDirectory(final CommandLine cmd) {
- final String value = cmd.getOptionValue(OUTPUT.getOpt());
- final Path fir;
- if (StringUtils.isNotBlank(value)) {
- fir = Paths.get(value);
- if ((!Files.exists(fir) && !fir.toFile().mkdirs()) || !Files.isDirectory(fir)) {
- throw new IllegalStateException(String.format("Invalid target directory %s specified", value));
+ private static Path determineOutputDirectory(final CommandLineOptions.CliOptions cmd) {
+ final Path dir;
+ if (cmd.getOutputPath() != null) {
+ dir = cmd.getOutputPath();
+ if ((!Files.exists(dir) && !dir.toFile().mkdirs()) || !Files.isDirectory(dir)) {
+ throw new IllegalStateException(String.format("Invalid target directory %s specified", dir.toString()));
}
} else {
- fir = Paths.get(""/* cwd */);
+ dir = Paths.get(""/* cwd */);
}
- return fir;
+ return dir;
}
- private static Collection determineTestTargets(final CommandLine cmd) throws IOException {
+ private static Collection determineTestTargets(final CommandLineOptions.CliOptions cmd) throws IOException {
final Collection targets = new ArrayList<>();
- if (!cmd.getArgList().isEmpty()) {
- cmd.getArgList().forEach(e -> targets.addAll(determineTestTarget(e)));
+ if (cmd.getFiles() != null && !cmd.getFiles().isEmpty()) {
+ cmd.getFiles().forEach(e -> targets.addAll(determineTestTarget(e)));
}
if (isPiped()) {
targets.add(readFromPipe());
@@ -289,22 +283,23 @@ public class Validator {
return targets;
}
+ @SuppressWarnings("java:S4829") // sanitation is delegated to xml stack
private static boolean isPiped() throws IOException {
return System.in.available() > 0;
}
+ @SuppressWarnings("java:S4829") // sanitation is delegated to xml stack
private static Input readFromPipe() {
return InputFactory.read(System.in, "stdin");
}
- private static Collection determineTestTarget(final String s) {
- final Path d = Paths.get(s);
+ private static Collection determineTestTarget(final Path d) {
if (Files.isDirectory(d)) {
return listDirectoryTargets(d);
} else if (Files.exists(d)) {
return Collections.singleton(InputFactory.read(d));
}
- log.warn("The specified test target {} does not exist. Will be ignored", s);
+ log.warn("The specified test target {} does not exist. Will be ignored", d);
return Collections.emptyList();
}
@@ -319,44 +314,21 @@ public class Validator {
}
- private static URI determineRepository(final CommandLine cmd) {
- if (checkOptionWithValue(REPOSITORY, cmd)) {
- final Path d = Paths.get(cmd.getOptionValue(REPOSITORY.getOpt()));
- if (Files.isDirectory(d)) {
- return d.toUri();
- } else {
- throw new IllegalArgumentException(
- String.format("Not a valid path for repository definition specified: '%s'", d.toAbsolutePath()));
- }
- }
- return null;
- }
-
- private static URI determineDefinition(final CommandLine cmd) {
- checkOptionWithValue(SCENARIOS, cmd);
- final Path f = Paths.get(cmd.getOptionValue(SCENARIOS.getOpt()));
- if (Files.isRegularFile(f)) {
- return f.toAbsolutePath().toUri();
+ private static URI determineRepository(final Path d) {
+ if (Files.isDirectory(d)) {
+ return d.toUri();
} else {
throw new IllegalArgumentException(
- String.format("Not a valid path for scenario definition specified: '%s'", f.toAbsolutePath()));
+ String.format("Not a valid path for repository definition specified: '%s'", d.toAbsolutePath()));
}
+
}
- private static boolean checkOptionWithValue(final Option option, final CommandLine cmd) {
- final String opt = option.getOpt();
- if (cmd.hasOption(opt)) {
- final String value = cmd.getOptionValue(opt);
- if (StringUtils.isNoneBlank(value)) {
- return true;
- } else {
- throw new IllegalArgumentException(String.format("Option value required for Option '%s'", option.getLongOpt()));
- }
- } else if (option.isRequired()) {
-
- throw new IllegalArgumentException(String.format("Option '%s' required ", option.getLongOpt()));
+ private static void assertFileExistance(final Path f, final String type) {
+ if (!Files.isRegularFile(f)) {
+ throw new IllegalArgumentException(
+ String.format("Not a valid path for %s definition specified: '%s'", type, f.toAbsolutePath()));
}
- return false;
}
}
diff --git a/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java b/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java
index a4a1e42..78d081b 100644
--- a/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java
+++ b/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java
@@ -68,8 +68,6 @@ public class ConfigurationBuilder {
private ResolvingMode resolvingMode = ResolvingMode.STRICT_RELATIVE;
- private Processor processor;
-
private String author = "API";
private String date = LocalDate.now().toString();
@@ -269,12 +267,9 @@ public class ConfigurationBuilder {
* @return a valid configuration
* @throws IllegalStateException when the configuration is not valid/complete
*/
- public Configuration build() {
+ public Configuration build(final Processor processor) {
final ResolvingConfigurationStrategy resolving = getResolvingConfigurationStrategy();
- if (this.processor == null) {
- this.processor = resolving.getProcessor();
- }
- final ContentRepository contentRepository = new ContentRepository(resolving, this.repository);
+ final ContentRepository contentRepository = new ContentRepository(processor, resolving, this.repository);
final List list = initializeScenarios(contentRepository);
final Scenario fallbackScenario = initializeFallback(contentRepository);
diff --git a/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java b/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java
index 0daf4cc..5b5ecc1 100644
--- a/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java
+++ b/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java
@@ -41,6 +41,7 @@ import de.kosit.validationtool.impl.ContentRepository;
import de.kosit.validationtool.impl.ConversionService;
import de.kosit.validationtool.impl.ResolvingMode;
import de.kosit.validationtool.impl.Scenario;
+import de.kosit.validationtool.impl.SchemaProvider;
import de.kosit.validationtool.impl.model.Result;
import de.kosit.validationtool.impl.tasks.DocumentParseAction;
import de.kosit.validationtool.impl.xml.RelativeUriResolver;
@@ -131,12 +132,11 @@ public class ConfigurationLoader {
}
- public Configuration build() {
+ public Configuration build(final Processor processor) {
final ResolvingConfigurationStrategy resolving = getResolvingConfigurationStrategy();
- final Processor processor = resolving.getProcessor();
- final ContentRepository contentRepository = new ContentRepository(resolving, getScenarioRepository());
+ final ContentRepository contentRepository = new ContentRepository(processor, resolving, getScenarioRepository());
- final Scenarios def = loadScenarios(contentRepository.getScenarioSchema(), processor);
+ final Scenarios def = loadScenarios(SchemaProvider.getScenarioSchema(), processor);
final List scenarios = initializeScenarios(def, contentRepository);
final Scenario fallbackScenario = createFallback(def, contentRepository);
final DefaultConfiguration configuration = new DefaultConfiguration(scenarios, fallbackScenario);
@@ -164,10 +164,10 @@ public class ConfigurationLoader {
}
private Scenarios loadScenarios(final Schema scenarioSchema, final Processor processor) {
- final ConversionService conversionService = new ConversionService();
checkVersion(this.scenarioDefinition, processor);
log.info("Loading scenarios from {}", this.scenarioDefinition);
final CollectingErrorEventHandler handler = new CollectingErrorEventHandler();
+ final ConversionService conversionService = new ConversionService();
final Scenarios scenarios = conversionService.readXml(this.scenarioDefinition, Scenarios.class, scenarioSchema, handler);
if (!handler.hasErrors()) {
log.info("Loading scenario content from {}", this.getScenarioRepository());
@@ -185,6 +185,9 @@ public class ConfigurationLoader {
s.setSchema(repository.createSchema(def));
s.setSchematronValidations(repository.createSchematronTransformations(def));
s.setReportTransformation(repository.createReportTransformation(def));
+ s.setFactory(repository.getResolvingConfigurationStrategy());
+ s.setUriResolver(repository.getResolver());
+ s.setUnparsedTextURIResolver(repository.getUnparsedTextURIResolver());
if (def.getAcceptMatch() != null) {
s.setAcceptExecutable(repository.createAccepptExecutable(def));
}
diff --git a/src/main/java/de/kosit/validationtool/config/FallbackBuilder.java b/src/main/java/de/kosit/validationtool/config/FallbackBuilder.java
index 6682fc5..0ae2c49 100644
--- a/src/main/java/de/kosit/validationtool/config/FallbackBuilder.java
+++ b/src/main/java/de/kosit/validationtool/config/FallbackBuilder.java
@@ -46,6 +46,9 @@ public class FallbackBuilder implements Builder {
object.setCreateReport(build.getObject().getLeft());
final Scenario s = new Scenario(object);
s.setFallback(true);
+ s.setFactory(repository.getResolvingConfigurationStrategy());
+ s.setUriResolver(repository.getResolver());
+ s.setUnparsedTextURIResolver(repository.getUnparsedTextURIResolver());
s.setReportTransformation(build.getObject().getRight());
result = new Result<>(s);
} else {
diff --git a/src/main/java/de/kosit/validationtool/config/ScenarioBuilder.java b/src/main/java/de/kosit/validationtool/config/ScenarioBuilder.java
index e1312c6..bd3a282 100644
--- a/src/main/java/de/kosit/validationtool/config/ScenarioBuilder.java
+++ b/src/main/java/de/kosit/validationtool/config/ScenarioBuilder.java
@@ -88,6 +88,9 @@ public class ScenarioBuilder implements Builder {
buildReport(repository, errors, scenario);
buildAccept(repository, errors, scenario);
buildNamespaces(scenario);
+ scenario.setFactory(repository.getResolvingConfigurationStrategy());
+ scenario.setUriResolver(repository.getResolver());
+ scenario.setUnparsedTextURIResolver(repository.getUnparsedTextURIResolver());
return new Result<>(scenario, errors);
}
diff --git a/src/main/java/de/kosit/validationtool/daemon/ConfigHandler.java b/src/main/java/de/kosit/validationtool/daemon/ConfigHandler.java
index a6b63e8..9238c19 100644
--- a/src/main/java/de/kosit/validationtool/daemon/ConfigHandler.java
+++ b/src/main/java/de/kosit/validationtool/daemon/ConfigHandler.java
@@ -21,6 +21,7 @@ import java.io.InputStreamReader;
import java.io.Reader;
import java.io.StringWriter;
import java.net.URI;
+import java.util.List;
import java.util.Optional;
import org.apache.commons.io.IOUtils;
@@ -44,7 +45,7 @@ import de.kosit.validationtool.model.scenarios.Scenarios;
@RequiredArgsConstructor
class ConfigHandler extends BaseHandler {
- private final Configuration configuration;
+ private final List configuration;
private final ConversionService conversionService;
@@ -64,7 +65,8 @@ class ConfigHandler extends BaseHandler {
}
private Optional getSource() {
- final URI fileUri = (URI) this.configuration.getAdditionalParameters().get(Keys.SCENARIOS_FILE);
+
+ final URI fileUri = (URI) this.configuration.get(0).getAdditionalParameters().get(Keys.SCENARIOS_FILE);
return fileUri != null ? loadFile(fileUri) : loadFromConfig();
}
@@ -80,7 +82,7 @@ class ConfigHandler extends BaseHandler {
private Optional loadFromConfig() {
final Optional result;
- final Scenarios scenarios = (Scenarios) this.configuration.getAdditionalParameters().get(Keys.SCENARIO_DEFINITION);
+ final Scenarios scenarios = (Scenarios) this.configuration.get(0).getAdditionalParameters().get(Keys.SCENARIO_DEFINITION);
if (scenarios != null) {
final String s = this.conversionService.writeXml(scenarios);
result = Optional.of(s);
diff --git a/src/main/java/de/kosit/validationtool/daemon/Daemon.java b/src/main/java/de/kosit/validationtool/daemon/Daemon.java
index 4251131..61a156f 100644
--- a/src/main/java/de/kosit/validationtool/daemon/Daemon.java
+++ b/src/main/java/de/kosit/validationtool/daemon/Daemon.java
@@ -36,6 +36,8 @@ import de.kosit.validationtool.impl.ConversionService;
import de.kosit.validationtool.impl.DefaultCheck;
import de.kosit.validationtool.model.daemon.HealthType;
+import net.sf.saxon.s9api.Processor;
+
/**
* HTTP-Daemon für die Bereitstellung der Prüf-Funktionalität via http.
*
@@ -76,17 +78,18 @@ public class Daemon {
*
* @param config the configuration to use
*/
- public void startServer(final Configuration config) {
+ public void startServer(final Processor processor, final Configuration... config) {
HttpServer server = null;
try {
final ConversionService healthConverter = new ConversionService();
healthConverter.initialize(HealthType.class.getPackage());
final ConversionService converter = new ConversionService();
+ final DefaultCheck check = new DefaultCheck(processor, config);
server = HttpServer.create(getSocket(), 0);
- server.createContext("/", createRootHandler(config));
- server.createContext("/server/health", new HealthHandler(config, healthConverter));
- server.createContext("/server/config", new ConfigHandler(config, converter));
+ server.createContext("/", createRootHandler(check, processor));
+ server.createContext("/server/health", new HealthHandler(check.getConfiguration(), healthConverter));
+ server.createContext("/server/config", new ConfigHandler(check.getConfiguration(), converter));
server.setExecutor(createExecutor());
server.start();
log.info("Server {} started", server.getAddress());
@@ -96,10 +99,9 @@ public class Daemon {
}
}
- private HttpHandler createRootHandler(final Configuration config) {
+ private HttpHandler createRootHandler(final DefaultCheck check, final Processor processor) {
final HttpHandler rootHandler;
- final DefaultCheck check = new DefaultCheck(config);
- final CheckHandler checkHandler = new CheckHandler(check, config.getContentRepository().getProcessor());
+ final CheckHandler checkHandler = new CheckHandler(check, processor);
if (this.guiEnabled) {
final GuiHandler gui = new GuiHandler();
rootHandler = new RoutingHandler(checkHandler, gui);
diff --git a/src/main/java/de/kosit/validationtool/daemon/HealthHandler.java b/src/main/java/de/kosit/validationtool/daemon/HealthHandler.java
index 04e3b40..8955217 100644
--- a/src/main/java/de/kosit/validationtool/daemon/HealthHandler.java
+++ b/src/main/java/de/kosit/validationtool/daemon/HealthHandler.java
@@ -17,6 +17,7 @@
package de.kosit.validationtool.daemon;
import java.io.IOException;
+import java.util.List;
import com.sun.net.httpserver.HttpExchange;
@@ -39,7 +40,7 @@ import de.kosit.validationtool.model.daemon.MemoryType;
@RequiredArgsConstructor
class HealthHandler extends BaseHandler {
- private final Configuration scenarios;
+ private final List scenarios;
private final ConversionService conversionService;
@@ -55,7 +56,7 @@ class HealthHandler extends BaseHandler {
final HealthType h = new HealthType();
h.setMemory(createMemory());
h.setApplication(createApplication());
- h.setStatus(!this.scenarios.getScenarios().isEmpty() ? "UP" : "DOWN");
+ h.setStatus(this.scenarios.stream().mapToLong(c -> c.getScenarios().size()).sum() > 0 ? "UP" : "DOWN");
return h;
}
diff --git a/src/main/java/de/kosit/validationtool/impl/ContentRepository.java b/src/main/java/de/kosit/validationtool/impl/ContentRepository.java
index 23b0463..0b92d93 100644
--- a/src/main/java/de/kosit/validationtool/impl/ContentRepository.java
+++ b/src/main/java/de/kosit/validationtool/impl/ContentRepository.java
@@ -34,7 +34,6 @@ import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import org.apache.commons.lang3.StringUtils;
-import org.w3c.dom.ls.LSResourceResolver;
import org.xml.sax.SAXException;
import lombok.Getter;
@@ -67,8 +66,6 @@ import net.sf.saxon.s9api.XsltExecutable;
@Slf4j
public class ContentRepository {
- private Schema reportInputSchema;
-
@Getter
private final Processor processor;
@@ -90,10 +87,10 @@ public class ContentRepository {
* @param strategy the security and resolving strategy
* @param repository the repository.
*/
- public ContentRepository(final ResolvingConfigurationStrategy strategy, final URI repository) {
+ public ContentRepository(final Processor processor, final ResolvingConfigurationStrategy strategy, final URI repository) {
this.repository = repository;
this.resolvingConfigurationStrategy = strategy;
- this.processor = this.resolvingConfigurationStrategy.getProcessor();
+ this.processor = processor;
this.resolver = this.resolvingConfigurationStrategy.createResolver(repository);
this.unparsedTextURIResolver = this.resolvingConfigurationStrategy.createUnparsedTextURIResolver(repository);
this.schemaFactory = this.resolvingConfigurationStrategy.createSchemaFactory();
@@ -108,20 +105,15 @@ public class ContentRepository {
}
}
- private Schema createSchema(final Source[] schemaSources, final LSResourceResolver resourceResolver) {
+ private Schema createSchema(final Source[] schemaSources) {
try {
- final SchemaFactory sf = this.schemaFactory;
- sf.setResourceResolver(resourceResolver);
- return sf.newSchema(schemaSources);
+ this.schemaFactory.setResourceResolver(null);
+ return this.schemaFactory.newSchema(schemaSources);
} catch (final SAXException e) {
throw new IllegalArgumentException("Can not load schema from sources " + schemaSources[0].getSystemId(), e);
}
}
- private Schema createSchema(final Source[] schemaSources) {
- return createSchema(schemaSources, null);
- }
-
/**
* Lädt ein XSL von der angegebenen URI
*
@@ -158,40 +150,13 @@ public class ContentRepository {
* @return das erzeugte Schema
*/
public Schema createSchema(final URL url) {
- return createSchema(url, null);
+ return createSchema(new Source[] { resolve(url) });
}
public Schema createSchema(final URI uri) {
return createSchema(new Source[] { resolveInRepository(uri) });
}
- public Schema createSchema(final URL url, final LSResourceResolver resourceResolver) {
- log.info("Load schema from source {}", url.getPath());
- return createSchema(new Source[] { resolve(url) }, resourceResolver);
- }
-
- /**
- * Liefert das definiert Schema für die Szenario-Konfiguration
- *
- * @return Scenario-Schema
- */
- public Schema getScenarioSchema() {
- return createSchema(ContentRepository.class.getResource("/xsd/scenarios.xsd"));
- }
-
- /**
- * Liefert das definierte Schema für die Validierung des [@link CreateReportInput}
- *
- * @return ReportInput-Schema
- */
- public Schema getReportInputSchema() {
- if (this.reportInputSchema == null) {
- final Source source = resolve(ContentRepository.class.getResource("/xsd/createReportInput.xsd"));
- this.reportInputSchema = createSchema(new Source[] { source }, new ClassPathResourceResolver("/xsd"));
- }
- return this.reportInputSchema;
- }
-
/**
* Erzeugt ein Schema auf Basis der übegebenen URIs
*
diff --git a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
index 2700ecc..2fac625 100644
--- a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
+++ b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java
@@ -19,6 +19,7 @@ package de.kosit.validationtool.impl;
import static de.kosit.validationtool.impl.DateFactory.createTimestamp;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -42,6 +43,7 @@ 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.impl.xml.ProcessorProvider;
import de.kosit.validationtool.model.reportInput.CreateReportInput;
import de.kosit.validationtool.model.reportInput.EngineType;
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
@@ -61,31 +63,36 @@ public class DefaultCheck implements Check {
private final ConversionService conversionService;
@Getter
- private final Configuration configuration;
+ private final List configuration;
@Getter
private final List checkSteps;
+ @Getter
+ private final Processor processor;
+
+ public DefaultCheck(final Configuration... configuration) {
+ this(ProcessorProvider.getProcessor(), configuration);
+ }
+
/**
* Creates a new instance for the {@link Configuration}.
*
* @param configuration the Configuration
*/
- public DefaultCheck(final Configuration configuration) {
- this.configuration = configuration;
- final ContentRepository content = configuration.getContentRepository();
- final Processor processor = content.getProcessor();
+ public DefaultCheck(final Processor processor, final Configuration... configuration) {
+ this.configuration = Arrays.asList(configuration);
+ this.processor = processor;
this.conversionService = new ConversionService();
this.checkSteps = new ArrayList<>();
this.checkSteps.add(new DocumentParseAction(processor));
this.checkSteps.add(new CreateDocumentIdentificationAction());
this.checkSteps.add(new ScenarioSelectionAction(new ScenarioRepository(configuration)));
- this.checkSteps.add(new SchemaValidationAction(content.getResolvingConfigurationStrategy(), processor));
- this.checkSteps.add(new SchematronValidationAction(content.getResolver(), this.conversionService));
- this.checkSteps.add(new ValidateReportInputAction(this.conversionService, content.getReportInputSchema()));
- this.checkSteps.add(
- new CreateReportAction(processor, this.conversionService, content.getResolver(), content.getUnparsedTextURIResolver()));
+ this.checkSteps.add(new SchemaValidationAction(processor));
+ this.checkSteps.add(new SchematronValidationAction(this.conversionService));
+ this.checkSteps.add(new ValidateReportInputAction(this.conversionService, SchemaProvider.getReportInputSchema()));
+ this.checkSteps.add(new CreateReportAction(processor, this.conversionService));
this.checkSteps.add(new ComputeAcceptanceAction());
}
@@ -125,8 +132,7 @@ public class DefaultCheck implements Check {
}
private Result createResult(final Bag t) {
- final DefaultResult result = new DefaultResult(t.getReport(), t.getAcceptStatus(),
- new HtmlExtractor(this.configuration.getContentRepository().getProcessor()));
+ final DefaultResult result = new DefaultResult(t.getReport(), t.getAcceptStatus(), new HtmlExtractor(this.processor));
result.setWellformed(t.getParserResult().isValid());
result.setReportInput(t.getReportInput());
if (t.getSchemaValidationResult() != null) {
diff --git a/src/main/java/de/kosit/validationtool/impl/Printer.java b/src/main/java/de/kosit/validationtool/impl/Printer.java
index b8d8195..d8b0314 100644
--- a/src/main/java/de/kosit/validationtool/impl/Printer.java
+++ b/src/main/java/de/kosit/validationtool/impl/Printer.java
@@ -50,4 +50,20 @@ public class Printer {
public static void writeErr(final String message, final Object... params) {
System.err.println(new MessageFormat(message, Locale.ENGLISH).format(params));
}
+
+ /**
+ * Writes to standard error channel and prints a stacktrace.
+ *
+ * @param ex the exception
+ * @param message the message with placeholders
+ * @param params the params
+ */
+ @SuppressWarnings("squid:S1148")
+ public static void writeErr(final Exception ex, final String message, final Object... params) {
+ writeErr(message, params);
+ if (ex != null) {
+ ex.printStackTrace();
+ }
+ }
+
}
diff --git a/src/main/java/de/kosit/validationtool/impl/Scenario.java b/src/main/java/de/kosit/validationtool/impl/Scenario.java
index ff2ecc8..073e9b7 100644
--- a/src/main/java/de/kosit/validationtool/impl/Scenario.java
+++ b/src/main/java/de/kosit/validationtool/impl/Scenario.java
@@ -20,6 +20,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Optional;
+import javax.xml.transform.URIResolver;
import javax.xml.validation.Schema;
import lombok.AllArgsConstructor;
@@ -27,9 +28,11 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
+import de.kosit.validationtool.api.ResolvingConfigurationStrategy;
import de.kosit.validationtool.model.scenarios.ResourceType;
import de.kosit.validationtool.model.scenarios.ScenarioType;
+import net.sf.saxon.lib.UnparsedTextURIResolver;
import net.sf.saxon.s9api.XPathExecutable;
import net.sf.saxon.s9api.XPathSelector;
import net.sf.saxon.s9api.XsltExecutable;
@@ -65,6 +68,12 @@ public class Scenario {
private XPathExecutable acceptExecutable;
+ private ResolvingConfigurationStrategy factory;
+
+ private URIResolver uriResolver;
+
+ private UnparsedTextURIResolver unparsedTextURIResolver;
+
@Setter
private List schematronValidations;
diff --git a/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java b/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java
index 04445ca..ed54cb9 100644
--- a/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java
+++ b/src/main/java/de/kosit/validationtool/impl/ScenarioRepository.java
@@ -16,6 +16,7 @@
package de.kosit.validationtool.impl;
+import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
@@ -38,20 +39,30 @@ import net.sf.saxon.s9api.XdmNode;
public class ScenarioRepository {
- private final Configuration configuration;
+ public static final String DEFAULT = "default";
- public ScenarioRepository(final Configuration configuration) {
- this.configuration = configuration;
- log.info("Loaded scenarios for {} by {} from {}. The following scenarios are available:\n\n{}", configuration.getName(),
- configuration.getAuthor(), configuration.getDate(), summarizeScenarios());
+ public static final String DEFAULT_ID = DEFAULT + "_1";
+
+ private final List configuration;
+
+ public ScenarioRepository(final Configuration... configuration) {
+ if (configuration.length == 0) {
+ throw new IllegalArgumentException("Must provide at least one configuration");
+ }
+ this.configuration = Arrays.asList(configuration);
+ this.configuration.forEach(v -> log.info("Loaded scenarios for {} by {} from {}.", v.getName(), v.getAuthor(), v.getDate()));
+ log.info("The following scenarios are available:\n{}", summarizeScenarios());
}
public Scenario getFallbackScenario() {
- return this.configuration.getFallbackScenario();
+ if (this.configuration.size() > 1) {
+ log.warn("Multiple configurations found. Using fallback scenario from first configuration");
+ }
+ return this.configuration.get(0).getFallbackScenario();
}
public List getScenarios() {
- return this.configuration.getScenarios();
+ return this.configuration.stream().flatMap(c -> c.getScenarios().stream()).collect(Collectors.toList());
}
private String summarizeScenarios() {
diff --git a/src/main/java/de/kosit/validationtool/impl/SchemaProvider.java b/src/main/java/de/kosit/validationtool/impl/SchemaProvider.java
new file mode 100644
index 0000000..d009cb2
--- /dev/null
+++ b/src/main/java/de/kosit/validationtool/impl/SchemaProvider.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.kosit.validationtool.impl;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.w3c.dom.ls.LSResourceResolver;
+import org.xml.sax.SAXException;
+
+import de.kosit.validationtool.impl.xml.ClassPathResourceResolver;
+
+/**
+ * @author Andreas Penski
+ */
+public class SchemaProvider {
+
+ private static Schema reportInputSchema;
+
+ /**
+ * Liefert das definierte Schema für die Validierung des [@link CreateReportInput}
+ *
+ * @return ReportInput-Schema
+ */
+ public static Schema getReportInputSchema() {
+ if (reportInputSchema == null) {
+ final SchemaFactory sf = ResolvingMode.STRICT_RELATIVE.getStrategy().createSchemaFactory();
+ final Source source = resolve(SchemaProvider.class.getResource("/xsd/createReportInput.xsd"));
+ reportInputSchema = createSchema(sf, new Source[] { source }, new ClassPathResourceResolver("/xsd"));
+ }
+ return reportInputSchema;
+ }
+
+ private static Schema createSchema(final SchemaFactory sf, final Source[] schemaSources, final LSResourceResolver resourceResolver) {
+ try {
+ sf.setResourceResolver(resourceResolver);
+ return sf.newSchema(schemaSources);
+ } catch (final SAXException e) {
+ throw new IllegalArgumentException("Can not load schema from sources " + schemaSources[0].getSystemId(), e);
+ }
+ }
+
+ private static Schema createSchema(final SchemaFactory sf, final Source... schemaSources) {
+ return createSchema(sf, schemaSources, null);
+ }
+
+ @SuppressWarnings("java:S2095") // xml stack requires not closing the resource here
+ private static Source resolve(final URL resource) {
+ try {
+ final String rawPath = resource.toURI().getRawPath();
+ return new StreamSource(resource.openStream(), rawPath);
+ } catch (final IOException | URISyntaxException e) {
+ throw new IllegalStateException("Can not load schema for resource " + resource.getPath(), e);
+ }
+ }
+
+ /**
+ * Liefert das definiert Schema für die Szenario-Konfiguration
+ *
+ * @return Scenario-Schema
+ */
+ public static Schema getScenarioSchema() {
+ final SchemaFactory sf = ResolvingMode.STRICT_RELATIVE.getStrategy().createSchemaFactory();
+ return createSchema(sf, resolve(SchemaProvider.class.getResource("/xsd/scenarios.xsd")));
+ }
+
+}
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 c8b50eb..764272c 100644
--- a/src/main/java/de/kosit/validationtool/impl/tasks/CreateReportAction.java
+++ b/src/main/java/de/kosit/validationtool/impl/tasks/CreateReportAction.java
@@ -23,7 +23,6 @@ import java.util.stream.Collectors;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.util.JAXBSource;
-import javax.xml.transform.URIResolver;
import org.xml.sax.ContentHandler;
import org.xml.sax.DTDHandler;
@@ -45,7 +44,6 @@ import de.kosit.validationtool.impl.EngineInformation;
import de.kosit.validationtool.impl.Scenario;
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
-import net.sf.saxon.lib.UnparsedTextURIResolver;
import net.sf.saxon.s9api.BuildingContentHandler;
import net.sf.saxon.s9api.DocumentBuilder;
import net.sf.saxon.s9api.Processor;
@@ -172,10 +170,6 @@ public class CreateReportAction implements CheckAction {
private final ConversionService conversionService;
- private final URIResolver resolver;
-
- private final UnparsedTextURIResolver unparsedTextURIResolver;
-
private static XsltExecutable loadFromScenario(final Scenario object) {
return object.getReportTransformation().getExecutable();
}
@@ -198,9 +192,11 @@ public class CreateReportAction implements CheckAction {
transformer.setInitialContextNode(root);
final CollectingErrorEventHandler e = new CollectingErrorEventHandler();
transformer.setMessageListener(e);
- transformer.setURIResolver(this.resolver);
- if (this.unparsedTextURIResolver != null) {
- transformer.getUnderlyingController().setUnparsedTextURIResolver(this.unparsedTextURIResolver);
+ final Scenario scenario = results.getScenarioSelectionResult().getObject();
+ transformer.setURIResolver(scenario.getUriResolver());
+
+ if (scenario.getUnparsedTextURIResolver() != null) {
+ transformer.getUnderlyingController().setUnparsedTextURIResolver(scenario.getUnparsedTextURIResolver());
}
if (parsedDocument != null) {
transformer.setParameter(new QName("input-document"), parsedDocument);
diff --git a/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java b/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java
index e0f9e34..72eff96 100644
--- a/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java
+++ b/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java
@@ -38,7 +38,6 @@ import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.api.Input;
-import de.kosit.validationtool.api.ResolvingConfigurationStrategy;
import de.kosit.validationtool.impl.CollectingErrorEventHandler;
import de.kosit.validationtool.impl.Scenario;
import de.kosit.validationtool.impl.input.AbstractInput;
@@ -134,8 +133,6 @@ public class SchemaValidationAction implements CheckAction {
private static final String LIMIT_PARAMETER = "schema.validation.inmem.limit";
- private final ResolvingConfigurationStrategy factory;
-
private final Processor processor;
@Setter(AccessLevel.PACKAGE)
@@ -147,7 +144,7 @@ public class SchemaValidationAction implements CheckAction {
final CollectingErrorEventHandler errorHandler = new CollectingErrorEventHandler();
try ( final SourceProvider validateInput = resolveSource(results) ) {
- final Validator validator = this.factory.createValidator(scenario.getSchema());
+ final Validator validator = scenario.getFactory().createValidator(scenario.getSchema());
validator.setErrorHandler(errorHandler);
validator.validate(validateInput.getSource());
return new Result<>(!errorHandler.hasErrors(), errorHandler.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 16b6975..c23e056 100644
--- a/src/main/java/de/kosit/validationtool/impl/tasks/SchematronValidationAction.java
+++ b/src/main/java/de/kosit/validationtool/impl/tasks/SchematronValidationAction.java
@@ -19,7 +19,6 @@ package de.kosit.validationtool.impl.tasks;
import java.util.List;
import java.util.stream.Collectors;
-import javax.xml.transform.URIResolver;
import javax.xml.transform.dom.DOMSource;
import org.oclc.purl.dsdl.svrl.SchematronOutput;
@@ -30,6 +29,7 @@ import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.impl.CollectingErrorEventHandler;
import de.kosit.validationtool.impl.ConversionService;
import de.kosit.validationtool.impl.Scenario;
+import de.kosit.validationtool.impl.Scenario.Transformation;
import de.kosit.validationtool.model.reportInput.CreateReportInput;
import de.kosit.validationtool.model.reportInput.ValidationResultsSchematron;
import de.kosit.validationtool.model.reportInput.ValidationResultsSchematron.Results;
@@ -49,21 +49,20 @@ import net.sf.saxon.s9api.XsltTransformer;
@Slf4j
public class SchematronValidationAction implements CheckAction {
- private final URIResolver resolver;
-
private final ConversionService conversionService;
private List validate(final Bag results, final XdmNode document, final Scenario scenario) {
- return scenario.getSchematronValidations().stream().map(v -> validate(results, document, v)).collect(Collectors.toList());
+ return scenario.getSchematronValidations().stream().map(v -> validate(scenario, results, document, v)).collect(Collectors.toList());
}
- private ValidationResultsSchematron validate(final Bag results, final XdmNode document, final Scenario.Transformation validation) {
+ private ValidationResultsSchematron validate(final Scenario scenario, final Bag results, final XdmNode document,
+ final Transformation validation) {
final ValidationResultsSchematron s = new ValidationResultsSchematron();
s.setResource(validation.getResourceType());
try {
final XsltTransformer transformer = validation.getExecutable().load();
// resolving nur relative zum Repository
- transformer.setURIResolver(this.resolver);
+ transformer.setURIResolver(scenario.getUriResolver());
final CollectingErrorEventHandler e = new CollectingErrorEventHandler();
transformer.setMessageListener(e);
diff --git a/src/main/java/de/kosit/validationtool/impl/xml/BaseResolvingStrategy.java b/src/main/java/de/kosit/validationtool/impl/xml/BaseResolvingStrategy.java
index 152dacb..d7f4774 100644
--- a/src/main/java/de/kosit/validationtool/impl/xml/BaseResolvingStrategy.java
+++ b/src/main/java/de/kosit/validationtool/impl/xml/BaseResolvingStrategy.java
@@ -28,34 +28,14 @@ import lombok.extern.slf4j.Slf4j;
import de.kosit.validationtool.api.ResolvingConfigurationStrategy;
-import net.sf.saxon.s9api.Processor;
-
/**
* @author Andreas Penski
*/
@Slf4j
public abstract class BaseResolvingStrategy implements ResolvingConfigurationStrategy {
- protected static final String DISSALLOW_DOCTYPE_DECL_FEATURE = "http://apache.org/xml/features/disallow-doctype-decl";
-
- protected static final String LOAD_EXTERNAL_DTD_FEATURE = "http://apache.org/xml/features/nonvalidating/load-external-dtd";
-
- protected static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing";
-
private static final String ORACLE_XERCES_CLASS = "com.sun.org.apache.xerces.internal.impl.Constants";
- private Processor processor;
-
- @Override
- public Processor getProcessor() {
- if (this.processor == null) {
- this.processor = createProcessor();
- }
- return this.processor;
- }
-
- protected abstract Processor createProcessor();
-
public static void forceOpenJdkXmlImplementation() {
if (!isOpenJdkXmlImplementationAvailable()) {
throw new IllegalStateException("No OpenJDK version of XERCES found");
diff --git a/src/main/java/de/kosit/validationtool/impl/ClassPathResourceResolver.java b/src/main/java/de/kosit/validationtool/impl/xml/ClassPathResourceResolver.java
similarity index 95%
rename from src/main/java/de/kosit/validationtool/impl/ClassPathResourceResolver.java
rename to src/main/java/de/kosit/validationtool/impl/xml/ClassPathResourceResolver.java
index 5092bca..428dfe1 100644
--- a/src/main/java/de/kosit/validationtool/impl/ClassPathResourceResolver.java
+++ b/src/main/java/de/kosit/validationtool/impl/xml/ClassPathResourceResolver.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package de.kosit.validationtool.impl;
+package de.kosit.validationtool.impl.xml;
import java.io.IOException;
import java.io.InputStream;
@@ -31,15 +31,13 @@ import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
-import de.kosit.validationtool.impl.xml.RelativeUriResolver;
-
/**
* {@link LSResourceResolver} der objekte relativ zu einem Basis-Pfad aus dem Classpath der Anwendung laden kann.
*
* @author Andreas Penski
*/
@Slf4j
-class ClassPathResourceResolver implements LSResourceResolver {
+public class ClassPathResourceResolver implements LSResourceResolver {
/**
* Simple {@link LSInput}-Implementierung, die einen Stream liefern kann
diff --git a/src/main/java/de/kosit/validationtool/impl/xml/ProcessorProvider.java b/src/main/java/de/kosit/validationtool/impl/xml/ProcessorProvider.java
new file mode 100644
index 0000000..9644bd8
--- /dev/null
+++ b/src/main/java/de/kosit/validationtool/impl/xml/ProcessorProvider.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.kosit.validationtool.impl.xml;
+
+import java.io.Reader;
+import java.net.URI;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.Result;
+import javax.xml.transform.TransformerException;
+
+import lombok.SneakyThrows;
+
+import net.sf.saxon.Configuration;
+import net.sf.saxon.expr.XPathContext;
+import net.sf.saxon.lib.CollectionFinder;
+import net.sf.saxon.lib.Feature;
+import net.sf.saxon.lib.FeatureKeys;
+import net.sf.saxon.lib.OutputURIResolver;
+import net.sf.saxon.lib.ResourceCollection;
+import net.sf.saxon.lib.UnparsedTextURIResolver;
+import net.sf.saxon.s9api.Processor;
+import net.sf.saxon.trans.XPathException;
+
+/**
+ * @author Andreas Penski
+ */
+public class ProcessorProvider {
+
+ private static class SecureUriResolver implements CollectionFinder, OutputURIResolver, UnparsedTextURIResolver {
+
+ public static final String MESSAGE = "Configuration error. Resolving ist not allowed";
+
+ @Override
+ public OutputURIResolver newInstance() {
+ return this;
+ }
+
+ @Override
+ public Result resolve(final String href, final String base) throws TransformerException {
+ throw new IllegalStateException(MESSAGE);
+ }
+
+ @Override
+ public void close(final Result result) throws TransformerException {
+ throw new IllegalStateException(MESSAGE);
+ }
+
+ @Override
+ public Reader resolve(final URI absoluteURI, final String encoding, final Configuration config) throws XPathException {
+ throw new IllegalStateException(MESSAGE);
+ }
+
+ @Override
+ public ResourceCollection findCollection(final XPathContext context, final String collectionURI) throws XPathException {
+ throw new IllegalStateException(MESSAGE);
+ }
+ }
+
+ protected static final String DISSALLOW_DOCTYPE_DECL_FEATURE = "http://apache.org/xml/features/disallow-doctype-decl";
+
+ protected static final String LOAD_EXTERNAL_DTD_FEATURE = "http://apache.org/xml/features/nonvalidating/load-external-dtd";
+
+ protected static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing";
+
+ private static Processor processor;
+
+ @SneakyThrows
+ private static String encode(final String input) {
+ return URLEncoder.encode(input, StandardCharsets.UTF_8.name());
+ }
+
+ public static Processor getProcessor() {
+ if (processor == null) {
+ processor = createProcessor();
+ }
+ return processor;
+ }
+
+ private static Processor createProcessor() {
+ final Processor processor = new Processor(false);
+ // verhindere global im Prinzip alle resolving strategien
+ final SecureUriResolver resolver = new SecureUriResolver();
+ processor.getUnderlyingConfiguration().setCollectionFinder(resolver);
+ processor.getUnderlyingConfiguration().setOutputURIResolver(resolver);// NOSONAR
+ processor.getUnderlyingConfiguration().setUnparsedTextURIResolver(resolver);
+
+ // grundsätzlich Feature-konfiguration:
+ processor.setConfigurationProperty(Feature.DTD_VALIDATION, false);
+ processor.setConfigurationProperty(Feature.ENTITY_RESOLVER_CLASS, "");
+ processor.setConfigurationProperty(Feature.XINCLUDE, false);
+ processor.setConfigurationProperty(Feature.ALLOW_EXTERNAL_FUNCTIONS, false);
+
+ // Konfiguration des zu verwendenden Parsers, wenn Saxon selbst einen erzeugen muss, bspw. beim XSL parsen
+ processor.setConfigurationProperty(FeatureKeys.XML_PARSER_FEATURE + encode(FEATURE_SECURE_PROCESSING), true); // NOSONAR
+ processor.setConfigurationProperty(FeatureKeys.XML_PARSER_FEATURE + encode(DISSALLOW_DOCTYPE_DECL_FEATURE), true);// NOSONAR
+ processor.setConfigurationProperty(FeatureKeys.XML_PARSER_FEATURE + encode(LOAD_EXTERNAL_DTD_FEATURE), false);// NOSONAR
+ processor.setConfigurationProperty(FeatureKeys.XML_PARSER_FEATURE + encode(XMLConstants.ACCESS_EXTERNAL_DTD), false);// NOSONAR
+ return processor;
+ }
+}
diff --git a/src/main/java/de/kosit/validationtool/impl/xml/StrictRelativeResolvingStrategy.java b/src/main/java/de/kosit/validationtool/impl/xml/StrictRelativeResolvingStrategy.java
index cabfd76..11d0166 100644
--- a/src/main/java/de/kosit/validationtool/impl/xml/StrictRelativeResolvingStrategy.java
+++ b/src/main/java/de/kosit/validationtool/impl/xml/StrictRelativeResolvingStrategy.java
@@ -16,32 +16,17 @@
package de.kosit.validationtool.impl.xml;
-import java.io.Reader;
import java.net.URI;
-import java.net.URLEncoder;
-import java.nio.charset.StandardCharsets;
import javax.xml.XMLConstants;
-import javax.xml.transform.Result;
-import javax.xml.transform.TransformerException;
import javax.xml.transform.URIResolver;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
import lombok.RequiredArgsConstructor;
-import lombok.SneakyThrows;
-import net.sf.saxon.Configuration;
-import net.sf.saxon.expr.XPathContext;
-import net.sf.saxon.lib.CollectionFinder;
-import net.sf.saxon.lib.Feature;
-import net.sf.saxon.lib.FeatureKeys;
-import net.sf.saxon.lib.OutputURIResolver;
-import net.sf.saxon.lib.ResourceCollection;
import net.sf.saxon.lib.UnparsedTextURIResolver;
-import net.sf.saxon.s9api.Processor;
-import net.sf.saxon.trans.XPathException;
/**
* @author Andreas Penski
@@ -49,78 +34,16 @@ import net.sf.saxon.trans.XPathException;
@RequiredArgsConstructor
public class StrictRelativeResolvingStrategy extends BaseResolvingStrategy {
- private static class SecureUriResolver implements CollectionFinder, OutputURIResolver, UnparsedTextURIResolver {
-
- public static final String MESSAGE = "Configuration error. Resolving ist not allowed";
-
- @Override
- public OutputURIResolver newInstance() {
- return this;
- }
-
- @Override
- public Result resolve(final String href, final String base) throws TransformerException {
- throw new IllegalStateException(MESSAGE);
- }
-
- @Override
- public void close(final Result result) throws TransformerException {
- throw new IllegalStateException(MESSAGE);
- }
-
- @Override
- public Reader resolve(final URI absoluteURI, final String encoding, final Configuration config) throws XPathException {
- throw new IllegalStateException(MESSAGE);
- }
-
- @Override
- public ResourceCollection findCollection(final XPathContext context, final String collectionURI) throws XPathException {
- throw new IllegalStateException(MESSAGE);
- }
- }
-
- /**
- * e.g. don't allow any scheme
- */
- private static final String EMPTY_SCHEME = "";
-
@Override
public SchemaFactory createSchemaFactory() {
forceOpenJdkXmlImplementation();
+ @SuppressWarnings("java:S2755") //
final SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
disableExternalEntities(sf);
allowExternalSchema(sf, "file");
return sf;
}
- @Override
- protected Processor createProcessor() {
- final Processor processor = new Processor(false);
- // verhindere global im Prinzip alle resolving strategien
- final SecureUriResolver resolver = new SecureUriResolver();
- processor.getUnderlyingConfiguration().setCollectionFinder(resolver);
- processor.getUnderlyingConfiguration().setOutputURIResolver(resolver);// NOSONAR
- processor.getUnderlyingConfiguration().setUnparsedTextURIResolver(resolver);
-
- // grundsätzlich Feature-konfiguration:
- processor.setConfigurationProperty(Feature.DTD_VALIDATION, false);
- processor.setConfigurationProperty(Feature.ENTITY_RESOLVER_CLASS, "");
- processor.setConfigurationProperty(Feature.XINCLUDE, false);
- processor.setConfigurationProperty(Feature.ALLOW_EXTERNAL_FUNCTIONS, false);
-
- // Konfiguration des zu verwendenden Parsers, wenn Saxon selbst einen erzeugen muss, bspw. beim XSL parsen
- processor.setConfigurationProperty(FeatureKeys.XML_PARSER_FEATURE + encode(FEATURE_SECURE_PROCESSING), true); // NOSONAR
- processor.setConfigurationProperty(FeatureKeys.XML_PARSER_FEATURE + encode(DISSALLOW_DOCTYPE_DECL_FEATURE), true);// NOSONAR
- processor.setConfigurationProperty(FeatureKeys.XML_PARSER_FEATURE + encode(LOAD_EXTERNAL_DTD_FEATURE), false);// NOSONAR
- processor.setConfigurationProperty(FeatureKeys.XML_PARSER_FEATURE + encode(XMLConstants.ACCESS_EXTERNAL_DTD), false);// NOSONAR
- return processor;
- }
-
- @SneakyThrows
- private static String encode(final String input) {
- return URLEncoder.encode(input, StandardCharsets.UTF_8.name());
- }
-
@Override
public URIResolver createResolver(final URI repositoryURI) {
return new RelativeUriResolver(repositoryURI);
diff --git a/src/test/java/de/kosit/validationtool/cmd/CommandLine.java b/src/test/java/de/kosit/validationtool/cmd/CommandLine.java
index 9d2bf7a..e21dbb4 100644
--- a/src/test/java/de/kosit/validationtool/cmd/CommandLine.java
+++ b/src/test/java/de/kosit/validationtool/cmd/CommandLine.java
@@ -114,22 +114,22 @@ public class CommandLine {
}
public static String getOutput() {
- return new String(out.getOut().toByteArray());
+ return out.getOut().toString();
}
public static String getErrorOutput() {
- return new String(error.getOut().toByteArray());
+ return error.getOut().toString();
}
- public List getOutputLines() {
+ public static List getOutputLines() {
return readLines(out.getOut().toByteArray());
}
- public List getErrorLines() {
+ public static List getErrorLines() {
return readLines(error.getOut().toByteArray());
}
- private List readLines(final byte[] bytes) {
+ private static List readLines(final byte[] bytes) {
try ( final ByteArrayInputStream in = new ByteArrayInputStream(bytes);
final Reader r = new InputStreamReader(in) ) {
diff --git a/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java b/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java
index d176d72..fb4744f 100644
--- a/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java
+++ b/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java
@@ -57,6 +57,7 @@ public class CommandlineApplicationTest {
if (Files.exists(this.output)) {
FileUtils.deleteDirectory(this.output.toFile());
}
+ TypeConverter.counter.clear();
}
@After
@@ -76,20 +77,20 @@ public class CommandlineApplicationTest {
final String[] args = new String[] { "-?" };
CommandLineApplication.mainProgram(args);
assertThat(CommandLine.getErrorOutput()).isEmpty();
- checkForHelp(this.commandLine.getOutputLines());
+ checkForHelp(CommandLine.getOutputLines());
}
private static void checkForHelp(final List outputLines) {
- assertThat(outputLines.size()).isGreaterThan(0);
- outputLines.subList(1, outputLines.size() - 1).forEach(l -> assertThat(l.startsWith(" -") || l.startsWith(" ")));
+ assertThat(outputLines.size()).isPositive();
+ assertThat(outputLines.stream().filter(l -> l.startsWith("Usage: KoSIT Validator"))).hasSize(1);
}
@Test
public void testRequiredScenarioFile() {
- final String[] args = new String[] { "-d", "arguments", "egal welche", "argument drin sind" };
+ final String[] args = new String[] { "arguments", "egal welche", "argumente drin sind" };
CommandLineApplication.mainProgram(args);
assertThat(CommandLine.getErrorOutput()).isNotEmpty();
- assertThat(CommandLine.getErrorOutput()).contains("Missing required option: s");
+ assertThat(CommandLine.getErrorOutput()).contains("Missing required option: '--scenarios");
}
@Test
@@ -102,10 +103,11 @@ public class CommandlineApplicationTest {
@Test
public void testIncorrectRepository() {
- final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), Paths.get(Simple.NOT_EXISTING).toString() };
+ final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r", Paths.get(Simple.NOT_EXISTING).toString(),
+ Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
assertThat(CommandLine.getErrorOutput()).isNotEmpty();
- assertThat(CommandLine.getErrorOutput()).contains("Can not resolve");
+ assertThat(CommandLine.getErrorOutput()).contains("Not a valid path for repository");
}
@Test
@@ -168,7 +170,7 @@ public class CommandlineApplicationTest {
final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-r",
Paths.get(Simple.REPOSITORY_URI).toString(), };
CommandLineApplication.mainProgram(args);
- checkForHelp(this.commandLine.getOutputLines());
+ checkForHelp(CommandLine.getOutputLines());
}
@Test
@@ -178,7 +180,7 @@ public class CommandlineApplicationTest {
Paths.get(Simple.REPOSITORY_URI).toString(), "-o", this.output.toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
assertThat(CommandLine.getErrorOutput()).contains(RESULT_OUTPUT);
- assertThat(this.commandLine.getOutputLines()).haveAtLeastOne(new Condition<>(
+ assertThat(CommandLine.getOutputLines()).haveAtLeastOne(new Condition<>(
s -> StringUtils.contains(s, ""), "Must " + "contain xml preambel"));
}
@@ -189,7 +191,7 @@ public class CommandlineApplicationTest {
Paths.get(Simple.SIMPLE_VALID).toString() };
CommandLineApplication.mainProgram(args);
assertThat(CommandLine.getErrorOutput()).contains(RESULT_OUTPUT);
- assertThat(Files.list(this.output).filter(f -> f.toString().endsWith(".html")).count()).isGreaterThan(0);
+ assertThat(Files.list(this.output).filter(f -> f.toString().endsWith(".html")).count()).isPositive();
}
@Test
@@ -227,4 +229,76 @@ public class CommandlineApplicationTest {
CommandLineApplication.mainProgram(args);
assertThat(CommandLine.getErrorOutput()).contains(RESULT_OUTPUT);
}
+
+ @Test
+ public void testUnexpectedDaemonFlag() {
+ final String[] args = new String[] { "-D", "-s", Paths.get(Simple.SCENARIOS).toString(), "-r",
+ Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
+ CommandLineApplication.mainProgram(args);
+ assertThat(CommandLine.getErrorOutput()).contains("Will ignore cli mode options");
+ }
+
+ @Test
+ public void testParsingError() {
+ final String[] args = new String[] { "-s", "-r", Paths.get(Simple.REPOSITORY_URI).toString(),
+ Paths.get(Simple.SIMPLE_VALID).toString() };
+ CommandLineApplication.mainProgram(args);
+ assertThat(CommandLine.getErrorOutput()).contains("Expected parameter for option");
+ }
+
+ @Test
+ public void loadMultipleScenarios() {
+ final String[] args = new String[] { "-s", "s1=" + Paths.get(Simple.SCENARIOS).toString(), "-s",
+ "s2=" + Paths.get(Simple.OTHER_SCENARIOS).toString(), "-r", "s1=" + Paths.get(Simple.REPOSITORY_URI).toString(), "-r",
+ "s2=" + Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
+ CommandLineApplication.mainProgram(args);
+ assertThat(CommandLine.getOutput()).contains("Processing of 1 objects completed");
+ }
+
+ @Test
+ public void loadMultipleScenariosSingleRepository() {
+ final String[] args = new String[] { "-s", "s1=" + Paths.get(Simple.SCENARIOS).toString(), "-s",
+ "s2=" + Paths.get(Simple.OTHER_SCENARIOS).toString(), "-r", Paths.get(Simple.REPOSITORY_URI).toString(),
+ Paths.get(Simple.SIMPLE_VALID).toString() };
+ CommandLineApplication.mainProgram(args);
+ assertThat(CommandLine.getOutput()).contains("Processing of 1 objects completed");
+ }
+
+ @Test
+ public void loadMultipleScenariosMissingRepository() {
+ final String[] args = new String[] { "-s", "s1=" + Paths.get(Simple.SCENARIOS).toString(), "-s",
+ "s2=" + Paths.get(Simple.OTHER_SCENARIOS).toString(), "-r", "s1=" + Paths.get(Simple.REPOSITORY_URI).toString(), "-r",
+ "typo=" + Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
+ CommandLineApplication.mainProgram(args);
+ assertThat(CommandLine.getErrorOutput()).contains("No repository location for scenario definition 's2' specified");
+ }
+
+ @Test
+ public void loadMultipleOrderedScenarios() {
+ final String[] args = new String[] { "-s", Paths.get(Simple.SCENARIOS).toString(), "-s",
+ Paths.get(Simple.OTHER_SCENARIOS).toString(), "-r", Paths.get(Simple.REPOSITORY_URI).toString(), "-r",
+ Paths.get(Simple.REPOSITORY_URI).toString(), Paths.get(Simple.SIMPLE_VALID).toString() };
+ CommandLineApplication.mainProgram(args);
+ assertThat(CommandLine.getOutput()).contains("Processing of 1 objects completed");
+ }
+
+ @Test
+ public void checkUnusedRepository() {
+ final String[] args = new String[] { "-s", "s1=" + Paths.get(Simple.SCENARIOS).toString(), "-r",
+ "s1=" + Paths.get(Simple.REPOSITORY_URI).toString(), "-r", "unused=" + Paths.get(Simple.REPOSITORY_URI).toString(),
+ Paths.get(Simple.SIMPLE_VALID).toString() };
+ CommandLineApplication.mainProgram(args);
+ assertThat(CommandLine.getOutput()).contains("Processing of 1 objects completed");
+ assertThat(CommandLine.getErrorOutput()).contains("Warning: repository definition \"unused\" is not used");
+ }
+
+ @Test
+ public void checkDuplicationScenarioDefinition() {
+ final String[] args = new String[] { "-s", "s1=" + Paths.get(Simple.SCENARIOS).toString(), "-r",
+ "s1=" + Paths.get(Simple.REPOSITORY_URI).toString(), "-r", "unused=" + Paths.get(Simple.REPOSITORY_URI).toString(),
+ Paths.get(Simple.SIMPLE_VALID).toString() };
+ CommandLineApplication.mainProgram(args);
+ assertThat(CommandLine.getOutput()).contains("Processing of 1 objects completed");
+ assertThat(CommandLine.getErrorOutput()).contains("Warning: repository definition \"unused\" is not used");
+ }
}
diff --git a/src/test/java/de/kosit/validationtool/config/ConfigurationBuilderTest.java b/src/test/java/de/kosit/validationtool/config/ConfigurationBuilderTest.java
index 442612d..b14c0ee 100644
--- a/src/test/java/de/kosit/validationtool/config/ConfigurationBuilderTest.java
+++ b/src/test/java/de/kosit/validationtool/config/ConfigurationBuilderTest.java
@@ -30,6 +30,8 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
+import de.kosit.validationtool.impl.Helper;
+
/**
* Test {@link ConfigurationBuilder}.
*
@@ -45,7 +47,7 @@ public class ConfigurationBuilderTest {
@Test
public void testNoConfiguration() {
this.exceptions.expect(IllegalStateException.class);
- new ConfigurationBuilder().build();
+ new ConfigurationBuilder().build(Helper.getTestProcessor());
}
@Test
@@ -54,7 +56,7 @@ public class ConfigurationBuilderTest {
this.exceptions.expectMessage(Matchers.containsString("fallback"));
final ConfigurationBuilder builder = createSimpleConfiguration();
builder.with((FallbackBuilder) null);
- builder.build();
+ builder.build(Helper.getTestProcessor());
}
@Test
@@ -63,7 +65,7 @@ public class ConfigurationBuilderTest {
this.exceptions.expectMessage(Matchers.containsString("schema"));
final ConfigurationBuilder builder = createSimpleConfiguration();
builder.getScenarios().get(0).validate((SchemaBuilder) null);
- builder.build();
+ builder.build(Helper.getTestProcessor());
}
@Test
@@ -72,7 +74,7 @@ public class ConfigurationBuilderTest {
this.exceptions.expectMessage(Matchers.containsString("schematron"));
final ConfigurationBuilder builder = createSimpleConfiguration();
builder.getScenarios().get(0).validate(schematron("invalid").source(URI.create("DoesNotExist")));
- builder.build();
+ builder.build(Helper.getTestProcessor());
}
@Test
@@ -81,7 +83,7 @@ public class ConfigurationBuilderTest {
this.exceptions.expectMessage(Matchers.containsString("schematron"));
final ConfigurationBuilder builder = createSimpleConfiguration();
builder.getScenarios().get(0).validate(schematron("invalid"));
- builder.build();
+ builder.build(Helper.getTestProcessor());
}
@Test
@@ -90,15 +92,18 @@ public class ConfigurationBuilderTest {
this.exceptions.expectMessage(Matchers.containsString("report"));
final ConfigurationBuilder builder = createSimpleConfiguration();
builder.getScenarios().get(0).with(report("invalid"));
- builder.build();
+ builder.build(Helper.getTestProcessor());
}
@Test
public void testDate() {
- assertThat(createSimpleConfiguration().date(EPOCH).build().getDate()).isEqualTo("1970-01-01");
- assertThat(createSimpleConfiguration().date(new Date(EPOCH.toEpochDay())).build().getDate()).isEqualTo("1970-01-01");
- assertThat(createSimpleConfiguration().date((Date) null).build().getDate()).isEqualTo(LocalDate.now().toString());
- assertThat(createSimpleConfiguration().date((LocalDate) null).build().getDate()).isEqualTo(LocalDate.now().toString());
+ assertThat(createSimpleConfiguration().date(EPOCH).build(Helper.getTestProcessor()).getDate()).isEqualTo("1970-01-01");
+ assertThat(createSimpleConfiguration().date(new Date(EPOCH.toEpochDay())).build(Helper.getTestProcessor()).getDate())
+ .isEqualTo("1970-01-01");
+ assertThat(createSimpleConfiguration().date((Date) null).build(Helper.getTestProcessor()).getDate())
+ .isEqualTo(LocalDate.now().toString());
+ assertThat(createSimpleConfiguration().date((LocalDate) null).build(Helper.getTestProcessor()).getDate())
+ .isEqualTo(LocalDate.now().toString());
}
}
diff --git a/src/test/java/de/kosit/validationtool/config/ConfigurationLoaderTest.java b/src/test/java/de/kosit/validationtool/config/ConfigurationLoaderTest.java
index 9701f56..d81cb81 100644
--- a/src/test/java/de/kosit/validationtool/config/ConfigurationLoaderTest.java
+++ b/src/test/java/de/kosit/validationtool/config/ConfigurationLoaderTest.java
@@ -21,6 +21,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import de.kosit.validationtool.api.Configuration;
+import de.kosit.validationtool.impl.Helper;
import de.kosit.validationtool.impl.ResolvingMode;
import de.kosit.validationtool.impl.xml.RemoteResolvingStrategy;
import de.kosit.validationtool.impl.xml.StrictRelativeResolvingStrategy;
@@ -35,7 +36,7 @@ public class ConfigurationLoaderTest {
final ConfigurationLoader loader = TestConfigurationFactory.loadSimpleConfiguration();
loader.setResolvingStrategy(new StrictRelativeResolvingStrategy());
loader.setResolvingMode(ResolvingMode.ALLOW_REMOTE);
- final Configuration config = loader.build();
+ final Configuration config = loader.build(Helper.getTestProcessor());
assertThat(config.getContentRepository().getResolvingConfigurationStrategy()).isNotInstanceOf(RemoteResolvingStrategy.class);
}
}
diff --git a/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java b/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java
index e636f66..41c9f6a 100644
--- a/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java
+++ b/src/test/java/de/kosit/validationtool/config/SimpleConfigTest.java
@@ -25,6 +25,7 @@ import de.kosit.validationtool.api.Configuration;
import de.kosit.validationtool.api.InputFactory;
import de.kosit.validationtool.api.Result;
import de.kosit.validationtool.impl.DefaultCheck;
+import de.kosit.validationtool.impl.Helper;
import de.kosit.validationtool.impl.Helper.Simple;
/**
@@ -35,7 +36,7 @@ public class SimpleConfigTest {
@Test
public void testSimpleWithApi() {
//@formatter:off
- final Configuration config = createSimpleConfiguration().build();
+ final Configuration config = createSimpleConfiguration().build(Helper.getTestProcessor());
//@formatter:on
final DefaultCheck check = new DefaultCheck(config);
final Result result = check.checkInput(InputFactory.read(Simple.SIMPLE_VALID));
diff --git a/src/test/java/de/kosit/validationtool/daemon/CheckHandlerIT.java b/src/test/java/de/kosit/validationtool/daemon/CheckHandlerIT.java
index ba60fec..f2850c9 100644
--- a/src/test/java/de/kosit/validationtool/daemon/CheckHandlerIT.java
+++ b/src/test/java/de/kosit/validationtool/daemon/CheckHandlerIT.java
@@ -27,6 +27,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.http.HttpStatus;
import org.junit.Test;
+import de.kosit.validationtool.impl.Helper;
import de.kosit.validationtool.impl.Helper.Simple;
import io.restassured.builder.MultiPartSpecBuilder;
@@ -81,4 +82,11 @@ public class CheckHandlerIT extends BaseIT {
}
}
+ @Test
+ public void testLarge() throws IOException {
+ try ( final InputStream io = Helper.LARGE_XML.toURL().openStream() ) {
+ given().contentType(APPLICATION_XML).body(toContent(io)).when().post("/").then().statusCode(SC_NOT_ACCEPTABLE);
+ }
+ }
+
}
diff --git a/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerTest.java b/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerTest.java
index e4f27fe..8495bde 100644
--- a/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerTest.java
+++ b/src/test/java/de/kosit/validationtool/daemon/ConfigHandlerTest.java
@@ -28,6 +28,7 @@ import static org.mockito.Mockito.when;
import java.io.IOException;
import java.io.OutputStream;
+import java.util.Collections;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
@@ -38,6 +39,7 @@ import com.sun.net.httpserver.HttpExchange;
import de.kosit.validationtool.api.Configuration;
import de.kosit.validationtool.config.TestConfigurationFactory;
import de.kosit.validationtool.impl.ConversionService;
+import de.kosit.validationtool.impl.Helper;
/**
* @author Andreas Penski
@@ -51,8 +53,8 @@ public class ConfigHandlerTest {
final OutputStream stream = mock(OutputStream.class);
when(exchange.getResponseHeaders()).thenReturn(headers);
when(exchange.getResponseBody()).thenReturn(stream);
- final Configuration config = TestConfigurationFactory.createSimpleConfiguration().build();
- final ConfigHandler handler = new ConfigHandler(config, new ConversionService());
+ final Configuration config = TestConfigurationFactory.createSimpleConfiguration().build(Helper.getTestProcessor());
+ final ConfigHandler handler = new ConfigHandler(Collections.singletonList(config), new ConversionService());
handler.handle(exchange);
verify(exchange, times(1)).sendResponseHeaders(HttpStatus.SC_OK, 0);
verify(stream, atLeast(1)).write(any());
diff --git a/src/test/java/de/kosit/validationtool/impl/ContentRepositoryTest.java b/src/test/java/de/kosit/validationtool/impl/ContentRepositoryTest.java
index 1a3ede8..8df80ee 100644
--- a/src/test/java/de/kosit/validationtool/impl/ContentRepositoryTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/ContentRepositoryTest.java
@@ -21,7 +21,6 @@ import static org.assertj.core.api.Assertions.assertThat;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
-import java.net.URL;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -61,12 +60,6 @@ public class ContentRepositoryTest {
assertThat(schema).isNotNull();
}
- @Test
- public void testSchemaCaching() {
- final Schema schema = this.repository.getReportInputSchema();
- assertThat(this.repository.getReportInputSchema()).isSameAs(schema);
- }
-
@Test
public void testCreateSchemaNotExisting() throws Exception {
this.exception.expect(IllegalStateException.class);
@@ -112,36 +105,12 @@ public class ContentRepositoryTest {
@Test
public void loadFromJar() throws URISyntaxException {
assert Helper.JAR_REPOSITORY != null;
- this.repository = new ContentRepository(ResolvingMode.STRICT_RELATIVE.getStrategy(), Helper.JAR_REPOSITORY.toURI());
+ this.repository = new ContentRepository(Helper.getTestProcessor(), ResolvingMode.STRICT_RELATIVE.getStrategy(),
+ Helper.JAR_REPOSITORY.toURI());
final XsltExecutable xsltExecutable = this.repository.loadXsltScript(URI.create("report.xsl"));
assertThat(xsltExecutable).isNotNull();
- }
-
- @Test
- public void testLoadSchema() {
- final URL main = RelativeUriResolverTest.class.getClassLoader().getResource("loading/main.xsd");
- assert main != null;
- final Schema schema = this.repository.createSchema(main, new ClassPathResourceResolver("/loading"));
+ final Schema schema = this.repository.createSchema(URI.create("main.xsd"));
assertThat(schema).isNotNull();
}
- @Test
- public void testLoadSchemaPackaged() throws URISyntaxException {
- final URL main = RelativeUriResolverTest.class.getClassLoader().getResource("packaged/main.xsd");
- assert main != null;
- final Schema schema = this.repository.createSchema(main,
- new ClassPathResourceResolver(RelativeUriResolverTest.class.getClassLoader().getResource("packaged/").toURI()));
- assertThat(schema).isNotNull();
- }
-
- // @Test
- // public void loadFromJar() throws URISyntaxException {
- // this.content = new ContentRepository(TestObjectFactory.createProcessor(), Helper.JAR_REPOSITORY.toURI());
- // this.repository = new ScenarioRepository(this.content);
- // final CheckConfiguration conf = new CheckConfiguration(
- // ScenarioRepository.class.getClassLoader().getResource("xrechnung/scenarios.xml").toURI());
- // ScenarioRepository.initialize(conf);
- // assertThat(this.repository.getScenarios()).isNotNull();
- // }
-
}
diff --git a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
index 9588468..710aa5c 100644
--- a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java
@@ -65,16 +65,17 @@ public class DefaultCheckTest {
@Before
public void setup() throws URISyntaxException {
- final Configuration validConfig = Configuration.load(Simple.SCENARIOS, Simple.REPOSITORY_URI).build();
+ final Configuration validConfig = Configuration.load(Simple.SCENARIOS, Simple.REPOSITORY_URI).build(Helper.getTestProcessor());
this.validCheck = new DefaultCheck(validConfig);
- final Configuration errorConfig = Configuration.load(Simple.ERROR_SCENARIOS, Simple.REPOSITORY_URI).build();
+ final Configuration errorConfig = Configuration.load(Simple.ERROR_SCENARIOS, Simple.REPOSITORY_URI)
+ .build(Helper.getTestProcessor());
this.errorCheck = new DefaultCheck(errorConfig);
final Configuration jarConfig = Configuration
.load(requireNonNull(DefaultCheckTest.class.getClassLoader().getResource("simple/packaged/scenarios.xml")).toURI(),
requireNonNull(DefaultCheckTest.class.getClassLoader().getResource("simple/packaged/repository/")).toURI())
- .build();
+ .build(Helper.getTestProcessor());
this.jarScenarioCheck = new DefaultCheck(jarConfig);
}
@@ -248,8 +249,7 @@ public class DefaultCheckTest {
assertThat(result.isProcessingSuccessful()).isEqualTo(true);
// test compatible configuration
- node = this.validCheck.getConfiguration().getContentRepository().getProcessor().newDocumentBuilder()
- .build(new StreamSource(SIMPLE_VALID.toASCIIString()));
+ node = this.validCheck.getProcessor().newDocumentBuilder().build(new StreamSource(SIMPLE_VALID.toASCIIString()));
domInput = InputFactory.read(node, "node test");
result = this.validCheck.checkInput(domInput);
assertThat(result.isProcessingSuccessful()).isEqualTo(true);
diff --git a/src/test/java/de/kosit/validationtool/impl/Helper.java b/src/test/java/de/kosit/validationtool/impl/Helper.java
index 591f0e5..628ed20 100644
--- a/src/test/java/de/kosit/validationtool/impl/Helper.java
+++ b/src/test/java/de/kosit/validationtool/impl/Helper.java
@@ -30,6 +30,7 @@ import de.kosit.validationtool.api.Input;
import de.kosit.validationtool.api.ResolvingConfigurationStrategy;
import de.kosit.validationtool.impl.model.Result;
import de.kosit.validationtool.impl.tasks.DocumentParseAction;
+import de.kosit.validationtool.impl.xml.ProcessorProvider;
import de.kosit.validationtool.model.reportInput.XMLSyntaxError;
import net.sf.saxon.s9api.Processor;
@@ -61,6 +62,8 @@ public class Helper {
public static final URI SCENARIOS = ROOT.resolve("scenarios.xml");
+ public static final URI OTHER_SCENARIOS = ROOT.resolve("otherScenarios.xml");
+
public static final URI ERROR_SCENARIOS = ROOT.resolve("scenarios-with-errors.xml");
public static final URI REPOSITORY_URI = ROOT.resolve("repository/");
@@ -83,7 +86,7 @@ public class Helper {
public static final ContentRepository createContentRepository() {
final ResolvingConfigurationStrategy strategy = ResolvingMode.STRICT_RELATIVE.getStrategy();
- return new ContentRepository(strategy, Simple.REPOSITORY_URI);
+ return new ContentRepository(Helper.getTestProcessor(), strategy, Simple.REPOSITORY_URI);
}
public static URI getSchemaLocation() {
@@ -122,6 +125,8 @@ public class Helper {
public static final URL JAR_REPOSITORY = Helper.class.getClassLoader().getResource("simple/packaged/repository/");
+ public static final URI LARGE_XML = Paths.get("pom.xml").toUri();
+
/**
* Lädt ein XML-Dokument von der gegebenen URL
*
@@ -171,6 +176,6 @@ public class Helper {
}
public static Processor createProcessor() {
- return ResolvingMode.STRICT_RELATIVE.getStrategy().getProcessor();
+ return ProcessorProvider.getProcessor();
}
}
diff --git a/src/test/java/de/kosit/validationtool/impl/ScenarioRepositoryTest.java b/src/test/java/de/kosit/validationtool/impl/ScenarioRepositoryTest.java
index 418e765..fc1765c 100644
--- a/src/test/java/de/kosit/validationtool/impl/ScenarioRepositoryTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/ScenarioRepositoryTest.java
@@ -55,7 +55,8 @@ public class ScenarioRepositoryTest {
@Before
public void setup() {
this.configInstance = new TestConfiguration();
- this.configInstance.setContentRepository(new ContentRepository(ResolvingMode.STRICT_RELATIVE.getStrategy(), null));
+ this.configInstance
+ .setContentRepository(new ContentRepository(Helper.getTestProcessor(), ResolvingMode.STRICT_RELATIVE.getStrategy(), null));
final Scenario s = createScenario();
this.configInstance.setScenarios(new ArrayList<>());
@@ -106,6 +107,25 @@ public class ScenarioRepositoryTest {
assertThat(scenario.getObject().getName()).isEqualTo("fallback");
}
+ @Test
+ public void testNoConfiguration() {
+ this.expectedException.expect(IllegalArgumentException.class);
+ this.repository = new ScenarioRepository();
+ }
+
+ @Test
+ public void testFallbackOnMultipleConfigurations() {
+ final TestConfiguration first = this.configInstance;
+ first.setFallbackScenario(createFallback());
+ setup();// create new one;
+ final TestConfiguration second = this.configInstance;
+ second.setFallbackScenario(createFallback());
+ this.repository = new ScenarioRepository(first, second);
+ final Scenario fallback = this.repository.getFallbackScenario();
+ assertThat(fallback).isSameAs(first.getFallbackScenario());
+ assertThat(fallback).isNotSameAs(second.getFallbackScenario());
+ }
+
private XdmNode load(final URI uri) throws IOException {
return Helper.parseDocument(this.configInstance.getContentRepository().getProcessor(), read(uri.toURL())).getObject();
}
diff --git a/src/test/java/de/kosit/validationtool/impl/SimpleScenarioCheckTest.java b/src/test/java/de/kosit/validationtool/impl/SimpleScenarioCheckTest.java
index 8e3a5df..f782dea 100644
--- a/src/test/java/de/kosit/validationtool/impl/SimpleScenarioCheckTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/SimpleScenarioCheckTest.java
@@ -40,7 +40,7 @@ public class SimpleScenarioCheckTest {
@Before
public void setup() {
- final Configuration d = Configuration.load(Simple.SCENARIOS, Simple.REPOSITORY_URI).build();
+ final Configuration d = Configuration.load(Simple.SCENARIOS, Simple.REPOSITORY_URI).build(Helper.getTestProcessor());
this.implementation = new DefaultCheck(d);
}
diff --git a/src/test/java/de/kosit/validationtool/impl/TestObjectFactory.java b/src/test/java/de/kosit/validationtool/impl/TestObjectFactory.java
index 121092b..e74c4a0 100644
--- a/src/test/java/de/kosit/validationtool/impl/TestObjectFactory.java
+++ b/src/test/java/de/kosit/validationtool/impl/TestObjectFactory.java
@@ -16,8 +16,6 @@
package de.kosit.validationtool.impl;
-import de.kosit.validationtool.impl.xml.StrictLocalResolvingStrategy;
-
import net.sf.saxon.s9api.Processor;
/**
@@ -29,7 +27,7 @@ public class TestObjectFactory {
public static Processor createProcessor() {
if (processor == null) {
- processor = new StrictLocalResolvingStrategy().getProcessor();
+ processor = Helper.getTestProcessor();
}
return processor;
}
diff --git a/src/test/java/de/kosit/validationtool/impl/VersioningTest.java b/src/test/java/de/kosit/validationtool/impl/VersioningTest.java
index fd1d1cb..eecc6b7 100644
--- a/src/test/java/de/kosit/validationtool/impl/VersioningTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/VersioningTest.java
@@ -59,25 +59,25 @@ public class VersioningTest {
@Test
public void testBase() throws URISyntaxException {
- final Scenarios result = this.service.readXml(BASE.toURI(), Scenarios.class, this.repository.getScenarioSchema());
+ final Scenarios result = this.service.readXml(BASE.toURI(), Scenarios.class, SchemaProvider.getScenarioSchema());
assertThat(result).isNotNull();
}
@Test
public void testFrameworkIncrement() throws URISyntaxException {
- final Scenarios result = this.service.readXml(INCREMENT.toURI(), Scenarios.class, this.repository.getScenarioSchema());
+ final Scenarios result = this.service.readXml(INCREMENT.toURI(), Scenarios.class, SchemaProvider.getScenarioSchema());
assertThat(result).isNotNull();
}
@Test
public void testNewFeature() throws URISyntaxException {
this.exception.expect(ConversionService.ConversionExeption.class);
- this.service.readXml(NEW_FEATURE.toURI(), Scenarios.class, this.repository.getScenarioSchema());
+ this.service.readXml(NEW_FEATURE.toURI(), Scenarios.class, SchemaProvider.getScenarioSchema());
}
@Test
public void testNewVersion() throws URISyntaxException {
this.exception.expect(ConversionService.ConversionExeption.class);
- this.service.readXml(NEW_VERSION.toURI(), Scenarios.class, this.repository.getScenarioSchema());
+ this.service.readXml(NEW_VERSION.toURI(), Scenarios.class, SchemaProvider.getScenarioSchema());
}
}
diff --git a/src/test/java/de/kosit/validationtool/impl/input/StreamHelperTest.java b/src/test/java/de/kosit/validationtool/impl/input/StreamHelperTest.java
new file mode 100644
index 0000000..8e9815f
--- /dev/null
+++ b/src/test/java/de/kosit/validationtool/impl/input/StreamHelperTest.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.kosit.validationtool.impl.input;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.FilterInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.Charset;
+
+import org.apache.commons.io.IOUtils;
+import org.junit.Test;
+
+/**
+ * @author Andreas Penski
+ */
+public class StreamHelperTest {
+
+ /**
+ * Simulates a stream that is return 0 for {@link InputStream#available()} even though content is supplied.
+ */
+ private static class MyLazyStream extends FilterInputStream {
+
+ protected MyLazyStream(final InputStream in) {
+ super(in);
+ }
+
+ @Override
+ public int available() throws IOException {
+ return 0;
+ }
+ }
+
+ @Test
+ public void testLazyStream() throws IOException {
+ final String myContent = "SomeBytes";
+ try ( final InputStream in = new MyLazyStream(new ByteArrayInputStream(myContent.getBytes())) ) {
+ final BufferedInputStream peekable = StreamHelper.wrapPeekable(in);
+ assertThat(peekable.available()).isGreaterThan(0);
+ final String read = IOUtils.toString(peekable, Charset.defaultCharset());
+ assertThat(read).isEqualTo(myContent);
+ }
+ }
+}
diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java b/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java
index 2575c56..58389f6 100644
--- a/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java
@@ -26,6 +26,7 @@ import org.junit.Test;
import de.kosit.validationtool.api.AcceptRecommendation;
import de.kosit.validationtool.impl.ContentRepository;
+import de.kosit.validationtool.impl.Helper;
import de.kosit.validationtool.impl.ResolvingMode;
import de.kosit.validationtool.impl.tasks.CheckAction.Bag;
@@ -121,6 +122,7 @@ public class ComputeAcceptanceActionTest {
}
private static XPathExecutable createXpath(final String expression) {
- return new ContentRepository(ResolvingMode.STRICT_RELATIVE.getStrategy(), null).createXPath(expression, new HashMap<>());
+ return new ContentRepository(Helper.getTestProcessor(), ResolvingMode.STRICT_RELATIVE.getStrategy(), null).createXPath(expression,
+ new HashMap<>());
}
}
diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java b/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java
index 0f21e8b..ba2a571 100644
--- a/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/tasks/CreateReportActionTest.java
@@ -54,8 +54,7 @@ public class CreateReportActionTest {
@Before
public void setup() {
this.repository = Simple.createContentRepository();
- this.action = new CreateReportAction(this.repository.getProcessor(), new ConversionService(), this.repository.getResolver(),
- this.repository.getUnparsedTextURIResolver());
+ this.action = new CreateReportAction(this.repository.getProcessor(), new ConversionService());
}
@Test
@@ -85,7 +84,7 @@ public class CreateReportActionTest {
public void testExecutionException() throws SaxonApiException {
final Processor p = mock(Processor.class);
final DocumentBuilder documentBuilder = mock(DocumentBuilder.class);
- this.action = new CreateReportAction(p, new ConversionService(), null, null);
+ this.action = new CreateReportAction(p, new ConversionService());
when(p.newDocumentBuilder()).thenReturn(documentBuilder);
when(documentBuilder.build(any(Source.class))).thenThrow(new SaxonApiException("mocked"));
diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java b/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java
index 478cc50..f4645d7 100644
--- a/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java
@@ -44,10 +44,10 @@ import de.kosit.validationtool.api.XmlError.Severity;
import de.kosit.validationtool.impl.Helper;
import de.kosit.validationtool.impl.Helper.Simple;
import de.kosit.validationtool.impl.Scenario;
+import de.kosit.validationtool.impl.SchemaProvider;
import de.kosit.validationtool.impl.TestObjectFactory;
import de.kosit.validationtool.impl.input.SourceInput;
import de.kosit.validationtool.impl.tasks.CheckAction.Bag;
-import de.kosit.validationtool.impl.xml.StrictRelativeResolvingStrategy;
/**
* Tests die {@link SchemaValidationAction}.
@@ -62,7 +62,7 @@ public class SchemaValidatorActionTest {
@Before
public void setup() {
- this.service = new SchemaValidationAction(new StrictRelativeResolvingStrategy(), TestObjectFactory.createProcessor());
+ this.service = new SchemaValidationAction(TestObjectFactory.createProcessor());
}
@Test
@@ -89,7 +89,7 @@ public class SchemaValidatorActionTest {
@Test
public void testSchemaReferences() {
- final Schema reportInputSchema = Simple.createContentRepository().getReportInputSchema();
+ final Schema reportInputSchema = SchemaProvider.getReportInputSchema();
assertThat(reportInputSchema).isNotNull();
}
diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/SchematronValidationActionTest.java b/src/test/java/de/kosit/validationtool/impl/tasks/SchematronValidationActionTest.java
index 1e9852e..ce8b466 100644
--- a/src/test/java/de/kosit/validationtool/impl/tasks/SchematronValidationActionTest.java
+++ b/src/test/java/de/kosit/validationtool/impl/tasks/SchematronValidationActionTest.java
@@ -33,7 +33,6 @@ import de.kosit.validationtool.impl.ConversionService;
import de.kosit.validationtool.impl.Helper.Simple;
import de.kosit.validationtool.impl.Scenario;
import de.kosit.validationtool.impl.Scenario.Transformation;
-import de.kosit.validationtool.impl.xml.RelativeUriResolver;
import de.kosit.validationtool.model.scenarios.ResourceType;
import net.sf.saxon.s9api.SaxonApiException;
@@ -51,7 +50,7 @@ public class SchematronValidationActionTest {
@Before
public void setup() {
- this.action = new SchematronValidationAction(new RelativeUriResolver(Simple.REPOSITORY_URI), new ConversionService());
+ this.action = new SchematronValidationAction(new ConversionService());
}
@Test
diff --git a/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java b/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java
index 0f64a0f..d7f7d32 100644
--- a/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java
+++ b/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java
@@ -30,6 +30,7 @@ import org.oclc.purl.dsdl.svrl.SchematronOutput;
import de.kosit.validationtool.api.Input;
import de.kosit.validationtool.api.InputFactory;
+import de.kosit.validationtool.api.ResolvingConfigurationStrategy;
import de.kosit.validationtool.impl.ContentRepository;
import de.kosit.validationtool.impl.Helper;
import de.kosit.validationtool.impl.ResolvingMode;
@@ -82,6 +83,8 @@ public class TestBagBuilder {
t.setValidateWithXmlSchema(v);
final Scenario scenario = new Scenario(t);
scenario.setSchema(createSchema(schemafile.toURL()));
+ final ResolvingConfigurationStrategy strategy = ResolvingMode.STRICT_RELATIVE.getStrategy();
+ scenario.setFactory(strategy);
return scenario;
} catch (final MalformedURLException e) {
throw new IllegalArgumentException(e);
@@ -89,7 +92,8 @@ public class TestBagBuilder {
}
private static Schema createSchema(final URL toURL) {
- final ContentRepository contentRepository = new ContentRepository(ResolvingMode.STRICT_RELATIVE.getStrategy(), null);
+ final ContentRepository contentRepository = new ContentRepository(Helper.getTestProcessor(),
+ ResolvingMode.STRICT_RELATIVE.getStrategy(), null);
return contentRepository.createSchema(toURL);
}
diff --git a/src/test/java/de/kosit/validationtool/impl/xml/SchemaProviderTest.java b/src/test/java/de/kosit/validationtool/impl/xml/SchemaProviderTest.java
new file mode 100644
index 0000000..194c737
--- /dev/null
+++ b/src/test/java/de/kosit/validationtool/impl/xml/SchemaProviderTest.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2017-2020 Koordinierungsstelle für IT-Standards (KoSIT)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package de.kosit.validationtool.impl.xml;
+
+import javax.xml.validation.SchemaFactory;
+
+import de.kosit.validationtool.impl.ResolvingMode;
+
+/**
+ * @author Andreas Penski
+ */
+public class SchemaProviderTest {
+
+ private final SchemaFactory schemaFactory = ResolvingMode.STRICT_RELATIVE.getStrategy().createSchemaFactory();
+
+}
diff --git a/src/test/resources/examples/simple/otherScenarios.xml b/src/test/resources/examples/simple/otherScenarios.xml
new file mode 100644
index 0000000..12f5a91
--- /dev/null
+++ b/src/test/resources/examples/simple/otherScenarios.xml
@@ -0,0 +1,95 @@
+
+
+
+
+ HTML-TestSuite
+ QA
+ 2017-08-08
+
+
-
-
diff --git a/src/main/resources/gui/docs/api.md b/src/main/resources/gui/docs/api.md
deleted file mode 100644
index 34d0c71..0000000
--- a/src/main/resources/gui/docs/api.md
+++ /dev/null
@@ -1,42 +0,0 @@
-# API Usage
-The validation service listens to `POST`-requests to any server uri. You need to supply the xml/object to validate in the post body.
-The service expects a single plain input in the post body, e.g. `multipart/form-data` is not supported.
-
-Examples:
-
-* `cURL`
-```shell script
-curl --location --request POST 'http://localhost:8080' \
---header 'Content-Type: application/xml' \
---data-binary '@/target.xml'
-```
-
-* `java` (Apache HttpClient)
-```java
-HttpClient httpClient = HttpClientBuilder.create().build();
-HttpPost postRequest = new HttpPost("http://localhost:8080/");
-FileEntity entity = new FileEntity(Paths.get("some.xml").toFile(), ContentType.APPLICATION_XML);
-postRequest.setEntity(entity);
-HttpResponse response = httpClient.execute(postRequest);
-System.out.println(IOUtils.toString(response.getEntity().getContent()));
-```
-
-* `javascript`
-```javascript
-var myHeaders = new Headers();
-myHeaders.append("Content-Type", "application/xml");
-
-var file = "";
-
-var requestOptions = {
- method: 'POST',
- headers: myHeaders,
- body: file,
- redirect: 'follow'
-};
-
-fetch("http://localhost:8080", requestOptions)
- .then(response => response.text())
- .then(result => console.log(result))
- .catch(error => console.log('error', error));
-```
\ No newline at end of file
diff --git a/src/main/resources/gui/docs/configurations.md b/src/main/resources/gui/docs/configurations.md
deleted file mode 100644
index 0f3b31e..0000000
--- a/src/main/resources/gui/docs/configurations.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# Configurations
-
-The validator needs a scenario configuration for working properly.
-
-Currently, there are two public third party validation configurations available.
-
-* Validation Configuration for [XRechnung](http://www.xoev.de/de/xrechnung):
- * Source code is available on [GitHub](https://github.com/itplr-kosit/validator-configuration-xrechnung)
- * [Releases](https://github.com/itplr-kosit/validator-configuration-xrechnung/releases) can also be downloaded
-* Validation Configuration for [XGewerbeanzeige](https://xgewerbeanzeige.de/)
- * Source code is available on [GitHub](https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige)
- * [Releases](https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige/releases) can also be downloaded
-
-For creating custom configurations see [configuration documentation](https://github.com/itplr-kosit/validator/blob/master/docs/configurations.md)
-for details
\ No newline at end of file
diff --git a/src/main/resources/gui/index.html b/src/main/resources/gui/index.html
deleted file mode 100644
index 3b4735e..0000000
--- a/src/main/resources/gui/index.html
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
- Validator
-
-
-
-
-
-
-
-
-
-
Loading validator...
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/resources/gui/lib/License b/src/main/resources/gui/lib/License
deleted file mode 100644
index 4a5b531..0000000
--- a/src/main/resources/gui/lib/License
+++ /dev/null
@@ -1,23 +0,0 @@
-Sources in this diretory are based on https://github.com/docsifyjs/docsify/
-
-MIT License
-
-Copyright (c) 2016 - present cinwell.li
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file
diff --git a/src/main/resources/gui/lib/docsify.min.js b/src/main/resources/gui/lib/docsify.min.js
deleted file mode 100644
index 79db41b..0000000
--- a/src/main/resources/gui/lib/docsify.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(){function o(n){var r=Object.create(null);return function(e){var t=c(e)?e:JSON.stringify(e);return r[t]||(r[t]=n(e))}}var i=o(function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),l=Object.prototype.hasOwnProperty,d=Object.assign||function(e){for(var t=arguments,n=1;n=a.length)i(r);else if("function"==typeof e)if(2===e.length)e(r,function(e){r=e,s(t+1)});else{var n=e(r);r=void 0===n?r:n,s(t+1)}else s(t+1)};s(0)}var O=p.title;function P(){var e=m("section.cover");if(e){var t=e.getBoundingClientRect().height;window.pageYOffset>=t||e.classList.contains("hidden")?A(v,"add","sticky"):A(v,"remove","sticky")}}function z(e,t,r,n){var i=[];null!=(t=m(t))&&(i=y(t,"a"));var a,s=decodeURI(e.toURL(e.getCurrentPath()));return i.sort(function(e,t){return t.href.length-e.href.length}).forEach(function(e){var t=e.getAttribute("href"),n=r?e.parentNode:e;0!==s.indexOf(t)||a?A(n,"remove","active"):(a=e,A(n,"add","active"))}),n&&(p.title=a?a.title||a.innerText+" - "+O:O),a}var j=decodeURIComponent,N=encodeURIComponent;function M(e){var n={};return(e=e.trim().replace(/^(\?|#|&)/,""))&&e.split("&").forEach(function(e){var t=e.replace(/\+/g," ").split("=");n[t[0]]=t[1]&&j(t[1])}),n}function q(e,t){void 0===t&&(t=[]);var n=[];for(var r in e)-1this.end&&e>=this.next}[this.direction]}},{key:"_defaultEase",value:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}}]),X);function X(){var e=0o){t=t||u;break}t=u}if(t){var h=Q[re(decodeURIComponent(e),t.getAttribute("data-id"))];if(h&&h!==a&&(a&&a.classList.remove("active"),h.classList.add("active"),a=h,!J&&v.classList.contains("sticky"))){var p=n.clientHeight,d=a.offsetTop+a.clientHeight+40,g=d-0
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/css/styles.082f2d1f.css b/src/main/resources/ui/assets/css/styles.082f2d1f.css
new file mode 100644
index 0000000..b6a7630
--- /dev/null
+++ b/src/main/resources/ui/assets/css/styles.082f2d1f.css
@@ -0,0 +1 @@
+.col,.container{padding:0 var(--ifm-spacing-horizontal);width:100%}.markdown>h2,.markdown>h3,.markdown>h4,.markdown>h5,.markdown>h6{margin-bottom:calc(var(--ifm-heading-vertical-rhythm-bottom)*var(--ifm-leading))}.markdown li,body{word-wrap:break-word}body,ol ol,ol ul,ul ol,ul ul{margin:0}pre,table{overflow:auto}blockquote,pre{margin:0 0 var(--ifm-spacing-vertical)}.breadcrumbs__link,.button{transition-timing-function:var(--ifm-transition-timing-default)}.button,code{vertical-align:middle}.button--outline.button--active,.button--outline:active,.button--outline:hover,:root{--ifm-button-color:var(--ifm-font-color-base-inverse)}.menu__link:hover,a{transition:color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.navbar--dark,:root{--ifm-navbar-link-hover-color:var(--ifm-color-primary)}.menu,.navbar-sidebar{overflow-x:hidden}:root,html[data-theme=dark]{--ifm-color-emphasis-500:var(--ifm-color-gray-500)}.toggleButton_gllP,html{-webkit-tap-highlight-color:transparent}.clean-list,.containsTaskList_mC6p,.details_lb9f>summary,.dropdown__menu,.menu__list{list-style:none}:root{--ifm-color-scheme:light;--ifm-dark-value:10%;--ifm-darker-value:15%;--ifm-darkest-value:30%;--ifm-light-value:15%;--ifm-lighter-value:30%;--ifm-lightest-value:50%;--ifm-contrast-background-value:90%;--ifm-contrast-foreground-value:70%;--ifm-contrast-background-dark-value:70%;--ifm-contrast-foreground-dark-value:90%;--ifm-color-primary:#3578e5;--ifm-color-secondary:#ebedf0;--ifm-color-success:#00a400;--ifm-color-info:#54c7ec;--ifm-color-warning:#ffba00;--ifm-color-danger:#fa383e;--ifm-color-primary-dark:#306cce;--ifm-color-primary-darker:#2d66c3;--ifm-color-primary-darkest:#2554a0;--ifm-color-primary-light:#538ce9;--ifm-color-primary-lighter:#72a1ed;--ifm-color-primary-lightest:#9abcf2;--ifm-color-primary-contrast-background:#ebf2fc;--ifm-color-primary-contrast-foreground:#102445;--ifm-color-secondary-dark:#d4d5d8;--ifm-color-secondary-darker:#c8c9cc;--ifm-color-secondary-darkest:#a4a6a8;--ifm-color-secondary-light:#eef0f2;--ifm-color-secondary-lighter:#f1f2f5;--ifm-color-secondary-lightest:#f5f6f8;--ifm-color-secondary-contrast-background:#fdfdfe;--ifm-color-secondary-contrast-foreground:#474748;--ifm-color-success-dark:#009400;--ifm-color-success-darker:#008b00;--ifm-color-success-darkest:#007300;--ifm-color-success-light:#26b226;--ifm-color-success-lighter:#4dbf4d;--ifm-color-success-lightest:#80d280;--ifm-color-success-contrast-background:#e6f6e6;--ifm-color-success-contrast-foreground:#003100;--ifm-color-info-dark:#4cb3d4;--ifm-color-info-darker:#47a9c9;--ifm-color-info-darkest:#3b8ba5;--ifm-color-info-light:#6ecfef;--ifm-color-info-lighter:#87d8f2;--ifm-color-info-lightest:#aae3f6;--ifm-color-info-contrast-background:#eef9fd;--ifm-color-info-contrast-foreground:#193c47;--ifm-color-warning-dark:#e6a700;--ifm-color-warning-darker:#d99e00;--ifm-color-warning-darkest:#b38200;--ifm-color-warning-light:#ffc426;--ifm-color-warning-lighter:#ffcf4d;--ifm-color-warning-lightest:#ffdd80;--ifm-color-warning-contrast-background:#fff8e6;--ifm-color-warning-contrast-foreground:#4d3800;--ifm-color-danger-dark:#e13238;--ifm-color-danger-darker:#d53035;--ifm-color-danger-darkest:#af272b;--ifm-color-danger-light:#fb565b;--ifm-color-danger-lighter:#fb7478;--ifm-color-danger-lightest:#fd9c9f;--ifm-color-danger-contrast-background:#ffebec;--ifm-color-danger-contrast-foreground:#4b1113;--ifm-color-white:#fff;--ifm-color-black:#000;--ifm-color-gray-0:var(--ifm-color-white);--ifm-color-gray-100:#f5f6f7;--ifm-color-gray-200:#ebedf0;--ifm-color-gray-300:#dadde1;--ifm-color-gray-400:#ccd0d5;--ifm-color-gray-500:#bec3c9;--ifm-color-gray-600:#8d949e;--ifm-color-gray-700:#606770;--ifm-color-gray-800:#444950;--ifm-color-gray-900:#1c1e21;--ifm-color-gray-1000:var(--ifm-color-black);--ifm-color-emphasis-0:var(--ifm-color-gray-0);--ifm-color-emphasis-100:var(--ifm-color-gray-100);--ifm-color-emphasis-200:var(--ifm-color-gray-200);--ifm-color-emphasis-300:var(--ifm-color-gray-300);--ifm-color-emphasis-400:var(--ifm-color-gray-400);--ifm-color-emphasis-600:var(--ifm-color-gray-600);--ifm-color-emphasis-700:var(--ifm-color-gray-700);--ifm-color-emphasis-800:var(--ifm-color-gray-800);--ifm-color-emphasis-900:var(--ifm-color-gray-900);--ifm-color-emphasis-1000:var(--ifm-color-gray-1000);--ifm-color-content:var(--ifm-color-emphasis-900);--ifm-color-content-inverse:var(--ifm-color-emphasis-0);--ifm-color-content-secondary:#525860;--ifm-background-color:transparent;--ifm-background-surface-color:var(--ifm-color-content-inverse);--ifm-global-border-width:1px;--ifm-global-radius:0.4rem;--ifm-hover-overlay:rgba(0,0,0,.05);--ifm-font-color-base:var(--ifm-color-content);--ifm-font-color-base-inverse:var(--ifm-color-content-inverse);--ifm-font-color-secondary:var(--ifm-color-content-secondary);--ifm-font-family-base:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ifm-font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--ifm-font-size-base:100%;--ifm-font-weight-light:300;--ifm-font-weight-normal:400;--ifm-font-weight-semibold:500;--ifm-font-weight-bold:700;--ifm-font-weight-base:var(--ifm-font-weight-normal);--ifm-line-height-base:1.65;--ifm-global-spacing:1rem;--ifm-spacing-vertical:var(--ifm-global-spacing);--ifm-spacing-horizontal:var(--ifm-global-spacing);--ifm-transition-fast:200ms;--ifm-transition-slow:400ms;--ifm-transition-timing-default:cubic-bezier(0.08,0.52,0.52,1);--ifm-global-shadow-lw:0 1px 2px 0 rgba(0,0,0,.1);--ifm-global-shadow-md:0 5px 40px rgba(0,0,0,.2);--ifm-global-shadow-tl:0 12px 28px 0 rgba(0,0,0,.2),0 2px 4px 0 rgba(0,0,0,.1);--ifm-z-index-dropdown:100;--ifm-z-index-fixed:200;--ifm-z-index-overlay:400;--ifm-container-width:1140px;--ifm-container-width-xl:1320px;--ifm-code-background:#f6f7f8;--ifm-code-border-radius:var(--ifm-global-radius);--ifm-code-font-size:90%;--ifm-code-padding-horizontal:0.1rem;--ifm-code-padding-vertical:0.1rem;--ifm-pre-background:var(--ifm-code-background);--ifm-pre-border-radius:var(--ifm-code-border-radius);--ifm-pre-color:inherit;--ifm-pre-line-height:1.45;--ifm-pre-padding:1rem;--ifm-heading-color:inherit;--ifm-heading-margin-top:0;--ifm-heading-margin-bottom:var(--ifm-spacing-vertical);--ifm-heading-font-family:var(--ifm-font-family-base);--ifm-heading-font-weight:var(--ifm-font-weight-bold);--ifm-heading-line-height:1.25;--ifm-h1-font-size:2rem;--ifm-h2-font-size:1.5rem;--ifm-h3-font-size:1.25rem;--ifm-h4-font-size:1rem;--ifm-h5-font-size:0.875rem;--ifm-h6-font-size:0.85rem;--ifm-image-alignment-padding:1.25rem;--ifm-leading-desktop:1.25;--ifm-leading:calc(var(--ifm-leading-desktop)*1rem);--ifm-list-left-padding:2rem;--ifm-list-margin:1rem;--ifm-list-item-margin:0.25rem;--ifm-list-paragraph-margin:1rem;--ifm-table-cell-padding:0.75rem;--ifm-table-background:transparent;--ifm-table-stripe-background:rgba(0,0,0,.03);--ifm-table-border-width:1px;--ifm-table-border-color:var(--ifm-color-emphasis-300);--ifm-table-head-background:inherit;--ifm-table-head-color:inherit;--ifm-table-head-font-weight:var(--ifm-font-weight-bold);--ifm-table-cell-color:inherit;--ifm-link-color:var(--ifm-color-primary);--ifm-link-decoration:none;--ifm-link-hover-color:var(--ifm-link-color);--ifm-link-hover-decoration:underline;--ifm-paragraph-margin-bottom:var(--ifm-leading);--ifm-blockquote-font-size:var(--ifm-font-size-base);--ifm-blockquote-border-left-width:2px;--ifm-blockquote-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-blockquote-padding-vertical:0;--ifm-blockquote-shadow:none;--ifm-blockquote-color:var(--ifm-color-emphasis-800);--ifm-blockquote-border-color:var(--ifm-color-emphasis-300);--ifm-hr-background-color:var(--ifm-color-emphasis-500);--ifm-hr-height:1px;--ifm-hr-margin-vertical:1.5rem;--ifm-scrollbar-size:7px;--ifm-scrollbar-track-background-color:#f1f1f1;--ifm-scrollbar-thumb-background-color:silver;--ifm-scrollbar-thumb-hover-background-color:#a7a7a7;--ifm-alert-background-color:inherit;--ifm-alert-border-color:inherit;--ifm-alert-border-radius:var(--ifm-global-radius);--ifm-alert-border-width:0px;--ifm-alert-border-left-width:5px;--ifm-alert-color:var(--ifm-font-color-base);--ifm-alert-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-alert-padding-vertical:var(--ifm-spacing-vertical);--ifm-alert-shadow:var(--ifm-global-shadow-lw);--ifm-avatar-intro-margin:1rem;--ifm-avatar-intro-alignment:inherit;--ifm-avatar-photo-size:3rem;--ifm-badge-background-color:inherit;--ifm-badge-border-color:inherit;--ifm-badge-border-radius:var(--ifm-global-radius);--ifm-badge-border-width:var(--ifm-global-border-width);--ifm-badge-color:var(--ifm-color-white);--ifm-badge-padding-horizontal:calc(var(--ifm-spacing-horizontal)*0.5);--ifm-badge-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-breadcrumb-border-radius:1.5rem;--ifm-breadcrumb-spacing:0.5rem;--ifm-breadcrumb-color-active:var(--ifm-color-primary);--ifm-breadcrumb-item-background-active:var(--ifm-hover-overlay);--ifm-breadcrumb-padding-horizontal:0.8rem;--ifm-breadcrumb-padding-vertical:0.4rem;--ifm-breadcrumb-size-multiplier:1;--ifm-breadcrumb-separator:url('data:image/svg+xml;utf8,');--ifm-breadcrumb-separator-filter:none;--ifm-breadcrumb-separator-size:0.5rem;--ifm-breadcrumb-separator-size-multiplier:1.25;--ifm-button-background-color:inherit;--ifm-button-border-color:var(--ifm-button-background-color);--ifm-button-border-width:var(--ifm-global-border-width);--ifm-button-font-weight:var(--ifm-font-weight-bold);--ifm-button-padding-horizontal:1.5rem;--ifm-button-padding-vertical:0.375rem;--ifm-button-size-multiplier:1;--ifm-button-transition-duration:var(--ifm-transition-fast);--ifm-button-border-radius:calc(var(--ifm-global-radius)*var(--ifm-button-size-multiplier));--ifm-button-group-spacing:2px;--ifm-card-background-color:var(--ifm-background-surface-color);--ifm-card-border-radius:calc(var(--ifm-global-radius)*2);--ifm-card-horizontal-spacing:var(--ifm-global-spacing);--ifm-card-vertical-spacing:var(--ifm-global-spacing);--ifm-toc-border-color:var(--ifm-color-emphasis-300);--ifm-toc-link-color:var(--ifm-color-content-secondary);--ifm-toc-padding-vertical:0.5rem;--ifm-toc-padding-horizontal:0.5rem;--ifm-dropdown-background-color:var(--ifm-background-surface-color);--ifm-dropdown-font-weight:var(--ifm-font-weight-semibold);--ifm-dropdown-link-color:var(--ifm-font-color-base);--ifm-dropdown-hover-background-color:var(--ifm-hover-overlay);--ifm-footer-background-color:var(--ifm-color-emphasis-100);--ifm-footer-color:inherit;--ifm-footer-link-color:var(--ifm-color-emphasis-700);--ifm-footer-link-hover-color:var(--ifm-color-primary);--ifm-footer-link-horizontal-spacing:0.5rem;--ifm-footer-padding-horizontal:calc(var(--ifm-spacing-horizontal)*2);--ifm-footer-padding-vertical:calc(var(--ifm-spacing-vertical)*2);--ifm-footer-title-color:inherit;--ifm-footer-logo-max-width:min(30rem,90vw);--ifm-hero-background-color:var(--ifm-background-surface-color);--ifm-hero-text-color:var(--ifm-color-emphasis-800);--ifm-menu-color:var(--ifm-color-emphasis-700);--ifm-menu-color-active:var(--ifm-color-primary);--ifm-menu-color-background-active:var(--ifm-hover-overlay);--ifm-menu-color-background-hover:var(--ifm-hover-overlay);--ifm-menu-link-padding-horizontal:0.75rem;--ifm-menu-link-padding-vertical:0.375rem;--ifm-menu-link-sublist-icon:url('data:image/svg+xml;utf8,');--ifm-menu-link-sublist-icon-filter:none;--ifm-navbar-background-color:var(--ifm-background-surface-color);--ifm-navbar-height:3.75rem;--ifm-navbar-item-padding-horizontal:0.75rem;--ifm-navbar-item-padding-vertical:0.25rem;--ifm-navbar-link-color:var(--ifm-font-color-base);--ifm-navbar-link-active-color:var(--ifm-link-color);--ifm-navbar-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-navbar-padding-vertical:calc(var(--ifm-spacing-vertical)*0.5);--ifm-navbar-shadow:var(--ifm-global-shadow-lw);--ifm-navbar-search-input-background-color:var(--ifm-color-emphasis-200);--ifm-navbar-search-input-color:var(--ifm-color-emphasis-800);--ifm-navbar-search-input-placeholder-color:var(--ifm-color-emphasis-500);--ifm-navbar-search-input-icon:url('data:image/svg+xml;utf8,');--ifm-navbar-sidebar-width:83vw;--ifm-pagination-border-radius:var(--ifm-global-radius);--ifm-pagination-color-active:var(--ifm-color-primary);--ifm-pagination-font-size:1rem;--ifm-pagination-item-active-background:var(--ifm-hover-overlay);--ifm-pagination-page-spacing:0.2em;--ifm-pagination-padding-horizontal:calc(var(--ifm-spacing-horizontal)*1);--ifm-pagination-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-pagination-nav-border-radius:var(--ifm-global-radius);--ifm-pagination-nav-color-hover:var(--ifm-color-primary);--ifm-pills-color-active:var(--ifm-color-primary);--ifm-pills-color-background-active:var(--ifm-hover-overlay);--ifm-pills-spacing:0.125rem;--ifm-tabs-color:var(--ifm-font-color-secondary);--ifm-tabs-color-active:var(--ifm-color-primary);--ifm-tabs-color-active-border:var(--ifm-tabs-color-active);--ifm-tabs-padding-horizontal:1rem;--ifm-tabs-padding-vertical:1rem}.badge--danger,.badge--info,.badge--primary,.badge--secondary,.badge--success,.badge--warning{--ifm-badge-border-color:var(--ifm-badge-background-color)}.button--link,.button--outline{--ifm-button-background-color:transparent}*{box-sizing:border-box;scrollbar-color:var(--scrollthumb) transparent;scrollbar-width:thin}html{-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;background-color:var(--ifm-background-color);color:var(--ifm-font-color-base);color-scheme:var(--ifm-color-scheme);font:var(--ifm-font-size-base)/var(--ifm-line-height-base) var(--ifm-font-family-base);text-rendering:optimizelegibility}iframe{border:0;color-scheme:auto}.container{margin:0 auto;max-width:var(--ifm-container-width)}.container--fluid{max-width:inherit}.row{display:flex;flex-wrap:wrap;margin:0 calc(var(--ifm-spacing-horizontal)*-1)}.margin-bottom--none,.margin-vert--none,.markdown>:last-child{margin-bottom:0!important}.margin-top--none,.margin-vert--none{margin-top:0!important}.row--no-gutters{margin-left:0;margin-right:0}.margin-horiz--none,.margin-right--none{margin-right:0!important}.row--no-gutters>.col{padding-left:0;padding-right:0}.row--align-top{align-items:flex-start}.row--align-bottom{align-items:flex-end}.menuExternalLink_NmtK,.row--align-center{align-items:center}.row--align-stretch{align-items:stretch}.row--align-baseline{align-items:baseline}.col{--ifm-col-width:100%;flex:1 0;margin-left:0;max-width:var(--ifm-col-width)}.padding-bottom--none,.padding-vert--none{padding-bottom:0!important}.padding-top--none,.padding-vert--none{padding-top:0!important}.padding-horiz--none,.padding-left--none{padding-left:0!important}.padding-horiz--none,.padding-right--none{padding-right:0!important}.col[class*=col--]{flex:0 0 var(--ifm-col-width)}.col--1{--ifm-col-width:8.33333%}.col--offset-1{margin-left:8.33333%}.col--2{--ifm-col-width:16.66667%}.col--offset-2{margin-left:16.66667%}.col--3{--ifm-col-width:25%}.col--offset-3{margin-left:25%}.col--4{--ifm-col-width:33.33333%}.col--offset-4{margin-left:33.33333%}.col--5{--ifm-col-width:41.66667%}.col--offset-5{margin-left:41.66667%}.col--6{--ifm-col-width:50%}.col--offset-6{margin-left:50%}.col--7{--ifm-col-width:58.33333%}.col--offset-7{margin-left:58.33333%}.col--8{--ifm-col-width:66.66667%}.col--offset-8{margin-left:66.66667%}.col--9{--ifm-col-width:75%}.col--offset-9{margin-left:75%}.col--10{--ifm-col-width:83.33333%}.col--offset-10{margin-left:83.33333%}.col--11{--ifm-col-width:91.66667%}.col--offset-11{margin-left:91.66667%}.col--12{--ifm-col-width:100%}.col--offset-12{margin-left:100%}.margin-horiz--none,.margin-left--none{margin-left:0!important}.margin--none{margin:0!important}.margin-bottom--xs,.margin-vert--xs{margin-bottom:.25rem!important}.margin-top--xs,.margin-vert--xs{margin-top:.25rem!important}.margin-horiz--xs,.margin-left--xs{margin-left:.25rem!important}.margin-horiz--xs,.margin-right--xs{margin-right:.25rem!important}.margin--xs{margin:.25rem!important}.margin-bottom--sm,.margin-vert--sm{margin-bottom:.5rem!important}.margin-top--sm,.margin-vert--sm{margin-top:.5rem!important}.margin-horiz--sm,.margin-left--sm{margin-left:.5rem!important}.margin-horiz--sm,.margin-right--sm{margin-right:.5rem!important}.margin--sm{margin:.5rem!important}.margin-bottom--md,.margin-vert--md{margin-bottom:1rem!important}.margin-top--md,.margin-vert--md{margin-top:1rem!important}.margin-horiz--md,.margin-left--md{margin-left:1rem!important}.margin-horiz--md,.margin-right--md{margin-right:1rem!important}.margin--md{margin:1rem!important}.margin-bottom--lg,.margin-vert--lg{margin-bottom:2rem!important}.margin-top--lg,.margin-vert--lg{margin-top:2rem!important}.margin-horiz--lg,.margin-left--lg{margin-left:2rem!important}.margin-horiz--lg,.margin-right--lg{margin-right:2rem!important}.margin--lg{margin:2rem!important}.margin-bottom--xl,.margin-vert--xl{margin-bottom:5rem!important}.margin-top--xl,.margin-vert--xl{margin-top:5rem!important}.margin-horiz--xl,.margin-left--xl{margin-left:5rem!important}.margin-horiz--xl,.margin-right--xl{margin-right:5rem!important}.margin--xl{margin:5rem!important}.padding--none{padding:0!important}.padding-bottom--xs,.padding-vert--xs{padding-bottom:.25rem!important}.padding-top--xs,.padding-vert--xs{padding-top:.25rem!important}.padding-horiz--xs,.padding-left--xs{padding-left:.25rem!important}.padding-horiz--xs,.padding-right--xs{padding-right:.25rem!important}.padding--xs{padding:.25rem!important}.padding-bottom--sm,.padding-vert--sm{padding-bottom:.5rem!important}.padding-top--sm,.padding-vert--sm{padding-top:.5rem!important}.padding-horiz--sm,.padding-left--sm{padding-left:.5rem!important}.padding-horiz--sm,.padding-right--sm{padding-right:.5rem!important}.padding--sm{padding:.5rem!important}.padding-bottom--md,.padding-vert--md{padding-bottom:1rem!important}.padding-top--md,.padding-vert--md{padding-top:1rem!important}.padding-horiz--md,.padding-left--md{padding-left:1rem!important}.padding-horiz--md,.padding-right--md{padding-right:1rem!important}.padding--md{padding:1rem!important}.padding-bottom--lg,.padding-vert--lg{padding-bottom:2rem!important}.padding-top--lg,.padding-vert--lg{padding-top:2rem!important}.padding-horiz--lg,.padding-left--lg{padding-left:2rem!important}.padding-horiz--lg,.padding-right--lg{padding-right:2rem!important}.padding--lg{padding:2rem!important}.padding-bottom--xl,.padding-vert--xl{padding-bottom:5rem!important}.padding-top--xl,.padding-vert--xl{padding-top:5rem!important}.padding-horiz--xl,.padding-left--xl{padding-left:5rem!important}.padding-horiz--xl,.padding-right--xl{padding-right:5rem!important}.padding--xl{padding:5rem!important}code{background-color:var(--ifm-code-background);border:.1rem solid rgba(0,0,0,.1);border-radius:var(--ifm-code-border-radius);font-family:var(--ifm-font-family-monospace);font-size:var(--ifm-code-font-size);padding:var(--ifm-code-padding-vertical) var(--ifm-code-padding-horizontal)}a code{color:inherit}pre{background-color:var(--ifm-pre-background);border-radius:var(--ifm-pre-border-radius);color:var(--ifm-pre-color);font:var(--ifm-code-font-size)/var(--ifm-pre-line-height) var(--ifm-font-family-monospace);padding:var(--ifm-pre-padding)}pre code{background-color:transparent;border:none;font-size:100%;line-height:inherit;padding:0}kbd{background-color:var(--ifm-color-emphasis-0);border:1px solid var(--ifm-color-emphasis-400);border-radius:.2rem;box-shadow:inset 0 -1px 0 var(--ifm-color-emphasis-400);color:var(--ifm-color-emphasis-800);font:80% var(--ifm-font-family-monospace);padding:.15rem .3rem}h1,h2,h3,h4,h5,h6{color:var(--ifm-heading-color);font-family:var(--ifm-heading-font-family);font-weight:var(--ifm-heading-font-weight);line-height:var(--ifm-heading-line-height);margin:var(--ifm-heading-margin-top) 0 var(--ifm-heading-margin-bottom) 0}h1{font-size:var(--ifm-h1-font-size)}h2{font-size:var(--ifm-h2-font-size)}h3{font-size:var(--ifm-h3-font-size)}h4{font-size:var(--ifm-h4-font-size)}h5{font-size:var(--ifm-h5-font-size)}h6{font-size:var(--ifm-h6-font-size)}img{max-width:100%}img[align=right]{padding-left:var(--image-alignment-padding)}img[align=left]{padding-right:var(--image-alignment-padding)}.markdown{--ifm-h1-vertical-rhythm-top:3;--ifm-h2-vertical-rhythm-top:2;--ifm-h3-vertical-rhythm-top:1.5;--ifm-heading-vertical-rhythm-top:1.25;--ifm-h1-vertical-rhythm-bottom:1.25;--ifm-heading-vertical-rhythm-bottom:1}.markdown:after,.markdown:before{content:"";display:table}.markdown:after{clear:both}.markdown h1:first-child{--ifm-h1-font-size:3rem;margin-bottom:calc(var(--ifm-h1-vertical-rhythm-bottom)*var(--ifm-leading))}.markdown>h2{--ifm-h2-font-size:2rem;margin-top:calc(var(--ifm-h2-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h3{--ifm-h3-font-size:1.5rem;margin-top:calc(var(--ifm-h3-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h4,.markdown>h5,.markdown>h6{margin-top:calc(var(--ifm-heading-vertical-rhythm-top)*var(--ifm-leading))}.markdown>p,.markdown>pre,.markdown>ul{margin-bottom:var(--ifm-leading)}.markdown li>p{margin-top:var(--ifm-list-paragraph-margin)}.markdown li+li{margin-top:var(--ifm-list-item-margin)}ol,ul{margin:0 0 var(--ifm-list-margin);padding-left:var(--ifm-list-left-padding)}ol ol,ul ol{list-style-type:lower-roman}ol ol ol,ol ul ol,ul ol ol,ul ul ol{list-style-type:lower-alpha}table{border-collapse:collapse;display:block;margin-bottom:var(--ifm-spacing-vertical)}table thead tr{border-bottom:2px solid var(--ifm-table-border-color)}table thead,table tr:nth-child(2n){background-color:var(--ifm-table-stripe-background)}table tr{background-color:var(--ifm-table-background);border-top:var(--ifm-table-border-width) solid var(--ifm-table-border-color)}table td,table th{border:var(--ifm-table-border-width) solid var(--ifm-table-border-color);padding:var(--ifm-table-cell-padding)}table th{background-color:var(--ifm-table-head-background);color:var(--ifm-table-head-color);font-weight:var(--ifm-table-head-font-weight)}table td{color:var(--ifm-table-cell-color)}strong{font-weight:var(--ifm-font-weight-bold)}a{color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration)}a:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.button:hover,.text--no-decoration,.text--no-decoration:hover,a:not([href]){text-decoration:none}p{margin:0 0 var(--ifm-paragraph-margin-bottom)}blockquote{border-left:var(--ifm-blockquote-border-left-width) solid var(--ifm-blockquote-border-color);box-shadow:var(--ifm-blockquote-shadow);color:var(--ifm-blockquote-color);font-size:var(--ifm-blockquote-font-size);padding:var(--ifm-blockquote-padding-vertical) var(--ifm-blockquote-padding-horizontal)}blockquote>:first-child{margin-top:0}blockquote>:last-child{margin-bottom:0}hr{background-color:var(--ifm-hr-background-color);border:0;height:var(--ifm-hr-height);margin:var(--ifm-hr-margin-vertical) 0}.shadow--lw{box-shadow:var(--ifm-global-shadow-lw)!important}.shadow--md{box-shadow:var(--ifm-global-shadow-md)!important}.shadow--tl{box-shadow:var(--ifm-global-shadow-tl)!important}.text--primary,.wordWrapButtonEnabled_EoeP .wordWrapButtonIcon_Bwma{color:var(--ifm-color-primary)}.text--secondary{color:var(--ifm-color-secondary)}.text--success{color:var(--ifm-color-success)}.text--info{color:var(--ifm-color-info)}.text--warning{color:var(--ifm-color-warning)}.text--danger{color:var(--ifm-color-danger)}.text--center{text-align:center}.text--left{text-align:left}.text--justify{text-align:justify}.text--right{text-align:right}.text--capitalize{text-transform:capitalize}.text--lowercase{text-transform:lowercase}.alert__heading,.text--uppercase{text-transform:uppercase}.text--light{font-weight:var(--ifm-font-weight-light)}.text--normal{font-weight:var(--ifm-font-weight-normal)}.text--semibold{font-weight:var(--ifm-font-weight-semibold)}.text--bold{font-weight:var(--ifm-font-weight-bold)}.text--italic{font-style:italic}.text--truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text--break{word-wrap:break-word!important;word-break:break-word!important}.clean-btn{background:none;border:none;color:inherit;cursor:pointer;font-family:inherit;padding:0}.alert,.alert .close{color:var(--ifm-alert-foreground-color)}.clean-list{padding-left:0}.alert--primary{--ifm-alert-background-color:var(--ifm-color-primary-contrast-background);--ifm-alert-background-color-highlight:rgba(53,120,229,.15);--ifm-alert-foreground-color:var(--ifm-color-primary-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-primary-dark)}.alert--secondary{--ifm-alert-background-color:var(--ifm-color-secondary-contrast-background);--ifm-alert-background-color-highlight:rgba(235,237,240,.15);--ifm-alert-foreground-color:var(--ifm-color-secondary-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-secondary-dark)}.alert--success{--ifm-alert-background-color:var(--ifm-color-success-contrast-background);--ifm-alert-background-color-highlight:rgba(0,164,0,.15);--ifm-alert-foreground-color:var(--ifm-color-success-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-success-dark)}.alert--info{--ifm-alert-background-color:var(--ifm-color-info-contrast-background);--ifm-alert-background-color-highlight:rgba(84,199,236,.15);--ifm-alert-foreground-color:var(--ifm-color-info-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-info-dark)}.alert--warning{--ifm-alert-background-color:var(--ifm-color-warning-contrast-background);--ifm-alert-background-color-highlight:rgba(255,186,0,.15);--ifm-alert-foreground-color:var(--ifm-color-warning-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-warning-dark)}.alert--danger{--ifm-alert-background-color:var(--ifm-color-danger-contrast-background);--ifm-alert-background-color-highlight:rgba(250,56,62,.15);--ifm-alert-foreground-color:var(--ifm-color-danger-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-danger-dark)}.alert{--ifm-code-background:var(--ifm-alert-background-color-highlight);--ifm-link-color:var(--ifm-alert-foreground-color);--ifm-link-hover-color:var(--ifm-alert-foreground-color);--ifm-link-decoration:underline;--ifm-tabs-color:var(--ifm-alert-foreground-color);--ifm-tabs-color-active:var(--ifm-alert-foreground-color);--ifm-tabs-color-active-border:var(--ifm-alert-border-color);background-color:var(--ifm-alert-background-color);border:var(--ifm-alert-border-width) solid var(--ifm-alert-border-color);border-left-width:var(--ifm-alert-border-left-width);border-radius:var(--ifm-alert-border-radius);box-shadow:var(--ifm-alert-shadow);padding:var(--ifm-alert-padding-vertical) var(--ifm-alert-padding-horizontal)}.alert__heading{align-items:center;display:flex;font:700 var(--ifm-h5-font-size)/var(--ifm-heading-line-height) var(--ifm-heading-font-family);margin-bottom:.5rem}.alert__icon{display:inline-flex;margin-right:.4em}.alert__icon svg{fill:var(--ifm-alert-foreground-color);stroke:var(--ifm-alert-foreground-color);stroke-width:0}.alert .close{margin:calc(var(--ifm-alert-padding-vertical)*-1) calc(var(--ifm-alert-padding-horizontal)*-1) 0 0;opacity:.75}.alert .close:focus,.alert .close:hover{opacity:1}.alert a{text-decoration-color:var(--ifm-alert-border-color)}.alert a:hover{text-decoration-thickness:2px}.avatar{-moz-column-gap:var(--ifm-avatar-intro-margin);column-gap:var(--ifm-avatar-intro-margin);display:flex}.avatar__photo{border-radius:50%;display:block;height:var(--ifm-avatar-photo-size);overflow:hidden;width:var(--ifm-avatar-photo-size)}.card--full-height,.navbar__logo img,body,html{height:100%}.avatar__photo--sm{--ifm-avatar-photo-size:2rem}.avatar__photo--lg{--ifm-avatar-photo-size:4rem}.avatar__photo--xl{--ifm-avatar-photo-size:6rem}.avatar__intro{display:flex;flex:1 1;flex-direction:column;justify-content:center;text-align:var(--ifm-avatar-intro-alignment)}.badge,.breadcrumbs__item,.breadcrumbs__link,.button,.dropdown>.navbar__link:after{display:inline-block}.avatar__name{font:700 var(--ifm-h4-font-size)/var(--ifm-heading-line-height) var(--ifm-font-family-base)}.avatar__subtitle{margin-top:.25rem}.avatar--vertical{--ifm-avatar-intro-alignment:center;--ifm-avatar-intro-margin:0.5rem;align-items:center;flex-direction:column}.badge{background-color:var(--ifm-badge-background-color);border:var(--ifm-badge-border-width) solid var(--ifm-badge-border-color);border-radius:var(--ifm-badge-border-radius);color:var(--ifm-badge-color);font-size:75%;font-weight:var(--ifm-font-weight-bold);line-height:1;padding:var(--ifm-badge-padding-vertical) var(--ifm-badge-padding-horizontal)}.badge--primary{--ifm-badge-background-color:var(--ifm-color-primary)}.badge--secondary{--ifm-badge-background-color:var(--ifm-color-secondary);color:var(--ifm-color-black)}.breadcrumbs__link,.button.button--secondary.button--outline:not(.button--active):not(:hover){color:var(--ifm-font-color-base)}.badge--success{--ifm-badge-background-color:var(--ifm-color-success)}.badge--info{--ifm-badge-background-color:var(--ifm-color-info)}.badge--warning{--ifm-badge-background-color:var(--ifm-color-warning)}.badge--danger{--ifm-badge-background-color:var(--ifm-color-danger)}.breadcrumbs{margin-bottom:0;padding-left:0}.breadcrumbs__item:not(:last-child):after{background:var(--ifm-breadcrumb-separator) center;content:" ";display:inline-block;filter:var(--ifm-breadcrumb-separator-filter);height:calc(var(--ifm-breadcrumb-separator-size)*var(--ifm-breadcrumb-size-multiplier)*var(--ifm-breadcrumb-separator-size-multiplier));margin:0 var(--ifm-breadcrumb-spacing);opacity:.5;width:calc(var(--ifm-breadcrumb-separator-size)*var(--ifm-breadcrumb-size-multiplier)*var(--ifm-breadcrumb-separator-size-multiplier))}.breadcrumbs__item--active .breadcrumbs__link{background:var(--ifm-breadcrumb-item-background-active);color:var(--ifm-breadcrumb-color-active)}.breadcrumbs__link{border-radius:var(--ifm-breadcrumb-border-radius);font-size:calc(1rem*var(--ifm-breadcrumb-size-multiplier));padding:calc(var(--ifm-breadcrumb-padding-vertical)*var(--ifm-breadcrumb-size-multiplier)) calc(var(--ifm-breadcrumb-padding-horizontal)*var(--ifm-breadcrumb-size-multiplier));transition-duration:var(--ifm-transition-fast);transition-property:background,color}.breadcrumbs__link:link:hover,.breadcrumbs__link:visited:hover,area.breadcrumbs__link[href]:hover{background:var(--ifm-breadcrumb-item-background-active);text-decoration:none}.breadcrumbs__link:-moz-any-link:hover{background:var(--ifm-breadcrumb-item-background-active);text-decoration:none}.breadcrumbs__link:any-link:hover{background:var(--ifm-breadcrumb-item-background-active);text-decoration:none}.breadcrumbs--sm{--ifm-breadcrumb-size-multiplier:0.8}.breadcrumbs--lg{--ifm-breadcrumb-size-multiplier:1.2}.button{background-color:var(--ifm-button-background-color);border:var(--ifm-button-border-width) solid var(--ifm-button-border-color);border-radius:var(--ifm-button-border-radius);cursor:pointer;font-size:calc(.875rem*var(--ifm-button-size-multiplier));font-weight:var(--ifm-button-font-weight);line-height:1.5;padding:calc(var(--ifm-button-padding-vertical)*var(--ifm-button-size-multiplier)) calc(var(--ifm-button-padding-horizontal)*var(--ifm-button-size-multiplier));text-align:center;transition-duration:var(--ifm-button-transition-duration);transition-property:color,background,border-color;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.button,.button:hover{color:var(--ifm-button-color)}.button--outline{--ifm-button-color:var(--ifm-button-border-color)}.button--outline:hover{--ifm-button-background-color:var(--ifm-button-border-color)}.button--link{--ifm-button-border-color:transparent;color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration)}.button--link.button--active,.button--link:active,.button--link:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.button.disabled,.button:disabled,.button[disabled]{opacity:.65;pointer-events:none}.button--sm{--ifm-button-size-multiplier:0.8}.button--lg{--ifm-button-size-multiplier:1.35}.button--block{display:block;width:100%}.button.button--secondary{color:var(--ifm-color-gray-900)}:where(.button--primary){--ifm-button-background-color:var(--ifm-color-primary);--ifm-button-border-color:var(--ifm-color-primary)}:where(.button--primary):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-primary-dark);--ifm-button-border-color:var(--ifm-color-primary-dark)}.button--primary.button--active,.button--primary:active{--ifm-button-background-color:var(--ifm-color-primary-darker);--ifm-button-border-color:var(--ifm-color-primary-darker)}:where(.button--secondary){--ifm-button-background-color:var(--ifm-color-secondary);--ifm-button-border-color:var(--ifm-color-secondary)}:where(.button--secondary):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-secondary-dark);--ifm-button-border-color:var(--ifm-color-secondary-dark)}.button--secondary.button--active,.button--secondary:active{--ifm-button-background-color:var(--ifm-color-secondary-darker);--ifm-button-border-color:var(--ifm-color-secondary-darker)}:where(.button--success){--ifm-button-background-color:var(--ifm-color-success);--ifm-button-border-color:var(--ifm-color-success)}:where(.button--success):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-success-dark);--ifm-button-border-color:var(--ifm-color-success-dark)}.button--success.button--active,.button--success:active{--ifm-button-background-color:var(--ifm-color-success-darker);--ifm-button-border-color:var(--ifm-color-success-darker)}:where(.button--info){--ifm-button-background-color:var(--ifm-color-info);--ifm-button-border-color:var(--ifm-color-info)}:where(.button--info):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-info-dark);--ifm-button-border-color:var(--ifm-color-info-dark)}.button--info.button--active,.button--info:active{--ifm-button-background-color:var(--ifm-color-info-darker);--ifm-button-border-color:var(--ifm-color-info-darker)}:where(.button--warning){--ifm-button-background-color:var(--ifm-color-warning);--ifm-button-border-color:var(--ifm-color-warning)}:where(.button--warning):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-warning-dark);--ifm-button-border-color:var(--ifm-color-warning-dark)}.button--warning.button--active,.button--warning:active{--ifm-button-background-color:var(--ifm-color-warning-darker);--ifm-button-border-color:var(--ifm-color-warning-darker)}:where(.button--danger){--ifm-button-background-color:var(--ifm-color-danger);--ifm-button-border-color:var(--ifm-color-danger)}:where(.button--danger):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-danger-dark);--ifm-button-border-color:var(--ifm-color-danger-dark)}.button--danger.button--active,.button--danger:active{--ifm-button-background-color:var(--ifm-color-danger-darker);--ifm-button-border-color:var(--ifm-color-danger-darker)}.button-group{display:inline-flex;gap:var(--ifm-button-group-spacing)}.button-group>.button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.button-group>.button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.button-group--block{display:flex;justify-content:stretch}.button-group--block>.button{flex-grow:1}.card{background-color:var(--ifm-card-background-color);border-radius:var(--ifm-card-border-radius);box-shadow:var(--ifm-global-shadow-lw);display:flex;flex-direction:column;overflow:hidden}.card__image{padding-top:var(--ifm-card-vertical-spacing)}.card__image:first-child{padding-top:0}.card__body,.card__footer,.card__header{padding:var(--ifm-card-vertical-spacing) var(--ifm-card-horizontal-spacing)}.card__body:not(:last-child),.card__footer:not(:last-child),.card__header:not(:last-child){padding-bottom:0}.card__body>:last-child,.card__footer>:last-child,.card__header>:last-child{margin-bottom:0}.card__footer{margin-top:auto}.table-of-contents{font-size:.8rem;margin-bottom:0;padding:var(--ifm-toc-padding-vertical) 0}.table-of-contents,.table-of-contents ul{list-style:none;padding-left:var(--ifm-toc-padding-horizontal)}.table-of-contents li{margin:var(--ifm-toc-padding-vertical) var(--ifm-toc-padding-horizontal)}.table-of-contents__left-border{border-left:1px solid var(--ifm-toc-border-color)}.table-of-contents__link{color:var(--ifm-toc-link-color);display:block}.table-of-contents__link--active,.table-of-contents__link--active code,.table-of-contents__link:hover,.table-of-contents__link:hover code{color:var(--ifm-color-primary);text-decoration:none}.close{color:var(--ifm-color-black);float:right;font-size:1.5rem;font-weight:var(--ifm-font-weight-bold);line-height:1;opacity:.5;padding:1rem;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.close:hover{opacity:.7}.close:focus,.theme-code-block-highlighted-line .codeLineNumber_Tfdd:before{opacity:.8}.dropdown{display:inline-flex;font-weight:var(--ifm-dropdown-font-weight);position:relative;vertical-align:top}.dropdown--hoverable:hover .dropdown__menu,.dropdown--show .dropdown__menu{opacity:1;pointer-events:all;transform:translateY(-1px);visibility:visible}#nprogress,.dropdown__menu,.dropzone_p8R5:before,.navbar__item.dropdown .navbar__link:not([href]),.spinnerWrapper_KcTt{pointer-events:none}.dropdown--right .dropdown__menu{left:inherit;right:0}.dropdown--nocaret .navbar__link:after{content:none!important}.dropdown__menu{background-color:var(--ifm-dropdown-background-color);border-radius:var(--ifm-global-radius);box-shadow:var(--ifm-global-shadow-md);left:0;max-height:80vh;min-width:10rem;opacity:0;overflow-y:auto;padding:.5rem;position:absolute;top:calc(100% - var(--ifm-navbar-item-padding-vertical) + .3rem);transform:translateY(-.625rem);transition-duration:var(--ifm-transition-fast);transition-property:opacity,transform,visibility;transition-timing-function:var(--ifm-transition-timing-default);visibility:hidden;z-index:var(--ifm-z-index-dropdown)}.menu__caret,.menu__link,.menu__list-item-collapsible{border-radius:.25rem;transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.dropdown__link{border-radius:.25rem;color:var(--ifm-dropdown-link-color);display:block;font-size:.875rem;margin-top:.2rem;padding:.25rem .5rem;white-space:nowrap}.dropdown__link--active,.dropdown__link:hover{background-color:var(--ifm-dropdown-hover-background-color);color:var(--ifm-dropdown-link-color);text-decoration:none}.dropdown__link--active,.dropdown__link--active:hover{--ifm-dropdown-link-color:var(--ifm-link-color)}.dropdown>.navbar__link:after{border-color:currentcolor transparent;border-style:solid;border-width:.4em .4em 0;content:"";margin-left:.3em;position:relative;top:2px;transform:translateY(-50%)}.footer{background-color:var(--ifm-footer-background-color);color:var(--ifm-footer-color);padding:var(--ifm-footer-padding-vertical) var(--ifm-footer-padding-horizontal)}.footer--dark{--ifm-footer-background-color:#303846;--ifm-footer-color:var(--ifm-footer-link-color);--ifm-footer-link-color:var(--ifm-color-secondary);--ifm-footer-title-color:var(--ifm-color-white)}.footer__links{margin-bottom:1rem}.footer__link-item{color:var(--ifm-footer-link-color);line-height:2}.footer__link-item:hover{color:var(--ifm-footer-link-hover-color)}.footer__link-separator{margin:0 var(--ifm-footer-link-horizontal-spacing)}.footer__logo{margin-top:1rem;max-width:var(--ifm-footer-logo-max-width)}.footer__title{color:var(--ifm-footer-title-color);font:700 var(--ifm-h4-font-size)/var(--ifm-heading-line-height) var(--ifm-font-family-base);margin-bottom:var(--ifm-heading-margin-bottom)}.menu,.navbar__link{font-weight:var(--ifm-font-weight-semibold)}.docItemContainer_Djhp article>:first-child,.docItemContainer_Djhp header+*,.footer__item{margin-top:0}.admonitionContent_S0QG>:last-child,.collapsibleContent_i85q>:last-child,.footer__items{margin-bottom:0}.codeBlockStandalone_MEMb,[type=checkbox]{padding:0}.hero{align-items:center;background-color:var(--ifm-hero-background-color);color:var(--ifm-hero-text-color);display:flex;padding:4rem 2rem}.hero--primary{--ifm-hero-background-color:var(--ifm-color-primary);--ifm-hero-text-color:var(--ifm-font-color-base-inverse)}.hero--dark{--ifm-hero-background-color:#303846;--ifm-hero-text-color:var(--ifm-color-white)}.headline_fEIe,.hero__title{font-size:3rem}.hero__subtitle{font-size:1.5rem}.menu__list{margin:0;padding-left:0}.menu__caret,.menu__link{padding:var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal)}.menu__list .menu__list{flex:0 0 100%;margin-top:.25rem;padding-left:var(--ifm-menu-link-padding-horizontal)}.menu__list-item:not(:first-child){margin-top:.25rem}.menu__list-item--collapsed .menu__list{height:0;overflow:hidden}.details_lb9f[data-collapsed=false].isBrowser_bmU9>summary:before,.details_lb9f[open]:not(.isBrowser_bmU9)>summary:before,.menu__list-item--collapsed .menu__caret:before,.menu__list-item--collapsed .menu__link--sublist:after{transform:rotate(90deg)}.menu__list-item-collapsible{display:flex;flex-wrap:wrap;position:relative}.menu__caret:hover,.menu__link:hover,.menu__list-item-collapsible--active,.menu__list-item-collapsible:hover{background:var(--ifm-menu-color-background-hover)}.menu__list-item-collapsible .menu__link--active,.menu__list-item-collapsible .menu__link:hover{background:none!important}.menu__caret,.menu__link{align-items:center;display:flex}.menu__link{color:var(--ifm-menu-color);flex:1;line-height:1.25}.menu__link:hover{color:var(--ifm-menu-color);text-decoration:none}.menu__caret:before,.menu__link--sublist-caret:after{height:1.25rem;transform:rotate(180deg);transition:transform var(--ifm-transition-fast) linear;width:1.25rem;content:"";filter:var(--ifm-menu-link-sublist-icon-filter)}.menu__link--sublist-caret:after{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem;margin-left:auto;min-width:1.25rem}.menu__link--active,.menu__link--active:hover{color:var(--ifm-menu-color-active)}.navbar__brand,.navbar__link{color:var(--ifm-navbar-link-color)}.menu__link--active:not(.menu__link--sublist){background-color:var(--ifm-menu-color-background-active)}.menu__caret:before{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem}.navbar--dark,html[data-theme=dark]{--ifm-menu-link-sublist-icon-filter:invert(100%) sepia(94%) saturate(17%) hue-rotate(223deg) brightness(104%) contrast(98%)}.navbar{background-color:var(--ifm-navbar-background-color);box-shadow:var(--ifm-navbar-shadow);height:var(--ifm-navbar-height);padding:var(--ifm-navbar-padding-vertical) var(--ifm-navbar-padding-horizontal)}.dropzone_p8R5:before,.navbar-sidebar,.skipToContent_fXgn:focus{box-shadow:var(--ifm-global-shadow-md)}.docsWrapper_BCFX,.navbar,.navbar>.container,.navbar>.container-fluid{display:flex}.navbar--fixed-top{position:sticky;top:0;z-index:var(--ifm-z-index-fixed)}.navbar-sidebar,.navbar-sidebar__backdrop{opacity:0;position:fixed;transition-timing-function:ease-in-out;left:0;top:0;visibility:hidden;bottom:0}.navbar__inner{display:flex;flex-wrap:wrap;justify-content:space-between;width:100%}.navbar__brand{align-items:center;display:flex;margin-right:1rem;min-width:0}.navbar__brand:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.announcementBarContent_xLdY,.navbar__title{flex:1 1 auto}.navbar__toggle{display:none;margin-right:.5rem}.navbar__logo{flex:0 0 auto;height:2rem;margin-right:.5rem}.navbar__items{align-items:center;display:flex;flex:1;min-width:0}.navbar__items--center{flex:0 0 auto}.navbar__items--center .navbar__brand{margin:0}.navbar__items--center+.navbar__items--right{flex:1}.navbar__items--right{flex:0 0 auto;justify-content:flex-end}.navbar__items--right>:last-child{padding-right:0}.navbar__item{display:inline-block;padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.navbar__link--active,.navbar__link:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.navbar--dark,.navbar--primary{--ifm-menu-color:var(--ifm-color-gray-300);--ifm-navbar-link-color:var(--ifm-color-gray-100);--ifm-navbar-search-input-background-color:hsla(0,0%,100%,.1);--ifm-navbar-search-input-placeholder-color:hsla(0,0%,100%,.5);color:var(--ifm-color-white)}.navbar--dark{--ifm-navbar-background-color:#242526;--ifm-menu-color-background-active:hsla(0,0%,100%,.05);--ifm-navbar-search-input-color:var(--ifm-color-white)}.navbar--primary{--ifm-navbar-background-color:var(--ifm-color-primary);--ifm-navbar-link-hover-color:var(--ifm-color-white);--ifm-menu-color-active:var(--ifm-color-white);--ifm-navbar-search-input-color:var(--ifm-color-emphasis-500)}.navbar__search-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ifm-navbar-search-input-background-color) var(--ifm-navbar-search-input-icon) no-repeat .75rem center/1rem 1rem;border:none;border-radius:2rem;color:var(--ifm-navbar-search-input-color);cursor:text;display:inline-block;font-size:.9rem;height:2rem;padding:0 .5rem 0 2.25rem;width:12.5rem}.navbar__search-input::-moz-placeholder{color:var(--ifm-navbar-search-input-placeholder-color)}.navbar__search-input::placeholder{color:var(--ifm-navbar-search-input-placeholder-color)}.navbar-sidebar{background-color:var(--ifm-navbar-background-color);transform:translate3d(-100%,0,0);transition-duration:.25s;transition-property:opacity,visibility,transform;width:var(--ifm-navbar-sidebar-width)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar__items{transform:translateZ(0)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar--show .navbar-sidebar__backdrop{opacity:1;visibility:visible}.navbar-sidebar__backdrop{background-color:rgba(0,0,0,.6);right:0;transition-duration:.1s;transition-property:opacity,visibility}.navbar-sidebar__brand{align-items:center;box-shadow:var(--ifm-navbar-shadow);display:flex;flex:1;height:var(--ifm-navbar-height);padding:var(--ifm-navbar-padding-vertical) var(--ifm-navbar-padding-horizontal)}.backToTopButton_sjWU,.dropzone_p8R5{box-shadow:var(--ifm-global-shadow-lw)}.navbar-sidebar__items{display:flex;height:calc(100% - var(--ifm-navbar-height));transition:transform var(--ifm-transition-fast) ease-in-out}.navbar-sidebar__items--show-secondary{transform:translate3d(calc((var(--ifm-navbar-sidebar-width))*-1),0,0)}.navbar-sidebar__item{flex-shrink:0;padding:.5rem;width:calc(var(--ifm-navbar-sidebar-width))}.navbar-sidebar__back{background:var(--ifm-menu-color-background-active);font-size:15px;font-weight:var(--ifm-button-font-weight);margin:0 0 .2rem -.5rem;padding:.6rem 1.5rem;position:relative;text-align:left;top:-.5rem;width:calc(100% + 1rem)}.navbar-sidebar__close{display:flex;margin-left:auto}.pagination{-moz-column-gap:var(--ifm-pagination-page-spacing);column-gap:var(--ifm-pagination-page-spacing);display:flex;font-size:var(--ifm-pagination-font-size);padding-left:0}.pagination--sm{--ifm-pagination-font-size:0.8rem;--ifm-pagination-padding-horizontal:0.8rem;--ifm-pagination-padding-vertical:0.2rem}.pagination--lg{--ifm-pagination-font-size:1.2rem;--ifm-pagination-padding-horizontal:1.2rem;--ifm-pagination-padding-vertical:0.3rem}.pagination__item{display:inline-flex}.pagination__item>span{padding:var(--ifm-pagination-padding-vertical)}.pagination__item--active .pagination__link{color:var(--ifm-pagination-color-active)}.pagination__item--active .pagination__link,.pagination__item:not(.pagination__item--active):hover .pagination__link{background:var(--ifm-pagination-item-active-background)}.pagination__item--disabled,.pagination__item[disabled]{opacity:.25;pointer-events:none}.pagination__link{border-radius:var(--ifm-pagination-border-radius);color:var(--ifm-font-color-base);display:inline-block;padding:var(--ifm-pagination-padding-vertical) var(--ifm-pagination-padding-horizontal);transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pagination__link:hover{text-decoration:none}.pagination-nav{grid-gap:var(--ifm-spacing-horizontal);display:grid;gap:var(--ifm-spacing-horizontal);grid-template-columns:repeat(2,1fr)}.pagination-nav__link{border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-pagination-nav-border-radius);display:block;height:100%;line-height:var(--ifm-heading-line-height);padding:var(--ifm-global-spacing);transition:border-color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pagination-nav__link:hover{border-color:var(--ifm-pagination-nav-color-hover);text-decoration:none}.pagination-nav__link--next{grid-column:2/3;text-align:right}.pagination-nav__label{font-size:var(--ifm-h4-font-size);font-weight:var(--ifm-heading-font-weight);word-break:break-word}.pagination-nav__link--prev .pagination-nav__label:before{content:"« "}.pagination-nav__link--next .pagination-nav__label:after{content:" »"}.pagination-nav__sublabel{color:var(--ifm-color-content-secondary);font-size:var(--ifm-h5-font-size);font-weight:var(--ifm-font-weight-semibold);margin-bottom:.25rem}.pills__item,.tabs{font-weight:var(--ifm-font-weight-bold)}.pills{display:flex;gap:var(--ifm-pills-spacing);padding-left:0}.pills__item{border-radius:.5rem;cursor:pointer;display:inline-block;padding:.25rem 1rem;transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.tabs,:not(.containsTaskList_mC6p>li)>.containsTaskList_mC6p{padding-left:0}.pills__item--active{color:var(--ifm-pills-color-active)}.pills__item--active,.pills__item:not(.pills__item--active):hover{background:var(--ifm-pills-color-background-active)}.pills--block{justify-content:stretch}.pills--block .pills__item{flex-grow:1;text-align:center}.tabs{color:var(--ifm-tabs-color);display:flex;margin-bottom:0;overflow-x:auto}.tabs__item{border-bottom:3px solid transparent;border-radius:var(--ifm-global-radius);cursor:pointer;display:inline-flex;padding:var(--ifm-tabs-padding-vertical) var(--ifm-tabs-padding-horizontal);transition:background-color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.tabs__item--active{border-bottom-color:var(--ifm-tabs-color-active-border);border-bottom-left-radius:0;border-bottom-right-radius:0;color:var(--ifm-tabs-color-active)}.tabs__item:hover{background-color:var(--ifm-hover-overlay)}.tabs--block{justify-content:stretch}.tabs--block .tabs__item{flex-grow:1;justify-content:center}html[data-theme=dark]{--ifm-color-scheme:dark;--ifm-color-emphasis-0:var(--ifm-color-gray-1000);--ifm-color-emphasis-100:var(--ifm-color-gray-900);--ifm-color-emphasis-200:var(--ifm-color-gray-800);--ifm-color-emphasis-300:var(--ifm-color-gray-700);--ifm-color-emphasis-400:var(--ifm-color-gray-600);--ifm-color-emphasis-600:var(--ifm-color-gray-400);--ifm-color-emphasis-700:var(--ifm-color-gray-300);--ifm-color-emphasis-800:var(--ifm-color-gray-200);--ifm-color-emphasis-900:var(--ifm-color-gray-100);--ifm-color-emphasis-1000:var(--ifm-color-gray-0);--ifm-background-color:#1b1b1d;--ifm-background-surface-color:#242526;--ifm-hover-overlay:hsla(0,0%,100%,.05);--ifm-color-content:#e3e3e3;--ifm-color-content-secondary:#fff;--ifm-breadcrumb-separator-filter:invert(64%) sepia(11%) saturate(0%) hue-rotate(149deg) brightness(99%) contrast(95%);--ifm-code-background:hsla(0,0%,100%,.1);--ifm-scrollbar-track-background-color:#444;--ifm-scrollbar-thumb-background-color:#686868;--ifm-scrollbar-thumb-hover-background-color:#7a7a7a;--ifm-table-stripe-background:hsla(0,0%,100%,.07);--ifm-toc-border-color:var(--ifm-color-emphasis-200);--ifm-color-primary-contrast-background:#102445;--ifm-color-primary-contrast-foreground:#ebf2fc;--ifm-color-secondary-contrast-background:#474748;--ifm-color-secondary-contrast-foreground:#fdfdfe;--ifm-color-success-contrast-background:#003100;--ifm-color-success-contrast-foreground:#e6f6e6;--ifm-color-info-contrast-background:#193c47;--ifm-color-info-contrast-foreground:#eef9fd;--ifm-color-warning-contrast-background:#4d3800;--ifm-color-warning-contrast-foreground:#fff8e6;--ifm-color-danger-contrast-background:#4b1113;--ifm-color-danger-contrast-foreground:#ffebec}:root{--docusaurus-progress-bar-color:var(--ifm-color-primary);--ifm-color-primary:var(--blue-3);--ifm-color-primary-dark:var(--blue-4);--ifm-color-primary-darker:var(--blue-5);--ifm-color-primary-darkest:var(--blue-6);--ifm-color-primary-light:var(--blue-2);--ifm-color-primary-lighter:var(--blue-1);--ifm-color-primary-lightest:var(--blue-0);--ifm-code-font-size:95%;--docusaurus-highlighted-code-line-bg:rgba(0,0,0,.1);--ifm-global-radius:var(--border-radius-small);--ifm-font-family-base:var(--font-sans);--ifm-font-family-monospace:var(--font-mono);--docusaurus-announcement-bar-height:auto;--docusaurus-tag-list-border:var(--ifm-color-emphasis-300);--docusaurus-collapse-button-bg:transparent;--docusaurus-collapse-button-bg-hover:rgba(0,0,0,.1);--doc-sidebar-width:300px;--doc-sidebar-hidden-width:30px}#nprogress .bar{background:var(--docusaurus-progress-bar-color);height:2px;left:0;position:fixed;top:0;width:100%;z-index:1031}#nprogress .peg{box-shadow:0 0 10px var(--docusaurus-progress-bar-color),0 0 5px var(--docusaurus-progress-bar-color);height:100%;opacity:1;position:absolute;right:0;transform:rotate(3deg) translateY(-4px);width:100px}[data-theme=dark]:root{--docusaurus-highlighted-code-line-bg:rgba(0,0,0,.3);--ifm-background-color:var(--surface-6);--docusaurus-collapse-button-bg:hsla(0,0%,100%,.05);--docusaurus-collapse-button-bg-hover:hsla(0,0%,100%,.1)}[data-theme] .footer{--ifm-footer-background-color:var(--surface-accent-4);--ifm-footer-color:var(--text-accent-bg-main);--ifm-footer-link-color:var(--text-accent-bg-main);--ifm-footer-link-hover-color:var(--text-accent-bg-main);--ifm-footer-title-color:var(--text-accent-bg-main)}[data-theme=dark] .footer{--ifm-footer-background-color:var(--surface-6);border-top:1px solid var(--ifm-table-border-color)}[data-theme] .navbar{--ifm-navbar-background-color:var(--blue-4)}:where(html){--blue-0:#e6f4ff;--blue-1:#99d3ff;--blue-2:#4db2ff;--blue-3:#0088f0;--blue-4:#2d426c;--blue-5:#243556;--blue-6:#1b2841;--gray-0:#fff;--gray-1:#f5f7fa;--gray-2:#f0f1f5;--gray-3:#e6e9ef;--gray-4:#b3bac1;--gray-5:#67727e;--gray-6:#1c2126;--red-0:#fdeded;--red-1:#f9cdcf;--red-2:#f28c91;--red-3:#eb4750;--red-4:#b8141d;--red-5:#5a161a;--orange-0:#faf0d1;--orange-1:#f5e2a3;--orange-2:#efd06c;--orange-3:#b89214;--orange-4:#735b0d;--orange-5:#2e2405;--green-0:#dbfff4;--green-1:#7affd7;--green-2:#00e6a1;--green-3:#00996b;--green-4:#006647;--green-5:#003324;--surface-0:var(--gray-0);--surface-1:var(--gray-1);--surface-2:var(--gray-2);--surface-3:var(--gray-3);--surface-4:var(--gray-4);--surface-5:var(--gray-5);--surface-6:var(--gray-6);--surface-accent-0:var(--blue-0);--surface-accent-1:var(--blue-1);--surface-accent-2:var(--blue-2);--surface-accent-3:var(--blue-3);--surface-accent-4:var(--blue-4);--surface-accent-5:var(--blue-5);--text-0:var(--gray-4);--text-1:var(--gray-5);--text-2:var(--gray-6);--text-main:var(--text-2);--text-faded:var(--text-1);--text-accent-0:var(--blue-3);--text-accent-1:var(--blue-4);--text-accent-2:var(--blue-5);--text-accent:var(--text-accent-2);--text-accent-bg-0:var(--gray-0);--text-accent-bg-1:var(--gray-1);--text-accent-bg-2:var(--gray-4);--text-accent-bg-3:var(--blue-4);--text-accent-bg-main:var(--text-accent-bg-0);--text-negative:var(--red-3);--text-error:var(--red-3);--text-warning:var(--orange-3);--text-info:var(--blue-3);--text-success:var(--green-3);--divider:var(--gray-4);--scrollthumb:var(--gray-4);--input-background:var(--surface-0);--input-background-disabled:var(--surface-2);--border-radius-small:2px;--border-radius-medium:0.2rem;--border-radius-large:1rem;--color-border:var(--gray-4);--color-border-hover:var(--gray-4);--color-border-accent:var(--blue-2);--color-border-accent-hover:var(--blue-2);--font-sans:"Open Sans",system-ui,-apple-system,"Segoe UI","Roboto","Ubuntu","Cantarell","Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--font-serif:ui-serif,serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--font-mono:"Cascadia Code","Dank Mono","Operator Mono","Inconsolata","Fira Mono",ui-monospace,"SF Mono","Monaco","Droid Sans Mono","Source Code Pro",monospace,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"}::-webkit-scrollbar{height:min(8px,.5rem);width:min(8px,.5rem)}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background-color:var(--scrollthumb);border-radius:999rem}body:not(.navigation-with-keyboard) :not(input):focus{outline:0}#docusaurus-base-url-issue-banner-container,.collapseSidebarButton_PEFL,.docSidebarContainer_b6E3,.sidebarLogo_isFc,.themedImage_ToTc,[data-theme=dark] .lightToggleIcon_pyhR,[data-theme=light] .darkToggleIcon_wfgR,html[data-announcement-bar-initially-dismissed=true] .announcementBar_mb4j{display:none}.skipToContent_fXgn{background-color:var(--ifm-background-surface-color);color:var(--ifm-color-emphasis-900);left:100%;padding:calc(var(--ifm-global-spacing)/2) var(--ifm-global-spacing);position:fixed;top:1rem;z-index:calc(var(--ifm-z-index-fixed) + 1)}.skipToContent_fXgn:focus{left:1rem}.closeButton_CVFx{line-height:0;padding:0}.content_knG7{font-size:85%;padding:5px 0;text-align:center}.content_knG7 a{color:inherit;text-decoration:underline}.announcementBar_mb4j{align-items:center;background-color:var(--ifm-color-white);border-bottom:1px solid var(--ifm-color-emphasis-100);color:var(--ifm-color-black);display:flex;height:var(--docusaurus-announcement-bar-height)}.announcementBarPlaceholder_vyr4{flex:0 0 10px}.announcementBarClose_gvF7{align-self:stretch;flex:0 0 30px}.toggle_vylO{height:2rem;width:2rem}.toggleButton_gllP{align-items:center;border-radius:50%;display:flex;height:100%;justify-content:center;transition:background var(--ifm-transition-fast);width:100%}.toggleButton_gllP:hover{background:var(--ifm-color-emphasis-200)}.toggleButtonDisabled_aARS{cursor:not-allowed}[data-theme=dark] .themedImage--dark_i4oU,[data-theme=light] .themedImage--light_HNdA{display:initial}.iconExternalLink_nPIU{margin-left:.3rem}.iconLanguage_nlXk{margin-right:5px;vertical-align:text-bottom}.navbarHideable_m1mJ{transition:transform var(--ifm-transition-fast) ease}.navbarHidden_jGov{transform:translate3d(0,calc(-100% - 2px),0)}.footerLogoLink_BH7S{opacity:.5;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.footerLogoLink_BH7S:hover{opacity:1}.mainWrapper_z2l0{flex:1 0 auto}.docusaurus-mt-lg{margin-top:3rem}#__docusaurus{display:flex;flex-direction:column;min-height:100%}.iconEdit_Z9Sw{margin-right:.3em;vertical-align:sub}.tag_zVej{border:1px solid var(--docusaurus-tag-list-border);transition:border var(--ifm-transition-fast)}.tag_zVej:hover{--docusaurus-tag-list-border:var(--ifm-link-color);text-decoration:none}.tagRegular_sFm0{border-radius:var(--ifm-global-radius);font-size:90%;padding:.2rem .5rem .3rem}.tagWithCount_h2kH{align-items:center;border-left:0;display:flex;padding:0 .5rem 0 1rem;position:relative}.tagWithCount_h2kH:after,.tagWithCount_h2kH:before{border:1px solid var(--docusaurus-tag-list-border);content:"";position:absolute;top:50%;transition:inherit}.tagWithCount_h2kH:before{border-bottom:0;border-right:0;height:1.18rem;right:100%;transform:translate(50%,-50%) rotate(-45deg);width:1.18rem}.tagWithCount_h2kH:after{border-radius:50%;height:.5rem;left:0;transform:translateY(-50%);width:.5rem}.tagWithCount_h2kH span{background:var(--ifm-color-secondary);border-radius:var(--ifm-global-radius);color:var(--ifm-color-black);font-size:.7rem;line-height:1.2;margin-left:.3rem;padding:.1rem .4rem}.tags_jXut{display:inline}.tag_QGVx{display:inline-block;margin:0 .4rem .5rem 0}.lastUpdated_vwxv{font-size:smaller;font-style:italic;margin-top:.2rem}.tocCollapsibleButton_TO0P{align-items:center;display:flex;font-size:inherit;justify-content:space-between;padding:.4rem .8rem;width:100%}.tocCollapsibleButton_TO0P:after{background:var(--ifm-menu-link-sublist-icon) 50% 50%/2rem 2rem no-repeat;content:"";filter:var(--ifm-menu-link-sublist-icon-filter);height:1.25rem;transform:rotate(180deg);transition:transform var(--ifm-transition-fast);width:1.25rem}.tocCollapsibleButtonExpanded_MG3E:after,.tocCollapsibleExpanded_sAul{transform:none}.tocCollapsible_ETCw{background-color:var(--ifm-menu-color-background-active);border-radius:var(--ifm-global-radius);margin:1rem 0}.tocCollapsibleContent_vkbj>ul{border-left:none;border-top:1px solid var(--ifm-color-emphasis-300);font-size:15px;padding:.2rem 0}.tocCollapsibleContent_vkbj ul li{margin:.4rem .8rem}.tocCollapsibleContent_vkbj a{display:block}.backToTopButton_sjWU{background-color:var(--ifm-color-emphasis-200);border-radius:50%;bottom:1.3rem;height:3rem;opacity:0;position:fixed;right:1.3rem;transform:scale(0);transition:all var(--ifm-transition-fast) var(--ifm-transition-timing-default);visibility:hidden;width:3rem;z-index:calc(var(--ifm-z-index-fixed) - 1)}.dropzone_p8R5,.fileHoverPreview_IJ6m{background:var(--dropzone-color-background);color:var(--dropzone-color-text);display:flex}.backToTopButton_sjWU:after{background-color:var(--ifm-color-emphasis-1000);content:" ";display:inline-block;height:100%;-webkit-mask:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem no-repeat;mask:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem no-repeat;width:100%}.backToTopButtonShow_xfvO{opacity:1;transform:scale(1);visibility:visible}.docMainContainer_gTbr,.docPage__5DB{display:flex;width:100%}:where(.dropzone_p8R5){--dropzone-color-text:var(--text-faded);--dropzone-icon-active:var(--text-accent-2);--dropzone-color-background:var(--surface-2);--dropzone-color-background-active:var(--surface-accent-0);--dropzone-color-border:var(--color-border);--dropzone-color-border-active:var(--color-border-accent);--dropzone-opacity-hover-preview:0;--dropzone-shadow-opacity:0;--dropzone-border-size:0.2rem}:where([data-theme=dark] .dropzone_p8R5){--dropzone-color-text:var(--text-0);--dropzone-icon-active:var(--text-accent-0);--dropzone-color-background:transparent;--dropzone-color-background-active:var(--surface-accent-5)}.fileHoverPreview_IJ6m,.hasFiles_h6nl{--dropzone-color-background:var(--dropzone-color-background-active);--dropzone-color-border:var(--dropzone-color-border-active)}.dropzone_p8R5{align-items:center;border:var(--dropzone-border-size) dashed var(--dropzone-color-border);border-radius:var(--border-radius-medium);cursor:pointer;height:15em;justify-content:center;position:relative;width:100%}.dropzone_p8R5:before{bottom:0;content:"";left:0;opacity:var(--dropzone-shadow-opacity);position:absolute;right:0;top:0;transition:opacity .2s;z-index:-1}.active_ajsO{--dropzone-opacity-hover-preview:0.8;--dropzone-shadow-opacity:1}.hasFiles_h6nl{--dropzone-shadow-opacity:0.25}.fileHoverPreview_IJ6m{align-items:center;border:var(--dropzone-border-size) dashed var(--dropzone-color-border);border-radius:var(--border-radius-medium);bottom:calc(var(--dropzone-border-size)*-1);justify-content:center;left:calc(var(--dropzone-border-size)*-1);opacity:var(--dropzone-opacity-hover-preview);position:absolute;right:calc(var(--dropzone-border-size)*-1);top:calc(var(--dropzone-border-size)*-1);transition:opacity .15s ease-in-out}.button_HbCM,.wrapper_DZPG{position:relative}.icon_Zdm0{font-size:3rem;height:1em;width:1em}.fileHoverIcon_TFrZ{color:var(--dropzone-icon-active);font-size:5rem}.button_HbCM,.button__Owf{font-family:inherit;font-size:.875rem;font-weight:var(--ifm-font-weight-semibold);line-height:1;cursor:pointer;text-transform:uppercase}.uploadIcon__9vU{color:var(--dropzone-color-text);margin-right:.5rem}.codeblock_Yfbc{box-shadow:inset var(--ifm-global-shadow-lw);margin:0}:where(.buttonWrapper_BACP){--codeblock-button-text-color:var(--text-main);--codeblock-button-background-color:var(--surface-2);--codeblock-button-background-color-hover:var(--surface-accent-1);--codeblock-button-separator-color:var(--surface-4);--codeblock-button-border-color:var(--codeblock-button-separator-color);--codeblock-button-icon-size:1.5rem;--codeblock-button-size:2rem;--codeblock-button-shadow:var(--ifm-global-shadow-tl)}:where([data-theme=dark] .buttonWrapper_BACP){--codeblock-button-text-color:var(--text-0);--codeblock-button-background-color:var(--surface-6);--codeblock-button-background-color-hover:var(--surface-5);--codeblock-button-separator-color:var(--codeblock-button-text-color);--codeblock-button-shadow:var(--ifm-global-shadow-tl);--codeblock-button-shadow:none}.button_HbCM{background:var(--codeblock-button-background-color);border:none;border-radius:var(--border-radius-small);border-radius:0;color:var(--codeblock-button-text-color);height:var(--codeblock-button-size);height:2.25em;padding:0;transition:color .2s,background-color .2s;width:var(--codeblock-button-size)}.button_HbCM:not(:first-child){border-left:1px solid var(--codeblock-button-separator-color)}.button_HbCM:first-child{border-bottom-left-radius:var(--border-radius-small);border-top-left-radius:var(--border-radius-small)}.button_HbCM:last-child{border-bottom-right-radius:var(--border-radius-small);border-top-right-radius:var(--border-radius-small)}.button_HbCM:focus,.button_HbCM:hover{background:var(--codeblock-button-background-color-hover)}.button_HbCM svg{height:var(--codeblock-button-icon-size);width:var(--codeblock-button-icon-size)}.buttonWrapper_BACP{border:1px solid var(--codeblock-button-border-color);border-radius:var(--border-radius-small);box-shadow:var(--codeblock-button-shadow);display:flex;opacity:.75;position:absolute;right:1rem;top:1rem;transition:opacity .3s;z-index:1}.buttonWrapper_BACP:focus-within,.buttonWrapper_BACP:hover{opacity:1}.errorDisplay_QTmW{background-color:var(--red-3);border-radius:var(--ifm-global-radius);box-shadow:var(--ifm-global-shadow-lw);color:var(--text-accent-bg-0);display:flex;flex-direction:column;gap:.75em;margin:1em 0;padding:.75em 1.25em}.title_GCFt{display:block;line-height:1}:where(.button__Owf){--button-shadow:var(--ifm-global-shadow-lw);--button-accent-shadow:var(--ifm-global-shadow-md);--button-text-color:var(--text-accent-bg-0);--button-background-color:var(--surface-accent-3);--button-background-color-hover:var(--surface-accent-4);--button-background-color-disabled:var(--surface-4);--button-accent-shadow-opacity:0}:where([data-theme=dark] .button__Owf){--button-shadow:none;--button-accent-shadow:none;--button-text-color:var(--text-accent-bg-0);--button-background-color:var(--surface-accent-4);--button-background-color-hover:var(--surface-accent-3);--button-background-color-disabled:var(--surface-5);--button-accent-shadow-opacity:0}.button__Owf{background:var(--button-background-color);border:none;border-radius:var(--border-radius-small);box-shadow:var(--button-shadow);color:var(--button-text-color);height:2.25em;padding:0 1.25em;position:relative;transition:color .15s,background-color .15s}.button__Owf:before,.spinnerWrapper_KcTt{bottom:0;position:absolute;right:0;top:0;left:0}.button__Owf:before{box-shadow:var(--button-accent-shadow);content:"";opacity:var(--button-accent-shadow-opacity);transition:opacity .2s}.button__Owf:where(:hover,:focus){--button-background-color:var(--button-background-color-hover)}.button__Owf:not([disabled]):where(:hover,:focus){--button-accent-shadow-opacity:1}.button__Owf:not([disabled]):where(:active){--button-accent-shadow-opacity:0.5}.button__Owf[disabled]{--button-background-color:var(--button-background-color-disabled);cursor:auto}.spinnerWrapper_KcTt{-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);background:#ffffff55;display:grid;opacity:0;place-content:center;transition:opacity .15s}.buttonGroup__atx button,.codeBlockContainer_Ckt0{background:var(--prism-background-color);color:var(--prism-color)}.hash-link:focus,.loading_FTzi .spinnerWrapper_KcTt,:hover>.hash-link{opacity:1}.spinner_hC2W{--_size:1.75rem;--_thickness:3px;animation:1.1s cubic-bezier(.5,.1,.5,.9) infinite a;border:var(--_thickness) solid var(--button-text-color);border-bottom-color:transparent;border-radius:50%;height:var(--_size);width:var(--_size)}@keyframes a{0%{rotate:0deg}to{rotate:1turn}}.buttonGroup__nLk{display:flex;justify-content:flex-end;margin:1rem 0}.resultDisplay_JbbN{margin:1em 0}.withError_Jabi{border:.2rem solid var(--text-error);border-radius:var(--border-radius-small)}.codeBlockContainer_Ckt0{border-radius:var(--ifm-code-border-radius);box-shadow:var(--ifm-global-shadow-lw);margin-bottom:var(--ifm-leading)}.codeBlockContent_biex{border-radius:inherit;direction:ltr;position:relative}.codeBlockTitle_Ktv7{border-bottom:1px solid var(--ifm-color-emphasis-300);border-top-left-radius:inherit;border-top-right-radius:inherit;font-size:var(--ifm-code-font-size);font-weight:500;padding:.75rem var(--ifm-pre-padding)}.codeBlock_bY9V{--ifm-pre-background:var(--prism-background-color);margin:0;padding:0}.codeBlockTitle_Ktv7+.codeBlockContent_biex .codeBlock_bY9V{border-top-left-radius:0;border-top-right-radius:0}.codeBlockLines_e6Vv{float:left;font:inherit;min-width:100%;padding:var(--ifm-pre-padding)}.codeBlockLinesWithNumbering_o6Pm{display:table;padding:var(--ifm-pre-padding) 0}.buttonGroup__atx{-moz-column-gap:.2rem;column-gap:.2rem;display:flex;position:absolute;right:calc(var(--ifm-pre-padding)/2);top:calc(var(--ifm-pre-padding)/2)}.buttonGroup__atx button{align-items:center;border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-global-radius);display:flex;line-height:0;opacity:0;padding:.4rem;transition:opacity .2s ease-in-out}.buttonGroup__atx button:focus-visible,.buttonGroup__atx button:hover{opacity:1!important}.theme-code-block:hover .buttonGroup__atx button{opacity:.4}:where(:root){--docusaurus-highlighted-code-line-bg:#484d5b}:where([data-theme=dark]){--docusaurus-highlighted-code-line-bg:#646464}.theme-code-block-highlighted-line{background-color:var(--docusaurus-highlighted-code-line-bg);display:block;margin:0 calc(var(--ifm-pre-padding)*-1);padding:0 var(--ifm-pre-padding)}.codeLine_lJS_{counter-increment:a;display:table-row}.codeLineNumber_Tfdd{background:var(--ifm-pre-background);display:table-cell;left:0;overflow-wrap:normal;padding:0 var(--ifm-pre-padding);position:sticky;text-align:right;width:1%}.codeLineNumber_Tfdd:before{content:counter(a);opacity:.4}.codeLineContent_feaV{padding-right:var(--ifm-pre-padding)}.theme-code-block:hover .copyButtonCopied_obH4{opacity:1!important}.copyButtonIcons_eSgA{height:1.125rem;position:relative;width:1.125rem}.copyButtonIcon_y97N,.copyButtonSuccessIcon_LjdS{fill:currentColor;height:inherit;left:0;opacity:inherit;position:absolute;top:0;transition:.15s;width:inherit}.copyButtonSuccessIcon_LjdS{color:#00d600;left:50%;opacity:0;top:50%;transform:translate(-50%,-50%) scale(.33)}.copyButtonCopied_obH4 .copyButtonIcon_y97N{opacity:0;transform:scale(.33)}.copyButtonCopied_obH4 .copyButtonSuccessIcon_LjdS{opacity:1;transform:translate(-50%,-50%) scale(1);transition-delay:75ms}.wordWrapButtonIcon_Bwma{height:1.2rem;width:1.2rem}.details_lb9f{--docusaurus-details-summary-arrow-size:0.38rem;--docusaurus-details-transition:transform 200ms ease;--docusaurus-details-decoration-color:grey}.details_lb9f>summary{cursor:pointer;padding-left:1rem;position:relative}.details_lb9f>summary::-webkit-details-marker{display:none}.details_lb9f>summary:before{border-color:transparent transparent transparent var(--docusaurus-details-decoration-color);border-style:solid;border-width:var(--docusaurus-details-summary-arrow-size);content:"";left:0;position:absolute;top:.45rem;transform:rotate(0);transform-origin:calc(var(--docusaurus-details-summary-arrow-size)/2) 50%;transition:var(--docusaurus-details-transition)}.collapsibleContent_i85q{border-top:1px solid var(--docusaurus-details-decoration-color);margin-top:1rem;padding-top:1rem}.details_b_Ee{--docusaurus-details-decoration-color:var(--ifm-alert-border-color);--docusaurus-details-transition:transform var(--ifm-transition-fast) ease;border:1px solid var(--ifm-alert-border-color);margin:0 0 var(--ifm-spacing-vertical)}.anchorWithStickyNavbar_LWe7{scroll-margin-top:calc(var(--ifm-navbar-height) + .5rem)}.anchorWithHideOnScrollNavbar_WYt5{scroll-margin-top:.5rem}.hash-link{opacity:0;padding-left:.5rem;transition:opacity var(--ifm-transition-fast);-webkit-user-select:none;-moz-user-select:none;user-select:none}.hash-link:before{content:"#"}.img_ev3q{height:auto}.tableOfContents_bqdL{max-height:calc(100vh - var(--ifm-navbar-height) - 2rem);overflow-y:auto;position:sticky;top:calc(var(--ifm-navbar-height) + 1rem)}.admonition_LlT9{margin-bottom:1em}.admonitionHeading_tbUL{font:var(--ifm-heading-font-weight) var(--ifm-h5-font-size)/var(--ifm-heading-line-height) var(--ifm-heading-font-family);margin-bottom:.3rem;text-transform:uppercase}.admonitionHeading_tbUL code{text-transform:none}.admonitionIcon_kALy{display:inline-block;margin-right:.4em;vertical-align:middle}.admonitionIcon_kALy svg{fill:var(--ifm-alert-foreground-color);display:inline-block;height:1.6em;width:1.6em}.breadcrumbsContainer_Z_bl{--ifm-breadcrumb-size-multiplier:0.8;margin-bottom:.8rem}.breadcrumbHomeIcon_OVgt{height:1.1rem;position:relative;top:1px;vertical-align:top;width:1.1rem}.mdxPageWrapper_j9I6{justify-content:center}@media (min-width:997px){.collapseSidebarButton_PEFL,.expandButton_m80_{background-color:var(--docusaurus-collapse-button-bg);position:sticky}:root{--docusaurus-announcement-bar-height:30px}.announcementBarClose_gvF7,.announcementBarPlaceholder_vyr4{flex-basis:50px}.searchBox_ZlJk{padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.lastUpdated_vwxv{text-align:right}.tocMobile_ITEo{display:none}.collapseSidebarButton_PEFL{border:1px solid var(--ifm-toc-border-color);border-radius:0;bottom:0;display:block!important;height:40px}.collapseSidebarButtonIcon_kv0_{margin-top:4px;transform:rotate(180deg)}.expandButtonIcon_BlDH,[dir=rtl] .collapseSidebarButtonIcon_kv0_{transform:rotate(0)}.collapseSidebarButton_PEFL:focus,.collapseSidebarButton_PEFL:hover,.expandButton_m80_:focus,.expandButton_m80_:hover{background-color:var(--docusaurus-collapse-button-bg-hover)}.menuHtmlItem_M9Kj{padding:var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal)}.menu_SIkG{flex-grow:1;padding:.5rem}@supports (scrollbar-gutter:stable){.menu_SIkG{padding:.5rem 0 .5rem .5rem;scrollbar-gutter:stable}}.menuWithAnnouncementBar_GW3s{margin-bottom:var(--docusaurus-announcement-bar-height)}.sidebar_njMd{display:flex;flex-direction:column;height:100%;max-height:100vh;padding-top:var(--ifm-navbar-height);position:sticky;top:0;transition:opacity 50ms;width:var(--doc-sidebar-width)}.sidebarWithHideableNavbar_wUlq{padding-top:0}.sidebarHidden_VK0M{height:0;opacity:0;overflow:hidden;visibility:hidden}.sidebarLogo_isFc{align-items:center;color:inherit!important;display:flex!important;margin:0 var(--ifm-navbar-padding-horizontal);max-height:var(--ifm-navbar-height);min-height:var(--ifm-navbar-height);text-decoration:none!important}.sidebarLogo_isFc img{height:2rem;margin-right:.5rem}.expandButton_m80_{align-items:center;display:flex;height:100%;justify-content:center;max-height:100vh;top:0;transition:background-color var(--ifm-transition-fast) ease}[dir=rtl] .expandButtonIcon_BlDH{transform:rotate(180deg)}.docSidebarContainer_b6E3{border-right:1px solid var(--ifm-toc-border-color);-webkit-clip-path:inset(0);clip-path:inset(0);display:block;margin-top:calc(var(--ifm-navbar-height)*-1);transition:width var(--ifm-transition-fast) ease;width:var(--doc-sidebar-width);will-change:width}.docSidebarContainerHidden_b3ry{cursor:pointer;width:var(--doc-sidebar-hidden-width)}.docMainContainer_gTbr{flex-grow:1;max-width:calc(100% - var(--doc-sidebar-width))}.docMainContainerEnhanced_Uz_u{max-width:calc(100% - var(--doc-sidebar-hidden-width))}.docItemWrapperEnhanced_czyv{max-width:calc(var(--ifm-container-width) + var(--doc-sidebar-width))!important}.docItemCol_VOVn{max-width:75%!important}}@media (min-width:1440px){.container{max-width:var(--ifm-container-width-xl)}}@media (max-width:996px){.col{--ifm-col-width:100%;flex-basis:var(--ifm-col-width);margin-left:0}.footer{--ifm-footer-padding-horizontal:0}.colorModeToggle_DEke,.footer__link-separator,.navbar__item,.tableOfContents_bqdL{display:none}.footer__col{margin-bottom:calc(var(--ifm-spacing-vertical)*3)}.footer__link-item{display:block}.hero{padding-left:0;padding-right:0}.navbar>.container,.navbar>.container-fluid{padding:0}.navbar__toggle{display:inherit}.navbar__search-input{width:9rem}.pills--block,.tabs--block{flex-direction:column}.searchBox_ZlJk{position:absolute;right:var(--ifm-navbar-padding-horizontal)}.docItemContainer_F8PC{padding:0 .3rem}}@media (max-width:576px){.markdown h1:first-child{--ifm-h1-font-size:2rem}.markdown>h2{--ifm-h2-font-size:1.5rem}.markdown>h3{--ifm-h3-font-size:1.25rem}}@media (hover:hover){.backToTopButton_sjWU:hover{background-color:var(--ifm-color-emphasis-300)}}@media (pointer:fine){.thin-scrollbar{scrollbar-width:thin}.thin-scrollbar::-webkit-scrollbar{height:var(--ifm-scrollbar-size);width:var(--ifm-scrollbar-size)}.thin-scrollbar::-webkit-scrollbar-track{background:var(--ifm-scrollbar-track-background-color);border-radius:10px}.thin-scrollbar::-webkit-scrollbar-thumb{background:var(--ifm-scrollbar-thumb-background-color);border-radius:10px}.thin-scrollbar::-webkit-scrollbar-thumb:hover{background:var(--ifm-scrollbar-thumb-hover-background-color)}}@media print{.announcementBar_mb4j,.footer,.menu,.navbar,.pagination-nav,.table-of-contents,.tocMobile_ITEo{display:none}.tabs{page-break-inside:avoid}.codeBlockLines_e6Vv{white-space:pre-wrap}}
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/01614a01.9bc90821.js b/src/main/resources/ui/assets/js/01614a01.9bc90821.js
new file mode 100644
index 0000000..a35098b
--- /dev/null
+++ b/src/main/resources/ui/assets/js/01614a01.9bc90821.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[983],{3769:function(e){e.exports=JSON.parse('{"name":"docusaurus-plugin-content-docs","id":"default"}')}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/17896441.ee21715a.js b/src/main/resources/ui/assets/js/17896441.ee21715a.js
new file mode 100644
index 0000000..1e281ee
--- /dev/null
+++ b/src/main/resources/ui/assets/js/17896441.ee21715a.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[918],{3332:function(e,t,a){a.r(t),a.d(t,{default:function(){return _e}});var n=a(7294),l=a(1944),r=a(902);const s=n.createContext(null);function o(e){let{children:t,content:a}=e;const l=function(e){return(0,n.useMemo)((()=>({metadata:e.metadata,frontMatter:e.frontMatter,assets:e.assets,contentTitle:e.contentTitle,toc:e.toc})),[e])}(a);return n.createElement(s.Provider,{value:l},t)}function c(){const e=(0,n.useContext)(s);if(null===e)throw new r.i6("DocProvider");return e}function i(){const{metadata:e,frontMatter:t,assets:a}=c();return n.createElement(l.d,{title:e.title,description:e.description,keywords:t.keywords,image:a.image??t.image})}var d=a(6010),m=a(7524),u=a(7462),b=a(5999),p=a(9960);function v(e){const{permalink:t,title:a,subLabel:l,isNext:r}=e;return n.createElement(p.Z,{className:(0,d.Z)("pagination-nav__link",r?"pagination-nav__link--next":"pagination-nav__link--prev"),to:t},l&&n.createElement("div",{className:"pagination-nav__sublabel"},l),n.createElement("div",{className:"pagination-nav__label"},a))}function h(e){const{previous:t,next:a}=e;return n.createElement("nav",{className:"pagination-nav docusaurus-mt-lg","aria-label":(0,b.I)({id:"theme.docs.paginator.navAriaLabel",message:"Docs pages navigation",description:"The ARIA label for the docs pagination"})},t&&n.createElement(v,(0,u.Z)({},t,{subLabel:n.createElement(b.Z,{id:"theme.docs.paginator.previous",description:"The label used to navigate to the previous doc"},"Previous")})),a&&n.createElement(v,(0,u.Z)({},a,{subLabel:n.createElement(b.Z,{id:"theme.docs.paginator.next",description:"The label used to navigate to the next doc"},"Next"),isNext:!0})))}function E(){const{metadata:e}=c();return n.createElement(h,{previous:e.previous,next:e.next})}var g=a(2263),f=a(143),_=a(5281),N=a(373),Z=a(4477);const k={unreleased:function(e){let{siteTitle:t,versionMetadata:a}=e;return n.createElement(b.Z,{id:"theme.docs.versions.unreleasedVersionLabel",description:"The label used to tell the user that he's browsing an unreleased doc version",values:{siteTitle:t,versionLabel:n.createElement("b",null,a.label)}},"This is unreleased documentation for {siteTitle} {versionLabel} version.")},unmaintained:function(e){let{siteTitle:t,versionMetadata:a}=e;return n.createElement(b.Z,{id:"theme.docs.versions.unmaintainedVersionLabel",description:"The label used to tell the user that he's browsing an unmaintained doc version",values:{siteTitle:t,versionLabel:n.createElement("b",null,a.label)}},"This is documentation for {siteTitle} {versionLabel}, which is no longer actively maintained.")}};function L(e){const t=k[e.versionMetadata.banner];return n.createElement(t,e)}function T(e){let{versionLabel:t,to:a,onClick:l}=e;return n.createElement(b.Z,{id:"theme.docs.versions.latestVersionSuggestionLabel",description:"The label used to tell the user to check the latest version",values:{versionLabel:t,latestVersionLink:n.createElement("b",null,n.createElement(p.Z,{to:a,onClick:l},n.createElement(b.Z,{id:"theme.docs.versions.latestVersionLinkLabel",description:"The label used for the latest version suggestion link label"},"latest version")))}},"For up-to-date documentation, see the {latestVersionLink} ({versionLabel}).")}function U(e){let{className:t,versionMetadata:a}=e;const{siteConfig:{title:l}}=(0,g.Z)(),{pluginId:r}=(0,f.gA)({failfast:!0}),{savePreferredVersionName:s}=(0,N.J)(r),{latestDocSuggestion:o,latestVersionSuggestion:c}=(0,f.Jo)(r),i=o??(m=c).docs.find((e=>e.id===m.mainDocId));var m;return n.createElement("div",{className:(0,d.Z)(t,_.k.docs.docVersionBanner,"alert alert--warning margin-bottom--md"),role:"alert"},n.createElement("div",null,n.createElement(L,{siteTitle:l,versionMetadata:a})),n.createElement("div",{className:"margin-top--md"},n.createElement(T,{versionLabel:c.label,to:i.path,onClick:()=>s(c.name)})))}function w(e){let{className:t}=e;const a=(0,Z.E)();return a.banner?n.createElement(U,{className:t,versionMetadata:a}):null}function C(e){let{className:t}=e;const a=(0,Z.E)();return a.badge?n.createElement("span",{className:(0,d.Z)(t,_.k.docs.docVersionBadge,"badge badge--secondary")},n.createElement(b.Z,{id:"theme.docs.versionBadge.label",values:{versionLabel:a.label}},"Version: {versionLabel}")):null}function x(e){let{lastUpdatedAt:t,formattedLastUpdatedAt:a}=e;return n.createElement(b.Z,{id:"theme.lastUpdated.atDate",description:"The words used to describe on which date a page has been last updated",values:{date:n.createElement("b",null,n.createElement("time",{dateTime:new Date(1e3*t).toISOString()},a))}}," on {date}")}function y(e){let{lastUpdatedBy:t}=e;return n.createElement(b.Z,{id:"theme.lastUpdated.byUser",description:"The words used to describe by who the page has been last updated",values:{user:n.createElement("b",null,t)}}," by {user}")}function A(e){let{lastUpdatedAt:t,formattedLastUpdatedAt:a,lastUpdatedBy:l}=e;return n.createElement("span",{className:_.k.common.lastUpdated},n.createElement(b.Z,{id:"theme.lastUpdated.lastUpdatedAtBy",description:"The sentence used to display when a page has been last updated, and by who",values:{atDate:t&&a?n.createElement(x,{lastUpdatedAt:t,formattedLastUpdatedAt:a}):"",byUser:l?n.createElement(y,{lastUpdatedBy:l}):""}},"Last updated{atDate}{byUser}"),!1)}var M="iconEdit_Z9Sw";function B(e){let{className:t,...a}=e;return n.createElement("svg",(0,u.Z)({fill:"currentColor",height:"20",width:"20",viewBox:"0 0 40 40",className:(0,d.Z)(M,t),"aria-hidden":"true"},a),n.createElement("g",null,n.createElement("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"})))}function I(e){let{editUrl:t}=e;return n.createElement("a",{href:t,target:"_blank",rel:"noreferrer noopener",className:_.k.common.editThisPage},n.createElement(B,null),n.createElement(b.Z,{id:"theme.common.editThisPage",description:"The link label to edit the current page"},"Edit this page"))}var V="tag_zVej",H="tagRegular_sFm0",P="tagWithCount_h2kH";function D(e){let{permalink:t,label:a,count:l}=e;return n.createElement(p.Z,{href:t,className:(0,d.Z)(V,l?P:H)},a,l&&n.createElement("span",null,l))}var S="tags_jXut",F="tag_QGVx";function O(e){let{tags:t}=e;return n.createElement(n.Fragment,null,n.createElement("b",null,n.createElement(b.Z,{id:"theme.tags.tagsListLabel",description:"The label alongside a tag list"},"Tags:")),n.createElement("ul",{className:(0,d.Z)(S,"padding--none","margin-left--sm")},t.map((e=>{let{label:t,permalink:a}=e;return n.createElement("li",{key:a,className:F},n.createElement(D,{label:t,permalink:a}))}))))}var z="lastUpdated_vwxv";function R(e){return n.createElement("div",{className:(0,d.Z)(_.k.docs.docFooterTagsRow,"row margin-bottom--sm")},n.createElement("div",{className:"col"},n.createElement(O,e)))}function j(e){let{editUrl:t,lastUpdatedAt:a,lastUpdatedBy:l,formattedLastUpdatedAt:r}=e;return n.createElement("div",{className:(0,d.Z)(_.k.docs.docFooterEditMetaRow,"row")},n.createElement("div",{className:"col"},t&&n.createElement(I,{editUrl:t})),n.createElement("div",{className:(0,d.Z)("col",z)},(a||l)&&n.createElement(A,{lastUpdatedAt:a,formattedLastUpdatedAt:r,lastUpdatedBy:l})))}function q(){const{metadata:e}=c(),{editUrl:t,lastUpdatedAt:a,formattedLastUpdatedAt:l,lastUpdatedBy:r,tags:s}=e,o=s.length>0,i=!!(t||a||r);return o||i?n.createElement("footer",{className:(0,d.Z)(_.k.docs.docFooter,"docusaurus-mt-lg")},o&&n.createElement(R,{tags:s}),i&&n.createElement(j,{editUrl:t,lastUpdatedAt:a,lastUpdatedBy:r,formattedLastUpdatedAt:l})):null}var G=a(6043),J=a(3743),Q="tocCollapsibleButton_TO0P",W="tocCollapsibleButtonExpanded_MG3E";function X(e){let{collapsed:t,...a}=e;return n.createElement("button",(0,u.Z)({type:"button"},a,{className:(0,d.Z)("clean-btn",Q,!t&&W,a.className)}),n.createElement(b.Z,{id:"theme.TOCCollapsible.toggleButtonLabel",description:"The label used by the button on the collapsible TOC component"},"On this page"))}var $="tocCollapsible_ETCw",K="tocCollapsibleContent_vkbj",Y="tocCollapsibleExpanded_sAul";function ee(e){let{toc:t,className:a,minHeadingLevel:l,maxHeadingLevel:r}=e;const{collapsed:s,toggleCollapsed:o}=(0,G.u)({initialState:!0});return n.createElement("div",{className:(0,d.Z)($,!s&&Y,a)},n.createElement(X,{collapsed:s,onClick:o}),n.createElement(G.z,{lazy:!0,className:K,collapsed:s},n.createElement(J.Z,{toc:t,minHeadingLevel:l,maxHeadingLevel:r})))}var te="tocMobile_ITEo";function ae(){const{toc:e,frontMatter:t}=c();return n.createElement(ee,{toc:e,minHeadingLevel:t.toc_min_heading_level,maxHeadingLevel:t.toc_max_heading_level,className:(0,d.Z)(_.k.docs.docTocMobile,te)})}var ne=a(9407);function le(){const{toc:e,frontMatter:t}=c();return n.createElement(ne.Z,{toc:e,minHeadingLevel:t.toc_min_heading_level,maxHeadingLevel:t.toc_max_heading_level,className:_.k.docs.docTocDesktop})}var re=a(2503),se=a(9254);function oe(e){let{children:t}=e;const a=function(){const{metadata:e,frontMatter:t,contentTitle:a}=c();return t.hide_title||void 0!==a?null:e.title}();return n.createElement("div",{className:(0,d.Z)(_.k.docs.docMarkdown,"markdown")},a&&n.createElement("header",null,n.createElement(re.Z,{as:"h1"},a)),n.createElement(se.Z,null,t))}var ce=a(2802),ie=a(8596),de=a(4996);function me(e){return n.createElement("svg",(0,u.Z)({viewBox:"0 0 24 24"},e),n.createElement("path",{d:"M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z",fill:"currentColor"}))}var ue={breadcrumbsContainer:"breadcrumbsContainer_Z_bl",breadcrumbHomeIcon:"breadcrumbHomeIcon_OVgt"};function be(e){let{children:t,href:a,isLast:l}=e;const r="breadcrumbs__link";return l?n.createElement("span",{className:r,itemProp:"name"},t):a?n.createElement(p.Z,{className:r,href:a,itemProp:"item"},n.createElement("span",{itemProp:"name"},t)):n.createElement("span",{className:r},t)}function pe(e){let{children:t,active:a,index:l,addMicrodata:r}=e;return n.createElement("li",(0,u.Z)({},r&&{itemScope:!0,itemProp:"itemListElement",itemType:"https://schema.org/ListItem"},{className:(0,d.Z)("breadcrumbs__item",{"breadcrumbs__item--active":a})}),t,n.createElement("meta",{itemProp:"position",content:String(l+1)}))}function ve(){const e=(0,de.Z)("/");return n.createElement("li",{className:"breadcrumbs__item"},n.createElement(p.Z,{"aria-label":(0,b.I)({id:"theme.docs.breadcrumbs.home",message:"Home page",description:"The ARIA label for the home page in the breadcrumbs"}),className:(0,d.Z)("breadcrumbs__link",ue.breadcrumbsItemLink),href:e},n.createElement(me,{className:ue.breadcrumbHomeIcon})))}function he(){const e=(0,ce.s1)(),t=(0,ie.Ns)();return e?n.createElement("nav",{className:(0,d.Z)(_.k.docs.docBreadcrumbs,ue.breadcrumbsContainer),"aria-label":(0,b.I)({id:"theme.docs.breadcrumbs.navAriaLabel",message:"Breadcrumbs",description:"The ARIA label for the breadcrumbs"})},n.createElement("ul",{className:"breadcrumbs",itemScope:!0,itemType:"https://schema.org/BreadcrumbList"},t&&n.createElement(ve,null),e.map(((t,a)=>{const l=a===e.length-1;return n.createElement(pe,{key:a,active:l,index:a,addMicrodata:!!t.href},n.createElement(be,{href:t.href,isLast:l},t.label))})))):null}var Ee="docItemContainer_Djhp",ge="docItemCol_VOVn";function fe(e){let{children:t}=e;const a=function(){const{frontMatter:e,toc:t}=c(),a=(0,m.i)(),l=e.hide_table_of_contents,r=!l&&t.length>0;return{hidden:l,mobile:r?n.createElement(ae,null):void 0,desktop:!r||"desktop"!==a&&"ssr"!==a?void 0:n.createElement(le,null)}}();return n.createElement("div",{className:"row"},n.createElement("div",{className:(0,d.Z)("col",!a.hidden&&ge)},n.createElement(w,null),n.createElement("div",{className:Ee},n.createElement("article",null,n.createElement(he,null),n.createElement(C,null),a.mobile,n.createElement(oe,null,t),n.createElement(q,null)),n.createElement(E,null))),a.desktop&&n.createElement("div",{className:"col col--3"},a.desktop))}function _e(e){const t=`docs-doc-id-${e.content.metadata.unversionedId}`,a=e.content;return n.createElement(o,{content:e.content},n.createElement(l.FG,{className:t},n.createElement(i,null),n.createElement(fe,null,n.createElement(a,null))))}},4477:function(e,t,a){a.d(t,{E:function(){return o},q:function(){return s}});var n=a(7294),l=a(902);const r=n.createContext(null);function s(e){let{children:t,version:a}=e;return n.createElement(r.Provider,{value:a},t)}function o(){const e=(0,n.useContext)(r);if(null===e)throw new l.i6("DocsVersionProvider");return e}}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/1be78505.6890df1b.js b/src/main/resources/ui/assets/js/1be78505.6890df1b.js
new file mode 100644
index 0000000..edbd6ee
--- /dev/null
+++ b/src/main/resources/ui/assets/js/1be78505.6890df1b.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[514,972],{9963:function(e,t,n){n.r(t),n.d(t,{default:function(){return Ie}});var a=n(7294),l=n(6010),r=n(1944),o=n(5281),c=n(3320),i=n(2802),s=n(4477),d=n(1116),m=n(3285),u=n(5999),b=n(2466),p=n(5936);var h="backToTopButton_sjWU",E="backToTopButtonShow_xfvO";function f(){const{shown:e,scrollToTop:t}=function(e){let{threshold:t}=e;const[n,l]=(0,a.useState)(!1),r=(0,a.useRef)(!1),{startScroll:o,cancelScroll:c}=(0,b.Ct)();return(0,b.RF)(((e,n)=>{let{scrollY:a}=e;const o=null==n?void 0:n.scrollY;o&&(r.current?r.current=!1:a>=o?(c(),l(!1)):a{e.location.hash&&(r.current=!0,l(!1))})),{shown:n,scrollToTop:()=>o(0)}}({threshold:300});return a.createElement("button",{"aria-label":(0,u.I)({id:"theme.BackToTopButton.buttonAriaLabel",message:"Scroll back to top",description:"The ARIA label for the back to top button"}),className:(0,l.Z)("clean-btn",o.k.common.backToTopButton,h,e&&E),type:"button",onClick:t})}var v=n(6550),g=n(7524),_=n(6668),k=n(1327),C=n(7462);function I(e){return a.createElement("svg",(0,C.Z)({width:"20",height:"20","aria-hidden":"true"},e),a.createElement("g",{fill:"#7a7a7a"},a.createElement("path",{d:"M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"}),a.createElement("path",{d:"M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"})))}var N="collapseSidebarButton_PEFL",S="collapseSidebarButtonIcon_kv0_";function Z(e){let{onClick:t}=e;return a.createElement("button",{type:"button",title:(0,u.I)({id:"theme.docs.sidebar.collapseButtonTitle",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),"aria-label":(0,u.I)({id:"theme.docs.sidebar.collapseButtonAriaLabel",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),className:(0,l.Z)("button button--secondary button--outline",N),onClick:t},a.createElement(I,{className:S}))}var x=n(9689),y=n(902);const T=Symbol("EmptyContext"),w=a.createContext(T);function L(e){let{children:t}=e;const[n,l]=(0,a.useState)(null),r=(0,a.useMemo)((()=>({expandedItem:n,setExpandedItem:l})),[n]);return a.createElement(w.Provider,{value:r},t)}var M=n(6043),A=n(8596),B=n(9960),F=n(2389);function P(e){let{categoryLabel:t,onClick:n}=e;return a.createElement("button",{"aria-label":(0,u.I)({id:"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel",message:"Toggle the collapsible sidebar category '{label}'",description:"The ARIA label to toggle the collapsible sidebar category"},{label:t}),type:"button",className:"clean-btn menu__caret",onClick:n})}function H(e){let{item:t,onItemClick:n,activePath:r,level:c,index:s,...d}=e;const{items:m,label:u,collapsible:b,className:p,href:h}=t,{docs:{sidebar:{autoCollapseCategories:E}}}=(0,_.L)(),f=function(e){const t=(0,F.Z)();return(0,a.useMemo)((()=>e.href?e.href:!t&&e.collapsible?(0,i.Wl)(e):void 0),[e,t])}(t),v=(0,i._F)(t,r),g=(0,A.Mg)(h,r),{collapsed:k,setCollapsed:I}=(0,M.u)({initialState:()=>!!b&&(!v&&t.collapsed)}),{expandedItem:N,setExpandedItem:S}=function(){const e=(0,a.useContext)(w);if(e===T)throw new y.i6("DocSidebarItemsExpandedStateProvider");return e}(),Z=function(e){void 0===e&&(e=!k),S(e?null:s),I(e)};return function(e){let{isActive:t,collapsed:n,updateCollapsed:l}=e;const r=(0,y.D9)(t);(0,a.useEffect)((()=>{t&&!r&&n&&l(!1)}),[t,r,n,l])}({isActive:v,collapsed:k,updateCollapsed:Z}),(0,a.useEffect)((()=>{b&&null!=N&&N!==s&&E&&I(!0)}),[b,N,s,I,E]),a.createElement("li",{className:(0,l.Z)(o.k.docs.docSidebarItemCategory,o.k.docs.docSidebarItemCategoryLevel(c),"menu__list-item",{"menu__list-item--collapsed":k},p)},a.createElement("div",{className:(0,l.Z)("menu__list-item-collapsible",{"menu__list-item-collapsible--active":g})},a.createElement(B.Z,(0,C.Z)({className:(0,l.Z)("menu__link",{"menu__link--sublist":b,"menu__link--sublist-caret":!h&&b,"menu__link--active":v}),onClick:b?e=>{null==n||n(t),h?Z(!1):(e.preventDefault(),Z())}:()=>{null==n||n(t)},"aria-current":g?"page":void 0,"aria-expanded":b?!k:void 0,href:b?f??"#":f},d),u),h&&b&&a.createElement(P,{categoryLabel:u,onClick:e=>{e.preventDefault(),Z()}})),a.createElement(M.z,{lazy:!0,as:"ul",className:"menu__list",collapsed:k},a.createElement(q,{items:m,tabIndex:k?-1:0,onItemClick:n,activePath:r,level:c+1})))}var W=n(3919),D=n(9471),R="menuExternalLink_NmtK";function z(e){let{item:t,onItemClick:n,activePath:r,level:c,index:s,...d}=e;const{href:m,label:u,className:b,autoAddBaseUrl:p}=t,h=(0,i._F)(t,r),E=(0,W.Z)(m);return a.createElement("li",{className:(0,l.Z)(o.k.docs.docSidebarItemLink,o.k.docs.docSidebarItemLinkLevel(c),"menu__list-item",b),key:u},a.createElement(B.Z,(0,C.Z)({className:(0,l.Z)("menu__link",!E&&R,{"menu__link--active":h}),autoAddBaseUrl:p,"aria-current":h?"page":void 0,to:m},E&&{onClick:n?()=>n(t):void 0},d),u,!E&&a.createElement(D.Z,null)))}var U="menuHtmlItem_M9Kj";function V(e){let{item:t,level:n,index:r}=e;const{value:c,defaultStyle:i,className:s}=t;return a.createElement("li",{className:(0,l.Z)(o.k.docs.docSidebarItemLink,o.k.docs.docSidebarItemLinkLevel(n),i&&[U,"menu__list-item"],s),key:r,dangerouslySetInnerHTML:{__html:c}})}function K(e){let{item:t,...n}=e;switch(t.type){case"category":return a.createElement(H,(0,C.Z)({item:t},n));case"html":return a.createElement(V,(0,C.Z)({item:t},n));default:return a.createElement(z,(0,C.Z)({item:t},n))}}function j(e){let{items:t,...n}=e;return a.createElement(L,null,t.map(((e,t)=>a.createElement(K,(0,C.Z)({key:t,item:e,index:t},n)))))}var q=(0,a.memo)(j),G="menu_SIkG",Y="menuWithAnnouncementBar_GW3s";function O(e){let{path:t,sidebar:n,className:r}=e;const c=function(){const{isActive:e}=(0,x.nT)(),[t,n]=(0,a.useState)(e);return(0,b.RF)((t=>{let{scrollY:a}=t;e&&n(0===a)}),[e]),e&&t}();return a.createElement("nav",{className:(0,l.Z)("menu thin-scrollbar",G,c&&Y,r)},a.createElement("ul",{className:(0,l.Z)(o.k.docs.docSidebarMenu,"menu__list")},a.createElement(q,{items:n,activePath:t,level:1})))}var X="sidebar_njMd",J="sidebarWithHideableNavbar_wUlq",Q="sidebarHidden_VK0M",$="sidebarLogo_isFc";function ee(e){let{path:t,sidebar:n,onCollapse:r,isHidden:o}=e;const{navbar:{hideOnScroll:c},docs:{sidebar:{hideable:i}}}=(0,_.L)();return a.createElement("div",{className:(0,l.Z)(X,c&&J,o&&Q)},c&&a.createElement(k.Z,{tabIndex:-1,className:$}),a.createElement(O,{path:t,sidebar:n}),i&&a.createElement(Z,{onClick:r}))}var te=a.memo(ee),ne=n(3102),ae=n(2961);const le=e=>{let{sidebar:t,path:n}=e;const r=(0,ae.e)();return a.createElement("ul",{className:(0,l.Z)(o.k.docs.docSidebarMenu,"menu__list")},a.createElement(q,{items:t,activePath:n,onItemClick:e=>{"category"===e.type&&e.href&&r.toggle(),"link"===e.type&&r.toggle()},level:1}))};function re(e){return a.createElement(ne.Zo,{component:le,props:e})}var oe=a.memo(re);function ce(e){const t=(0,g.i)(),n="desktop"===t||"ssr"===t,l="mobile"===t;return a.createElement(a.Fragment,null,n&&a.createElement(te,e),l&&a.createElement(oe,e))}var ie="expandButton_m80_",se="expandButtonIcon_BlDH";function de(e){let{toggleSidebar:t}=e;return a.createElement("div",{className:ie,title:(0,u.I)({id:"theme.docs.sidebar.expandButtonTitle",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),"aria-label":(0,u.I)({id:"theme.docs.sidebar.expandButtonAriaLabel",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),tabIndex:0,role:"button",onKeyDown:t,onClick:t},a.createElement(I,{className:se}))}var me="docSidebarContainer_b6E3",ue="docSidebarContainerHidden_b3ry";function be(e){let{children:t}=e;const n=(0,d.V)();return a.createElement(a.Fragment,{key:(null==n?void 0:n.name)??"noSidebar"},t)}function pe(e){let{sidebar:t,hiddenSidebarContainer:n,setHiddenSidebarContainer:r}=e;const{pathname:c}=(0,v.TH)(),[i,s]=(0,a.useState)(!1),d=(0,a.useCallback)((()=>{i&&s(!1),r((e=>!e))}),[r,i]);return a.createElement("aside",{className:(0,l.Z)(o.k.docs.docSidebarContainer,me,n&&ue),onTransitionEnd:e=>{e.currentTarget.classList.contains(me)&&n&&s(!0)}},a.createElement(be,null,a.createElement(ce,{sidebar:t,path:c,onCollapse:d,isHidden:i})),i&&a.createElement(de,{toggleSidebar:d}))}var he={docMainContainer:"docMainContainer_gTbr",docMainContainerEnhanced:"docMainContainerEnhanced_Uz_u",docItemWrapperEnhanced:"docItemWrapperEnhanced_czyv"};function Ee(e){let{hiddenSidebarContainer:t,children:n}=e;const r=(0,d.V)();return a.createElement("main",{className:(0,l.Z)(he.docMainContainer,(t||!r)&&he.docMainContainerEnhanced)},a.createElement("div",{className:(0,l.Z)("container padding-top--md padding-bottom--lg",he.docItemWrapper,t&&he.docItemWrapperEnhanced)},n))}var fe="docPage__5DB",ve="docsWrapper_BCFX";function ge(e){let{children:t}=e;const n=(0,d.V)(),[l,r]=(0,a.useState)(!1);return a.createElement(m.Z,{wrapperClassName:ve},a.createElement(f,null),a.createElement("div",{className:fe},n&&a.createElement(pe,{sidebar:n.items,hiddenSidebarContainer:l,setHiddenSidebarContainer:r}),a.createElement(Ee,{hiddenSidebarContainer:l},t)))}var _e=n(4972),ke=n(197);function Ce(e){const{versionMetadata:t}=e;return a.createElement(a.Fragment,null,a.createElement(ke.Z,{version:t.version,tag:(0,c.os)(t.pluginId,t.version)}),a.createElement(r.d,null,t.noIndex&&a.createElement("meta",{name:"robots",content:"noindex, nofollow"})))}function Ie(e){const{versionMetadata:t}=e,n=(0,i.hI)(e);if(!n)return a.createElement(_e.default,null);const{docElement:c,sidebarName:m,sidebarItems:u}=n;return a.createElement(a.Fragment,null,a.createElement(Ce,e),a.createElement(r.FG,{className:(0,l.Z)(o.k.wrapper.docsPages,o.k.page.docsDocPage,e.versionMetadata.className)},a.createElement(s.q,{version:t},a.createElement(d.b,{name:m,items:u},a.createElement(ge,null,c)))))}},4972:function(e,t,n){n.r(t),n.d(t,{default:function(){return c}});var a=n(7294),l=n(5999),r=n(1944),o=n(3285);function c(){return a.createElement(a.Fragment,null,a.createElement(r.d,{title:(0,l.I)({id:"theme.NotFound.title",message:"Page Not Found"})}),a.createElement(o.Z,null,a.createElement("main",{className:"container margin-vert--xl"},a.createElement("div",{className:"row"},a.createElement("div",{className:"col col--6 col--offset-3"},a.createElement("h1",{className:"hero__title"},a.createElement(l.Z,{id:"theme.NotFound.title",description:"The title of the 404 page"},"Page Not Found")),a.createElement("p",null,a.createElement(l.Z,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page"},"We could not find what you were looking for.")),a.createElement("p",null,a.createElement(l.Z,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page"},"Please contact the owner of the site that linked you to the original URL and let them know their link is broken.")))))))}},4477:function(e,t,n){n.d(t,{E:function(){return c},q:function(){return o}});var a=n(7294),l=n(902);const r=a.createContext(null);function o(e){let{children:t,version:n}=e;return a.createElement(r.Provider,{value:n},t)}function c(){const e=(0,a.useContext)(r);if(null===e)throw new l.i6("DocsVersionProvider");return e}}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/1df93b7f.c492b5ad.js b/src/main/resources/ui/assets/js/1df93b7f.c492b5ad.js
new file mode 100644
index 0000000..326ba6e
--- /dev/null
+++ b/src/main/resources/ui/assets/js/1df93b7f.c492b5ad.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[237],{8451:function(e,t,a){a.r(t),a.d(t,{default:function(){return N}});var l=a(7294),n=a(6010),r=a(7462),i=a(8523),o={dropzone:"dropzone_p8R5",active:"active_ajsO",hasFiles:"hasFiles_h6nl",fileHoverPreview:"fileHoverPreview_IJ6m",icon:"icon_Zdm0",fileHoverIcon:"fileHoverIcon_TFrZ",uploadIcon:"uploadIcon__9vU"};var c=e=>{let{accept:t,children:a,className:c,activeClassName:s,multiple:d=!1,name:m,onDrop:p,hasSelectedFiles:u,...v}=e;const{getRootProps:h,getInputProps:f,isDragActive:E,isDragAccept:g,isDragReject:Z}=(0,i.uI)({accept:t,multiple:d,onDrop:(e,t,a)=>{const l=t.map((e=>e.file));p(e,l,a)},...v});return l.createElement("div",(0,r.Z)({},h(),{className:(0,n.Z)(o.dropzone,E&&o.active,u&&o.hasFiles,c,E&&s),"data-testid":"dropzone","data-is-drag-active":E,"data-is-drag-accepted":g,"data-is-drag-rejected":Z,"data-has-files":u}),l.createElement("div",{className:(0,n.Z)(o.fileHoverPreview,E&&o.previewActive)},l.createElement("svg",{className:(0,n.Z)(o.icon,o.fileHoverIcon),fill:"currentColor","aria-hidden":"true",viewBox:"0 0 24 24"},l.createElement("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"}))),l.createElement("svg",{className:(0,n.Z)(o.icon,o.uploadIcon),fill:"currentColor","aria-hidden":"true",viewBox:"0 0 24 24"},l.createElement("path",{d:"M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"})),a,l.createElement("input",(0,r.Z)({name:m},f(),{"data-testid":"dropzone-input"})))},s=a(5833),d=a(7547),m=a(7506),p="button__Owf",u="spinnerWrapper_KcTt",v="loading_FTzi",h="spinner_hC2W";var f=function(e){let{children:t,type:a="button",className:i,loading:o=!1,...c}=e;return l.createElement("button",(0,r.Z)({},c,{className:(0,n.Z)(p,o&&v,i),type:a,"aria-busy":o}),l.createElement("div",{className:u,"aria-hidden":!0},l.createElement("div",{className:h})),t)},E="buttonGroup__nLk",g="resultDisplay_JbbN",Z="withError_Jabi";const _={"text/xml":[".xml",".XML"],"application/xml":[".xml",".XML"]};var b=function(){const[e,t]=(0,l.useState)(null),[a,r]=(0,l.useState)([]),{data:i,error:o,request:p,status:u}=(0,m.Z)(),v=(0,l.useCallback)(((e,a)=>{e.length?(t(e[0]),r([])):r(a)}),[]),h=!!o&&[406,422].includes(o.code);return l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:t=>{t.preventDefault(),e&&p("/",{method:"POST",headers:{"Content-Type":"application/xml"},body:e,redirect:"follow"})}},u===m.e.Failure&&o&&!h&&l.createElement(d.Z,{title:"An error occurred while validating the file"},l.createElement(s.Z,{enableCopy:!0},o.message)),a.length>1&&l.createElement(d.Z,{title:"Please select a single file only"}),1===a.length&&l.createElement(d.Z,{title:"Only XML files are supported"},l.createElement(s.Z,null,`Invalid file found: ${a[0].name}`)),l.createElement(c,{onDrop:v,accept:_,multiple:!1,hasSelectedFiles:!!e},e?e.name:l.createElement(l.Fragment,null,"Drag & drop files here or click to select a file")),l.createElement("div",{className:E},l.createElement(f,{type:"submit",disabled:!e,loading:u===m.e.Loading},"Validate"))),(i&&u===m.e.Success||h)&&l.createElement("div",{className:(0,n.Z)(g,h&&Z)},l.createElement(s.Z,{download:{fileName:(b=null==e?void 0:e.name,b?`${b.replace(/\.xml$/i,"")}-report.xml`:"report.xml"),mime:"application/xml"},enableCopy:!0},i||(null==o?void 0:o.message)||"")));var b},y=a(8222);function N(){return l.createElement(y.Z,{layoutDescription:"KoSIT Validator Daemon",headline:"Try the validator!",description:"Upload an XML file here to validate its contents. Note: this is just a demo implementation, not meant for production usage. If you need a production ready implementation you are welcome to contribute to the open source project."},l.createElement(b,null))}}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/1f391b9e.ff7b907c.js b/src/main/resources/ui/assets/js/1f391b9e.ff7b907c.js
new file mode 100644
index 0000000..70da43b
--- /dev/null
+++ b/src/main/resources/ui/assets/js/1f391b9e.ff7b907c.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[85],{4247:function(e,t,a){a.r(t),a.d(t,{default:function(){return s}});var n=a(7294),l=a(6010),c=a(1944),r=a(5281),i=a(3285),m=a(9254),o=a(9407),d="mdxPageWrapper_j9I6";function s(e){const{content:t}=e,{metadata:{title:a,description:s,frontMatter:u}}=t,{wrapperClassName:p,hide_table_of_contents:_}=u;return n.createElement(c.FG,{className:(0,l.Z)(p??r.k.wrapper.mdxPages,r.k.page.mdxPage)},n.createElement(c.d,{title:a,description:s}),n.createElement(i.Z,null,n.createElement("main",{className:"container container--fluid margin-vert--lg"},n.createElement("div",{className:(0,l.Z)("row",d)},n.createElement("div",{className:(0,l.Z)("col",!_&&"col--8")},n.createElement("article",null,n.createElement(m.Z,null,n.createElement(t,null)))),!_&&t.toc.length>0&&n.createElement("div",{className:"col col--2"},n.createElement(o.Z,{toc:t.toc,minHeadingLevel:u.toc_min_heading_level,maxHeadingLevel:u.toc_max_heading_level}))))))}}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/393be207.36f5a793.js b/src/main/resources/ui/assets/js/393be207.36f5a793.js
new file mode 100644
index 0000000..6437ac9
--- /dev/null
+++ b/src/main/resources/ui/assets/js/393be207.36f5a793.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[414],{3123:function(e,t,n){n.r(t),n.d(t,{contentTitle:function(){return p},default:function(){return u},frontMatter:function(){return r},metadata:function(){return d},toc:function(){return i}});var a=n(7462),o=(n(7294),n(3905));const r={title:"Markdown page example"},p="Markdown page example",d={type:"mdx",permalink:"/markdown-page",source:"@site/src/pages/markdown-page.md",title:"Markdown page example",description:"You don't need React to write simple standalone pages.",frontMatter:{title:"Markdown page example"}},i=[],l={toc:i};function u(e){let{components:t,...n}=e;return(0,o.kt)("wrapper",(0,a.Z)({},l,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"markdown-page-example"},"Markdown page example"),(0,o.kt)("p",null,"You don't need React to write simple standalone pages."))}u.isMDXComponent=!0}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/523.3ef240ab.js b/src/main/resources/ui/assets/js/523.3ef240ab.js
new file mode 100644
index 0000000..0b0c81c
--- /dev/null
+++ b/src/main/resources/ui/assets/js/523.3ef240ab.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[523],{8363:function(e,n){n.Z=function(e,n){if(e&&n){var t=Array.isArray(n)?n:n.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return t.some((function(e){var n=e.trim().toLowerCase();return"."===n.charAt(0)?r.toLowerCase().endsWith(n):n.endsWith("/*")?i===n.replace(/\/.*$/,""):o===n}))}return!0}},8523:function(e,n,t){t.d(n,{uI:function(){return we}});var r=t(7294),o=t(5697),i=t.n(o);function a(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(n){i(n)}}function c(e){try{u(r.throw(e))}catch(n){i(n)}}function u(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,c)}u((r=r.apply(e,n||[])).next())}))}function c(e,n){var t,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]0)&&!(r=i.next()).done;)a.push(r.value)}catch(c){o={error:c}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return a}function l(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return t}var p=[".DS_Store","Thumbs.db"];function d(e){return"object"==typeof e&&null!==e}function v(e){return b(e.target.files).map((function(e){return f(e)}))}function m(e){return a(this,void 0,void 0,(function(){return c(this,(function(n){switch(n.label){case 0:return[4,Promise.all(e.map((function(e){return e.getFile()})))];case 1:return[2,n.sent().map((function(e){return f(e)}))]}}))}))}function g(e,n){return a(this,void 0,void 0,(function(){var t;return c(this,(function(r){switch(r.label){case 0:return e.items?(t=b(e.items).filter((function(e){return"file"===e.kind})),"drop"!==n?[2,t]:[4,Promise.all(t.map(h))]):[3,2];case 1:return[2,y(w(r.sent()))];case 2:return[2,y(b(e.files).map((function(e){return f(e)})))]}}))}))}function y(e){return e.filter((function(e){return-1===p.indexOf(e.name)}))}function b(e){if(null===e)return[];for(var n=[],t=0;te.length)&&(n=e.length);for(var t=0,r=new Array(n);tt)return[!1,_(t)];if(e.sizet)return[!1,_(t)]}return[!0,null]}function W(e){return null!=e}function G(e){var n=e.files,t=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles,c=e.validator;return!(!i&&n.length>1||i&&a>=1&&n.length>a)&&n.every((function(e){var n=P(U(e,t),1)[0],i=P($(e,r,o),1)[0],a=c?c(e):null;return n&&i&&!a}))}function H(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function q(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,(function(e){return"Files"===e||"application/x-moz-file"===e})):!!e.target&&!!e.target.files}function N(e){e.preventDefault()}function Z(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}function Y(e){return-1!==e.indexOf("Edge/")}function J(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return Z(e)||Y(e)}function Q(){for(var e=arguments.length,n=new Array(e),t=0;t1?t-1:0),o=1;oe.length)&&(n=e.length);for(var t=0,r=new Array(n);t=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var ye=(0,r.forwardRef)((function(e,n){var t=e.children,o=we(ge(e,ie)),i=o.open,a=ge(o,ae);return(0,r.useImperativeHandle)(n,(function(){return{open:i}}),[i]),r.createElement(r.Fragment,null,t(ve(ve({},a),{},{open:i})))}));ye.displayName="Dropzone";var be={disabled:!1,getFilesFromEvent:function(e){return a(this,void 0,void 0,(function(){return c(this,(function(n){return d(e)&&d(e.dataTransfer)?[2,g(e.dataTransfer,e.type)]:function(e){return d(e)&&d(e.target)}(e)?[2,v(e)]:Array.isArray(e)&&e.every((function(e){return"getFile"in e&&"function"==typeof e.getFile}))?[2,m(e)]:[2,[]]}))}))},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};ye.defaultProps=be,ye.propTypes={children:i().func,accept:i().objectOf(i().arrayOf(i().string)),multiple:i().bool,preventDropOnDocument:i().bool,noClick:i().bool,noKeyboard:i().bool,noDrag:i().bool,noDragEventsBubbling:i().bool,minSize:i().number,maxSize:i().number,maxFiles:i().number,disabled:i().bool,getFilesFromEvent:i().func,onFileDialogCancel:i().func,onFileDialogOpen:i().func,useFsAccessApi:i().bool,autoFocus:i().bool,onDragEnter:i().func,onDragLeave:i().func,onDragOver:i().func,onDrop:i().func,onDropAccepted:i().func,onDropRejected:i().func,onError:i().func,validator:i().func};var he={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function we(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=ve(ve({},be),e),t=n.accept,o=n.disabled,i=n.getFilesFromEvent,a=n.maxSize,c=n.minSize,u=n.multiple,l=n.maxFiles,s=n.onDragEnter,f=n.onDragLeave,p=n.onDragOver,d=n.onDrop,v=n.onDropAccepted,m=n.onDropRejected,g=n.onFileDialogCancel,y=n.onFileDialogOpen,b=n.useFsAccessApi,h=n.autoFocus,w=n.preventDropOnDocument,D=n.noClick,x=n.noKeyboard,O=n.noDrag,j=n.noDragEventsBubbling,A=n.onError,F=n.validator,k=(0,r.useMemo)((function(){return ee(t)}),[t]),E=(0,r.useMemo)((function(){return X(t)}),[t]),S=(0,r.useMemo)((function(){return"function"==typeof y?y:xe}),[y]),P=(0,r.useMemo)((function(){return"function"==typeof g?g:xe}),[g]),C=(0,r.useRef)(null),z=(0,r.useRef)(null),R=(0,r.useReducer)(De,he),I=se(R,2),T=I[0],M=I[1],L=T.isFocused,_=T.isFileDialogActive,B=(0,r.useRef)("undefined"!=typeof window&&window.isSecureContext&&b&&V()),W=function(){!B.current&&_&&setTimeout((function(){z.current&&(z.current.files.length||(M({type:"closeDialog"}),P()))}),300)};(0,r.useEffect)((function(){return window.addEventListener("focus",W,!1),function(){window.removeEventListener("focus",W,!1)}}),[z,_,P,B]);var Z=(0,r.useRef)([]),Y=function(e){C.current&&C.current.contains(e.target)||(e.preventDefault(),Z.current=[])};(0,r.useEffect)((function(){return w&&(document.addEventListener("dragover",N,!1),document.addEventListener("drop",Y,!1)),function(){w&&(document.removeEventListener("dragover",N),document.removeEventListener("drop",Y))}}),[C,w]),(0,r.useEffect)((function(){return!o&&h&&C.current&&C.current.focus(),function(){}}),[C,h,o]);var re=(0,r.useCallback)((function(e){A?A(e):console.error(e)}),[A]),oe=(0,r.useCallback)((function(e){e.preventDefault(),e.persist(),Ee(e),Z.current=[].concat(le(Z.current),[e.target]),q(e)&&Promise.resolve(i(e)).then((function(n){if(!H(e)||j){var t=n.length,r=t>0&&G({files:n,accept:k,minSize:c,maxSize:a,multiple:u,maxFiles:l,validator:F});M({isDragAccept:r,isDragReject:t>0&&!r,isDragActive:!0,type:"setDraggedFiles"}),s&&s(e)}})).catch((function(e){return re(e)}))}),[i,s,re,j,k,c,a,u,l,F]),ie=(0,r.useCallback)((function(e){e.preventDefault(),e.persist(),Ee(e);var n=q(e);if(n&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(t){}return n&&p&&p(e),!1}),[p,j]),ae=(0,r.useCallback)((function(e){e.preventDefault(),e.persist(),Ee(e);var n=Z.current.filter((function(e){return C.current&&C.current.contains(e)})),t=n.indexOf(e.target);-1!==t&&n.splice(t,1),Z.current=n,n.length>0||(M({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),q(e)&&f&&f(e))}),[C,f,j]),fe=(0,r.useCallback)((function(e,n){var t=[],r=[];e.forEach((function(e){var n=se(U(e,k),2),o=n[0],i=n[1],u=se($(e,c,a),2),l=u[0],s=u[1],f=F?F(e):null;if(o&&l&&!f)t.push(e);else{var p=[i,s];f&&(p=p.concat(f)),r.push({file:e,errors:p.filter((function(e){return e}))})}})),(!u&&t.length>1||u&&l>=1&&t.length>l)&&(t.forEach((function(e){r.push({file:e,errors:[K]})})),t.splice(0)),M({acceptedFiles:t,fileRejections:r,type:"setFiles"}),d&&d(t,r,n),r.length>0&&m&&m(r,n),t.length>0&&v&&v(t,n)}),[M,u,k,c,a,l,d,v,m,F]),pe=(0,r.useCallback)((function(e){e.preventDefault(),e.persist(),Ee(e),Z.current=[],q(e)&&Promise.resolve(i(e)).then((function(n){H(e)&&!j||fe(n,e)})).catch((function(e){return re(e)})),M({type:"reset"})}),[i,fe,re,j]),de=(0,r.useCallback)((function(){if(B.current){M({type:"openDialog"}),S();var e={multiple:u,types:E};window.showOpenFilePicker(e).then((function(e){return i(e)})).then((function(e){fe(e,null),M({type:"closeDialog"})})).catch((function(e){ne(e)?(P(e),M({type:"closeDialog"})):te(e)?(B.current=!1,z.current?(z.current.value=null,z.current.click()):re(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):re(e)}))}else z.current&&(M({type:"openDialog"}),S(),z.current.value=null,z.current.click())}),[M,S,P,b,fe,re,E,u]),ye=(0,r.useCallback)((function(e){C.current&&C.current.isEqualNode(e.target)&&(" "!==e.key&&"Enter"!==e.key&&32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),de()))}),[C,de]),we=(0,r.useCallback)((function(){M({type:"focus"})}),[]),Oe=(0,r.useCallback)((function(){M({type:"blur"})}),[]),je=(0,r.useCallback)((function(){D||(J()?setTimeout(de,0):de())}),[D,de]),Ae=function(e){return o?null:e},Fe=function(e){return x?null:Ae(e)},ke=function(e){return O?null:Ae(e)},Ee=function(e){j&&e.stopPropagation()},Se=(0,r.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.refKey,t=void 0===n?"ref":n,r=e.role,i=e.onKeyDown,a=e.onFocus,c=e.onBlur,u=e.onClick,l=e.onDragEnter,s=e.onDragOver,f=e.onDragLeave,p=e.onDrop,d=ge(e,ce);return ve(ve(me({onKeyDown:Fe(Q(i,ye)),onFocus:Fe(Q(a,we)),onBlur:Fe(Q(c,Oe)),onClick:Ae(Q(u,je)),onDragEnter:ke(Q(l,oe)),onDragOver:ke(Q(s,ie)),onDragLeave:ke(Q(f,ae)),onDrop:ke(Q(p,pe)),role:"string"==typeof r&&""!==r?r:"presentation"},t,C),o||x?{}:{tabIndex:0}),d)}}),[C,ye,we,Oe,je,oe,ie,ae,pe,x,O,o]),Pe=(0,r.useCallback)((function(e){e.stopPropagation()}),[]),Ce=(0,r.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.refKey,t=void 0===n?"ref":n,r=e.onChange,o=e.onClick,i=ge(e,ue),a=me({accept:k,multiple:u,type:"file",style:{display:"none"},onChange:Ae(Q(r,pe)),onClick:Ae(Q(o,Pe)),tabIndex:-1},t,z);return ve(ve({},a),i)}}),[z,t,u,pe,o]);return ve(ve({},T),{},{isFocused:L&&!o,getRootProps:Se,getInputProps:Ce,rootRef:C,inputRef:z,open:Ae(de)})}function De(e,n){switch(n.type){case"focus":return ve(ve({},e),{},{isFocused:!0});case"blur":return ve(ve({},e),{},{isFocused:!1});case"openDialog":return ve(ve({},he),{},{isFileDialogActive:!0});case"closeDialog":return ve(ve({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return ve(ve({},e),{},{isDragActive:n.isDragActive,isDragAccept:n.isDragAccept,isDragReject:n.isDragReject});case"setFiles":return ve(ve({},e),{},{acceptedFiles:n.acceptedFiles,fileRejections:n.fileRejections});case"reset":return ve({},he);default:return e}}function xe(){}}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/5d7f3e2f.89ac2b20.js b/src/main/resources/ui/assets/js/5d7f3e2f.89ac2b20.js
new file mode 100644
index 0000000..45457e2
--- /dev/null
+++ b/src/main/resources/ui/assets/js/5d7f3e2f.89ac2b20.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[910],{809:function(t,e,i){i.r(e),i.d(e,{assets:function(){return u},contentTitle:function(){return r},default:function(){return d},frontMatter:function(){return o},metadata:function(){return l},toc:function(){return s}});var n=i(7462),a=(i(7294),i(3905));const o={sidebar_position:1},r="Configurations",l={unversionedId:"configurations",id:"configurations",title:"Configurations",description:"The validator needs a scenario configuration for working properly.",source:"@site/docs/configurations.md",sourceDirName:".",slug:"/configurations",permalink:"/docs/configurations",draft:!1,editUrl:"https://github.com/itplr-kosit/validator/server/ui/docs/configurations.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",next:{title:"API Usage",permalink:"/docs/api"}},u={},s=[],c={toc:s};function d(t){let{components:e,...i}=t;return(0,a.kt)("wrapper",(0,n.Z)({},c,i,{components:e,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"configurations"},"Configurations"),(0,a.kt)("p",null,"The validator needs a scenario configuration for working properly."),(0,a.kt)("p",null,"Currently, there are two public third party validation configurations available."),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Validation Configuration for ",(0,a.kt)("a",{parentName:"li",href:"http://www.xoev.de/de/xrechnung"},"XRechnung"),":",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},"Source code is available on ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator-configuration-xrechnung"},"GitHub")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator-configuration-xrechnung/releases"},"Releases")," can also be downloaded"))),(0,a.kt)("li",{parentName:"ul"},"Validation Configuration for ",(0,a.kt)("a",{parentName:"li",href:"https://xgewerbeanzeige.de/"},"XGewerbeanzeige"),(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},"Source code is available on ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige"},"GitHub")),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator-configuration-xgewerbeanzeige/releases"},"Releases")," can also be downloaded")))),(0,a.kt)("p",null,"For creating custom configurations\nsee ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/itplr-kosit/validator/blob/master/docs/configurations.md"},"configuration documentation"),"\nfor details"))}d.isMDXComponent=!0}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/5fbc5cf1.6eb09db1.js b/src/main/resources/ui/assets/js/5fbc5cf1.6eb09db1.js
new file mode 100644
index 0000000..0ef5cdb
--- /dev/null
+++ b/src/main/resources/ui/assets/js/5fbc5cf1.6eb09db1.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[207],{7480:function(e,t,n){n.r(t),n.d(t,{assets:function(){return l},contentTitle:function(){return o},default:function(){return c},frontMatter:function(){return r},metadata:function(){return s},toc:function(){return p}});var a=n(7462),i=(n(7294),n(3905));const r={sidebar_position:2},o="API Usage",s={unversionedId:"api",id:"api",title:"API Usage",description:"The validation service listens to POST-requests to any server uri. You need to supply the xml/object to validate in",source:"@site/docs/api.md",sourceDirName:".",slug:"/api",permalink:"/docs/api",draft:!1,editUrl:"https://github.com/itplr-kosit/validator/server/ui/docs/api.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Configurations",permalink:"/docs/configurations"},next:{title:"Changelog",permalink:"/docs/changelog"}},l={},p=[],u={toc:p};function c(e){let{components:t,...n}=e;return(0,i.kt)("wrapper",(0,a.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"api-usage"},"API Usage"),(0,i.kt)("p",null,"The validation service listens to ",(0,i.kt)("inlineCode",{parentName:"p"},"POST"),"-requests to any server uri. You need to supply the xml/object to validate in\nthe post body.\nThe service expects a single plain input in the post body, e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"multipart/form-data")," is not supported."),(0,i.kt)("p",null,"Examples:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"cURL"))),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-shell",metastring:"script",script:!0},"curl --location --request POST 'http://localhost:8080' \\\n--header 'Content-Type: application/xml' \\\n--data-binary '@/target.xml'\n")),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"java")," (Apache HttpClient)")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-java"},'HttpClient httpClient=HttpClientBuilder.create().build();\n HttpPost postRequest=new HttpPost("http://localhost:8080/");\n FileEntity entity=new FileEntity(Paths.get("some.xml").toFile(),ContentType.APPLICATION_XML);\n postRequest.setEntity(entity);\n HttpResponse response=httpClient.execute(postRequest);\n System.out.println(IOUtils.toString(response.getEntity().getContent()));\n')),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("inlineCode",{parentName:"li"},"javascript"))),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-javascript"},'var myHeaders = new Headers();\nmyHeaders.append("Content-Type", "application/xml");\n\nvar file = "";\n\nvar requestOptions = {\n method: \'POST\',\n headers: myHeaders,\n body: file,\n redirect: \'follow\'\n};\n\nfetch("http://localhost:8080", requestOptions)\n .then(response => response.text())\n .then(result => console.log(result))\n .catch(error => console.log(\'error\', error));\n')))}c.isMDXComponent=!0}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/601.da3afc33.js b/src/main/resources/ui/assets/js/601.da3afc33.js
new file mode 100644
index 0000000..b1426e6
--- /dev/null
+++ b/src/main/resources/ui/assets/js/601.da3afc33.js
@@ -0,0 +1 @@
+(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[601],{2503:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var a=n(7462),o=n(7294),l=n(6010),r=n(5999),c=n(6668),i="anchorWithStickyNavbar_LWe7",s="anchorWithHideOnScrollNavbar_WYt5";function m(e){let{as:t,id:n,...m}=e;const{navbar:{hideOnScroll:u}}=(0,c.L)();return"h1"!==t&&n?o.createElement(t,(0,a.Z)({},m,{className:(0,l.Z)("anchor",u?s:i),id:n}),m.children,o.createElement("a",{className:"hash-link",href:`#${n}`,title:(0,r.I)({id:"theme.common.headingLinkTitle",message:"Direct link to heading",description:"Title for link to heading"})},"\u200b")):o.createElement(t,(0,a.Z)({},m,{id:void 0}))}},9254:function(e,t,n){"use strict";n.d(t,{Z:function(){return ie}});var a=n(7294),o=n(3905),l=n(7462),r=n(5742);var c=n(2389),i=n(6010),s=n(2949),m=n(6668);function u(){const{prism:e}=(0,m.L)(),{colorMode:t}=(0,s.I)(),n=e.theme,a=e.darkTheme||n;return"dark"===t?a:n}var d=n(5281),f=n(7594),p=n.n(f);const h=/title=(?["'])(?.*?)\1/,v=/\{(?[\d,-]+)\}/,g={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}};function b(e,t){const n=e.map((e=>{const{start:n,end:a}=g[e];return`(?:${n}\\s*(${t.flatMap((e=>{var t,n;return[e.line,null==(t=e.block)?void 0:t.start,null==(n=e.block)?void 0:n.end].filter(Boolean)})).join("|")})\\s*${a})`})).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)}function E(e,t){let n=e.replace(/\n$/,"");const{language:a,magicComments:o,metastring:l}=t;if(l&&v.test(l)){const e=l.match(v).groups.range;if(0===o.length)throw new Error(`A highlight range has been given in code block's metastring (\`\`\` ${l}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);const t=o[0].className,a=p()(e).filter((e=>e>0)).map((e=>[e-1,[t]]));return{lineClassNames:Object.fromEntries(a),code:n}}if(void 0===a)return{lineClassNames:{},code:n};const r=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return b(["js","jsBlock"],t);case"jsx":case"tsx":return b(["js","jsBlock","jsx"],t);case"html":return b(["js","jsBlock","html"],t);case"python":case"py":case"bash":return b(["bash"],t);case"markdown":case"md":return b(["html","jsx","bash"],t);default:return b(Object.keys(g),t)}}(a,o),c=n.split("\n"),i=Object.fromEntries(o.map((e=>[e.className,{start:0,range:""}]))),s=Object.fromEntries(o.filter((e=>e.line)).map((e=>{let{className:t,line:n}=e;return[n,t]}))),m=Object.fromEntries(o.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.start,t]}))),u=Object.fromEntries(o.filter((e=>e.block)).map((e=>{let{className:t,block:n}=e;return[n.end,t]})));for(let f=0;fvoid 0!==e));s[t]?i[s[t]].range+=`${f},`:m[t]?i[m[t]].start=f:u[t]&&(i[u[t]].range+=`${i[u[t]].start}-${f-1},`),c.splice(f,1)}n=c.join("\n");const d={};return Object.entries(i).forEach((e=>{let[t,{range:n}]=e;p()(n).forEach((e=>{d[e]??=[],d[e].push(t)}))})),{lineClassNames:d,code:n}}var k="codeBlockContainer_Ckt0";function N(e){let{as:t,...n}=e;const o=function(e){const t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach((e=>{let[a,o]=e;const l=t[a];l&&"string"==typeof o&&(n[l]=o)})),n}(u());return a.createElement(t,(0,l.Z)({},n,{style:o,className:(0,i.Z)(n.className,k,d.k.common.codeBlock)}))}var y={codeBlockContent:"codeBlockContent_biex",codeBlockTitle:"codeBlockTitle_Ktv7",codeBlock:"codeBlock_bY9V",codeBlockStandalone:"codeBlockStandalone_MEMb",codeBlockLines:"codeBlockLines_e6Vv",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_o6Pm",buttonGroup:"buttonGroup__atx"};function C(e){let{children:t,className:n}=e;return a.createElement(N,{as:"pre",tabIndex:0,className:(0,i.Z)(y.codeBlockStandalone,"thin-scrollbar",n)},a.createElement("code",{className:y.codeBlockLines},t))}var L=n(902);const B={attributes:!0,characterData:!0,childList:!0,subtree:!0};function Z(e,t){const[n,o]=(0,a.useState)(),l=(0,a.useCallback)((()=>{var t;o(null==(t=e.current)?void 0:t.closest("[role=tabpanel][hidden]"))}),[e,o]);(0,a.useEffect)((()=>{l()}),[l]),function(e,t,n){void 0===n&&(n=B);const o=(0,L.zX)(t),l=(0,L.Ql)(n);(0,a.useEffect)((()=>{const t=new MutationObserver(o);return e&&t.observe(e,l),()=>t.disconnect()}),[e,o,l])}(n,(e=>{e.forEach((e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),l())}))}),{attributes:!0,characterData:!1,childList:!1,subtree:!1})}var x=n(3746),w="codeLine_lJS_",H="codeLineNumber_Tfdd",_="codeLineContent_feaV";function T(e){let{line:t,classNames:n,showLineNumbers:o,getLineProps:r,getTokenProps:c}=e;1===t.length&&"\n"===t[0].content&&(t[0].content="");const s=r({line:t,className:(0,i.Z)(n,o&&w)}),m=t.map(((e,t)=>a.createElement("span",(0,l.Z)({key:t},c({token:e,key:t})))));return a.createElement("span",s,o?a.createElement(a.Fragment,null,a.createElement("span",{className:H}),a.createElement("span",{className:_},m)):m,a.createElement("br",null))}var S=n(5999),A={copyButtonCopied:"copyButtonCopied_obH4",copyButtonIcons:"copyButtonIcons_eSgA",copyButtonIcon:"copyButtonIcon_y97N",copyButtonSuccessIcon:"copyButtonSuccessIcon_LjdS"};function I(e){let{code:t,className:n}=e;const[o,l]=(0,a.useState)(!1),r=(0,a.useRef)(void 0),c=(0,a.useCallback)((()=>{!function(e,t){let{target:n=document.body}=void 0===t?{}:t;const a=document.createElement("textarea"),o=document.activeElement;a.value=e,a.setAttribute("readonly",""),a.style.contain="strict",a.style.position="absolute",a.style.left="-9999px",a.style.fontSize="12pt";const l=document.getSelection();let r=!1;l.rangeCount>0&&(r=l.getRangeAt(0)),n.append(a),a.select(),a.selectionStart=0,a.selectionEnd=e.length;let c=!1;try{c=document.execCommand("copy")}catch{}a.remove(),r&&(l.removeAllRanges(),l.addRange(r)),o&&o.focus()}(t),l(!0),r.current=window.setTimeout((()=>{l(!1)}),1e3)}),[t]);return(0,a.useEffect)((()=>()=>window.clearTimeout(r.current)),[]),a.createElement("button",{type:"button","aria-label":o?(0,S.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,S.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,S.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,i.Z)("clean-btn",n,A.copyButton,o&&A.copyButtonCopied),onClick:c},a.createElement("span",{className:A.copyButtonIcons,"aria-hidden":"true"},a.createElement("svg",{className:A.copyButtonIcon,viewBox:"0 0 24 24"},a.createElement("path",{d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})),a.createElement("svg",{className:A.copyButtonSuccessIcon,viewBox:"0 0 24 24"},a.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))))}var j="wordWrapButtonIcon_Bwma",M="wordWrapButtonEnabled_EoeP";function z(e){let{className:t,onClick:n,isEnabled:o}=e;const l=(0,S.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return a.createElement("button",{type:"button",onClick:n,className:(0,i.Z)("clean-btn",t,o&&M),"aria-label":l,title:l},a.createElement("svg",{className:j,viewBox:"0 0 24 24","aria-hidden":"true"},a.createElement("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})))}function R(e){let{children:t,className:n="",metastring:o,title:r,showLineNumbers:c,language:s}=e;const{prism:{defaultLanguage:d,magicComments:f}}=(0,m.L)(),p=s??function(e){const t=e.split(" ").find((e=>e.startsWith("language-")));return null==t?void 0:t.replace(/language-/,"")}(n)??d,v=u(),g=function(){const[e,t]=(0,a.useState)(!1),[n,o]=(0,a.useState)(!1),l=(0,a.useRef)(null),r=(0,a.useCallback)((()=>{const n=l.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t((e=>!e))}),[l,e]),c=(0,a.useCallback)((()=>{const{scrollWidth:e,clientWidth:t}=l.current,n=e>t||l.current.querySelector("code").hasAttribute("style");o(n)}),[l]);return Z(l,c),(0,a.useEffect)((()=>{c()}),[e,c]),(0,a.useEffect)((()=>(window.addEventListener("resize",c,{passive:!0}),()=>{window.removeEventListener("resize",c)})),[c]),{codeBlockRef:l,isEnabled:e,isCodeScrollable:n,toggle:r}}(),b=function(e){var t;return(null==e||null==(t=e.match(h))?void 0:t.groups.title)??""}(o)||r,{lineClassNames:k,code:C}=E(t,{metastring:o,language:p,magicComments:f}),L=c??function(e){return Boolean(null==e?void 0:e.includes("showLineNumbers"))}(o);return a.createElement(N,{as:"div",className:(0,i.Z)(n,p&&!n.includes(`language-${p}`)&&`language-${p}`)},b&&a.createElement("div",{className:y.codeBlockTitle},b),a.createElement("div",{className:y.codeBlockContent},a.createElement(x.ZP,(0,l.Z)({},x.lG,{theme:v,code:C,language:p??"text"}),(e=>{let{className:t,tokens:n,getLineProps:o,getTokenProps:l}=e;return a.createElement("pre",{tabIndex:0,ref:g.codeBlockRef,className:(0,i.Z)(t,y.codeBlock,"thin-scrollbar")},a.createElement("code",{className:(0,i.Z)(y.codeBlockLines,L&&y.codeBlockLinesWithNumbering)},n.map(((e,t)=>a.createElement(T,{key:t,line:e,getLineProps:o,getTokenProps:l,classNames:k[t],showLineNumbers:L})))))})),a.createElement("div",{className:y.buttonGroup},(g.isEnabled||g.isCodeScrollable)&&a.createElement(z,{className:y.codeButton,onClick:()=>g.toggle(),isEnabled:g.isEnabled}),a.createElement(I,{className:y.codeButton,code:C}))))}function O(e){let{children:t,...n}=e;const o=(0,c.Z)(),r=function(e){return a.Children.toArray(e).some((e=>(0,a.isValidElement)(e)))?e:Array.isArray(e)?e.join(""):e}(t),i="string"==typeof r?R:C;return a.createElement(i,(0,l.Z)({key:String(o)},n),r)}var V=n(9960);var $=n(6043),W="details_lb9f",P="isBrowser_bmU9",q="collapsibleContent_i85q";function D(e){return!!e&&("SUMMARY"===e.tagName||D(e.parentElement))}function G(e,t){return!!e&&(e===t||G(e.parentElement,t))}function U(e){let{summary:t,children:n,...o}=e;const r=(0,c.Z)(),s=(0,a.useRef)(null),{collapsed:m,setCollapsed:u}=(0,$.u)({initialState:!o.open}),[d,f]=(0,a.useState)(o.open);return a.createElement("details",(0,l.Z)({},o,{ref:s,open:d,"data-collapsed":m,className:(0,i.Z)(W,r&&P,o.className),onMouseDown:e=>{D(e.target)&&e.detail>1&&e.preventDefault()},onClick:e=>{e.stopPropagation();const t=e.target;D(t)&&G(t,s.current)&&(e.preventDefault(),m?(u(!1),f(!0)):u(!0))}}),t??a.createElement("summary",null,"Details"),a.createElement($.z,{lazy:!1,collapsed:m,disableSSRStyle:!0,onCollapseTransitionEnd:e=>{u(e),f(!e)}},a.createElement("div",{className:q},n)))}var F="details_b_Ee";function Y(e){let{...t}=e;return a.createElement(U,(0,l.Z)({},t,{className:(0,i.Z)("alert alert--info",F,t.className)}))}var Q=n(2503);function J(e){return a.createElement(Q.Z,e)}var K="containsTaskList_mC6p";var X="img_ev3q";var ee="admonition_LlT9",te="admonitionHeading_tbUL",ne="admonitionIcon_kALy",ae="admonitionContent_S0QG";const oe={note:{infimaClassName:"secondary",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 14 16"},a.createElement("path",{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"}))},label:a.createElement(S.Z,{id:"theme.admonition.note",description:"The default label used for the Note admonition (:::note)"},"note")},tip:{infimaClassName:"success",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 12 16"},a.createElement("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"}))},label:a.createElement(S.Z,{id:"theme.admonition.tip",description:"The default label used for the Tip admonition (:::tip)"},"tip")},danger:{infimaClassName:"danger",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 12 16"},a.createElement("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"}))},label:a.createElement(S.Z,{id:"theme.admonition.danger",description:"The default label used for the Danger admonition (:::danger)"},"danger")},info:{infimaClassName:"info",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 14 16"},a.createElement("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"}))},label:a.createElement(S.Z,{id:"theme.admonition.info",description:"The default label used for the Info admonition (:::info)"},"info")},caution:{infimaClassName:"warning",iconComponent:function(){return a.createElement("svg",{viewBox:"0 0 16 16"},a.createElement("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"}))},label:a.createElement(S.Z,{id:"theme.admonition.caution",description:"The default label used for the Caution admonition (:::caution)"},"caution")}},le={secondary:"note",important:"info",success:"tip",warning:"danger"};function re(e){const{mdxAdmonitionTitle:t,rest:n}=function(e){const t=a.Children.toArray(e),n=t.find((e=>{var t;return a.isValidElement(e)&&"mdxAdmonitionTitle"===(null==(t=e.props)?void 0:t.mdxType)})),o=a.createElement(a.Fragment,null,t.filter((e=>e!==n)));return{mdxAdmonitionTitle:n,rest:o}}(e.children);return{...e,title:e.title??t,children:n}}var ce={head:function(e){const t=a.Children.map(e.children,(e=>a.isValidElement(e)?function(e){var t;if(null!=(t=e.props)&&t.mdxType&&e.props.originalType){const{mdxType:t,originalType:n,...o}=e.props;return a.createElement(e.props.originalType,o)}return e}(e):e));return a.createElement(r.Z,e,t)},code:function(e){const t=["a","abbr","b","br","button","cite","code","del","dfn","em","i","img","input","ins","kbd","label","object","output","q","ruby","s","small","span","strong","sub","sup","time","u","var","wbr"];return a.Children.toArray(e.children).every((e=>{var n;return"string"==typeof e&&!e.includes("\n")||(0,a.isValidElement)(e)&&t.includes(null==(n=e.props)?void 0:n.mdxType)}))?a.createElement("code",e):a.createElement(O,e)},a:function(e){return a.createElement(V.Z,e)},pre:function(e){var t;return a.createElement(O,(0,a.isValidElement)(e.children)&&"code"===(null==(t=e.children.props)?void 0:t.originalType)?e.children.props:{...e})},details:function(e){const t=a.Children.toArray(e.children),n=t.find((e=>{var t;return a.isValidElement(e)&&"summary"===(null==(t=e.props)?void 0:t.mdxType)})),o=a.createElement(a.Fragment,null,t.filter((e=>e!==n)));return a.createElement(Y,(0,l.Z)({},e,{summary:n}),o)},ul:function(e){return a.createElement("ul",(0,l.Z)({},e,{className:(t=e.className,(0,i.Z)(t,(null==t?void 0:t.includes("contains-task-list"))&&K))}));var t},img:function(e){return a.createElement("img",(0,l.Z)({loading:"lazy"},e,{className:(t=e.className,(0,i.Z)(t,X))}));var t},h1:e=>a.createElement(J,(0,l.Z)({as:"h1"},e)),h2:e=>a.createElement(J,(0,l.Z)({as:"h2"},e)),h3:e=>a.createElement(J,(0,l.Z)({as:"h3"},e)),h4:e=>a.createElement(J,(0,l.Z)({as:"h4"},e)),h5:e=>a.createElement(J,(0,l.Z)({as:"h5"},e)),h6:e=>a.createElement(J,(0,l.Z)({as:"h6"},e)),admonition:function(e){const{children:t,type:n,title:o,icon:l}=re(e),r=function(e){const t=le[e]??e;return oe[t]||(console.warn(`No admonition config found for admonition type "${t}". Using Info as fallback.`),oe.info)}(n),c=o??r.label,{iconComponent:s}=r,m=l??a.createElement(s,null);return a.createElement("div",{className:(0,i.Z)(d.k.common.admonition,d.k.common.admonitionType(e.type),"alert",`alert--${r.infimaClassName}`,ee)},a.createElement("div",{className:te},a.createElement("span",{className:ne},m),c),a.createElement("div",{className:ae},t))},mermaid:n(1875).Z};function ie(e){let{children:t}=e;return a.createElement(o.Zo,{components:ce},t)}},9407:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var a=n(7462),o=n(7294),l=n(6010),r=n(3743),c="tableOfContents_bqdL";function i(e){let{className:t,...n}=e;return o.createElement("div",{className:(0,l.Z)(c,"thin-scrollbar",t)},o.createElement(r.Z,(0,a.Z)({},n,{linkClassName:"table-of-contents__link toc-highlight",linkActiveClassName:"table-of-contents__link--active"})))}},3743:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var a=n(7462),o=n(7294),l=n(6668);function r(e){const t=e.map((e=>({...e,parentIndex:-1,children:[]}))),n=Array(7).fill(-1);t.forEach(((e,t)=>{const a=n.slice(2,e.level);e.parentIndex=Math.max(...a),n[e.level]=t}));const a=[];return t.forEach((e=>{const{parentIndex:n,...o}=e;n>=0?t[n].children.push(o):a.push(o)})),a}function c(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:a}=e;return t.flatMap((e=>{const t=c({toc:e.children,minHeadingLevel:n,maxHeadingLevel:a});return function(e){return e.level>=n&&e.level<=a}(e)?[{...e,children:t}]:t}))}function i(e){const t=e.getBoundingClientRect();return t.top===t.bottom?i(e.parentNode):t}function s(e,t){let{anchorTopOffset:n}=t;const a=e.find((e=>i(e).top>=n));if(a){return function(e){return e.top>0&&e.bottom{e.current=t?0:document.querySelector(".navbar").clientHeight}),[t]),e}function u(e){const t=(0,o.useRef)(void 0),n=m();(0,o.useEffect)((()=>{if(!e)return()=>{};const{linkClassName:a,linkActiveClassName:o,minHeadingLevel:l,maxHeadingLevel:r}=e;function c(){const e=function(e){return Array.from(document.getElementsByClassName(e))}(a),c=function(e){let{minHeadingLevel:t,maxHeadingLevel:n}=e;const a=[];for(let o=t;o<=n;o+=1)a.push(`h${o}.anchor`);return Array.from(document.querySelectorAll(a.join()))}({minHeadingLevel:l,maxHeadingLevel:r}),i=s(c,{anchorTopOffset:n.current}),m=e.find((e=>i&&i.id===function(e){return decodeURIComponent(e.href.substring(e.href.indexOf("#")+1))}(e)));e.forEach((e=>{!function(e,n){n?(t.current&&t.current!==e&&t.current.classList.remove(o),e.classList.add(o),t.current=e):e.classList.remove(o)}(e,e===m)}))}return document.addEventListener("scroll",c),document.addEventListener("resize",c),c(),()=>{document.removeEventListener("scroll",c),document.removeEventListener("resize",c)}}),[e,n])}function d(e){let{toc:t,className:n,linkClassName:a,isChild:l}=e;return t.length?o.createElement("ul",{className:l?void 0:n},t.map((e=>o.createElement("li",{key:e.id},o.createElement("a",{href:`#${e.id}`,className:a??void 0,dangerouslySetInnerHTML:{__html:e.value}}),o.createElement(d,{isChild:!0,toc:e.children,className:n,linkClassName:a}))))):null}var f=o.memo(d);function p(e){let{toc:t,className:n="table-of-contents table-of-contents__left-border",linkClassName:i="table-of-contents__link",linkActiveClassName:s,minHeadingLevel:m,maxHeadingLevel:d,...p}=e;const h=(0,l.L)(),v=m??h.tableOfContents.minHeadingLevel,g=d??h.tableOfContents.maxHeadingLevel,b=function(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:a}=e;return(0,o.useMemo)((()=>c({toc:r(t),minHeadingLevel:n,maxHeadingLevel:a})),[t,n,a])}({toc:t,minHeadingLevel:v,maxHeadingLevel:g});return u((0,o.useMemo)((()=>{if(i&&s)return{linkClassName:i,linkActiveClassName:s,minHeadingLevel:v,maxHeadingLevel:g}}),[i,s,v,g])),o.createElement(f,(0,a.Z)({toc:b,className:n,linkClassName:i},p))}},7594:function(e,t){function n(e){let t,n=[];for(let a of e.split(",").map((e=>e.trim())))if(/^-?\d+$/.test(a))n.push(parseInt(a,10));else if(t=a.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,a,o,l]=t;if(a&&l){a=parseInt(a),l=parseInt(l);const e=a{o(t,{headers:{"Content-Type":"application/xml"}})}),[t,o]),r.createElement(r.Fragment,null,d===l.e.Failure&&u&&r.createElement(i.Z,{title:"An error occurred while fetching"},r.createElement(a.Z,null,u.message)),d===l.e.Success&&c&&r.createElement(a.Z,{download:{fileName:n,mime:"application/xml"},enableCopy:!0},c))}},3596:function(e,t,n){n.r(t);var r=n(7294),a=n(8222),i=n(6275);t.default=function(){return r.createElement(a.Z,{title:"Validator configuration",layoutDescription:"The currently loaded validator configuration",headline:"Validator configuration",description:"View the currently loaded validator configuration."},r.createElement(i.Z,{endpoint:"/server/config",fileName:"config.xml"}))}}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/798a5b56.5978ee14.js b/src/main/resources/ui/assets/js/798a5b56.5978ee14.js
new file mode 100644
index 0000000..821dc44
--- /dev/null
+++ b/src/main/resources/ui/assets/js/798a5b56.5978ee14.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[433,981],{6275:function(e,t,n){n.d(t,{Z:function(){return o}});var a=n(7294),r=n(5833),l=n(7547),i=n(7506);var o=function(e){let{endpoint:t,fileName:n}=e;const{request:o,data:u,error:c,status:s}=(0,i.Z)();return(0,a.useEffect)((()=>{o(t,{headers:{"Content-Type":"application/xml"}})}),[t,o]),a.createElement(a.Fragment,null,s===i.e.Failure&&c&&a.createElement(l.Z,{title:"An error occurred while fetching"},a.createElement(r.Z,null,c.message)),s===i.e.Success&&u&&a.createElement(r.Z,{download:{fileName:n,mime:"application/xml"},enableCopy:!0},u))}},2406:function(e,t,n){n.r(t);var a=n(7294),r=n(8222),l=n(6275);t.default=function(){return a.createElement(r.Z,{title:"Health information",layoutDescription:"Health and status information about the system",headline:"Server health information",description:"Information about health and status of the running system."},a.createElement(l.Z,{endpoint:"/server/health",fileName:"health.xml"}))}},6411:function(e,t,n){n.r(t);var a=n(2406);t.default=a.default}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/935f2afb.66d1c40f.js b/src/main/resources/ui/assets/js/935f2afb.66d1c40f.js
new file mode 100644
index 0000000..f47cfe9
--- /dev/null
+++ b/src/main/resources/ui/assets/js/935f2afb.66d1c40f.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[53],{1109:function(e){e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"tutorialSidebar":[{"type":"link","label":"Configurations","href":"/docs/configurations","docId":"configurations"},{"type":"link","label":"API Usage","href":"/docs/api","docId":"api"},{"type":"link","label":"Changelog","href":"/docs/changelog","docId":"changelog"}]},"docs":{"api":{"id":"api","title":"API Usage","description":"The validation service listens to POST-requests to any server uri. You need to supply the xml/object to validate in","sidebar":"tutorialSidebar"},"changelog":{"id":"changelog","title":"Changelog","description":"All notable changes to this project will be documented in this file.","sidebar":"tutorialSidebar"},"configurations":{"id":"configurations","title":"Configurations","description":"The validator needs a scenario configuration for working properly.","sidebar":"tutorialSidebar"}}}')}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/972.acd6d62f.js b/src/main/resources/ui/assets/js/972.acd6d62f.js
new file mode 100644
index 0000000..a571d53
--- /dev/null
+++ b/src/main/resources/ui/assets/js/972.acd6d62f.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[972],{4972:function(e,t,n){n.r(t),n.d(t,{default:function(){return i}});var a=n(7294),o=n(5999),l=n(1944),r=n(3285);function i(){return a.createElement(a.Fragment,null,a.createElement(l.d,{title:(0,o.I)({id:"theme.NotFound.title",message:"Page Not Found"})}),a.createElement(r.Z,null,a.createElement("main",{className:"container margin-vert--xl"},a.createElement("div",{className:"row"},a.createElement("div",{className:"col col--6 col--offset-3"},a.createElement("h1",{className:"hero__title"},a.createElement(o.Z,{id:"theme.NotFound.title",description:"The title of the 404 page"},"Page Not Found")),a.createElement("p",null,a.createElement(o.Z,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page"},"We could not find what you were looking for.")),a.createElement("p",null,a.createElement(o.Z,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page"},"Please contact the owner of the site that linked you to the original URL and let them know their link is broken.")))))))}}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/9beb87c2.1cc504cf.js b/src/main/resources/ui/assets/js/9beb87c2.1cc504cf.js
new file mode 100644
index 0000000..e1c88d7
--- /dev/null
+++ b/src/main/resources/ui/assets/js/9beb87c2.1cc504cf.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[80],{1016:function(e,t,a){a.r(t),a.d(t,{assets:function(){return d},contentTitle:function(){return r},default:function(){return p},frontMatter:function(){return n},metadata:function(){return o},toc:function(){return s}});var i=a(7462),l=(a(7294),a(3905));const n={},r="Changelog",o={unversionedId:"changelog",id:"changelog",title:"Changelog",description:"All notable changes to this project will be documented in this file.",source:"@site/docs/changelog.md",sourceDirName:".",slug:"/changelog",permalink:"/docs/changelog",draft:!1,editUrl:"https://github.com/itplr-kosit/validator/server/ui/docs/changelog.md",tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"API Usage",permalink:"/docs/api"}},d={},s=[{value:"Fixed",id:"fixed",level:3},{value:"Added",id:"added",level:3},{value:"Changed",id:"changed",level:3},{value:"1.4.2",id:"142",level:2},{value:"Fixed",id:"fixed-1",level:3},{value:"1.4.1",id:"141",level:2},{value:"Fixed",id:"fixed-2",level:3},{value:"1.4.0",id:"140",level:2},{value:"Fixed",id:"fixed-3",level:3},{value:"Added",id:"added-1",level:3},{value:"Changed",id:"changed-1",level:3},{value:"1.3.1",id:"131",level:2},{value:"Fixed",id:"fixed-4",level:3},{value:"Added",id:"added-2",level:3},{value:"Changed",id:"changed-2",level:3},{value:"1.3.0",id:"130",level:2},{value:"Added",id:"added-3",level:3},{value:"Changed",id:"changed-3",level:3},{value:"Deprecations",id:"deprecations",level:3},{value:"1.2.1",id:"121",level:2},{value:"Fixed",id:"fixed-5",level:3},{value:"1.2.0",id:"120",level:2},{value:"Added",id:"added-4",level:3},{value:"Changed",id:"changed-4",level:3},{value:"1.1.3",id:"113",level:2},{value:"Fixed",id:"fixed-6",level:3},{value:"1.1.2",id:"112",level:2},{value:"Fixed",id:"fixed-7",level:3},{value:"1.1.1",id:"111",level:2},{value:"Added",id:"added-5",level:3},{value:"Fixed",id:"fixed-8",level:3},{value:"1.1.0",id:"110",level:2},{value:"Added",id:"added-6",level:3},{value:"Changed",id:"changed-5",level:3},{value:"1.0.2",id:"102",level:2},{value:"Fixed",id:"fixed-9",level:3},{value:"1.0.1",id:"101",level:2},{value:"Changed",id:"changed-6",level:3},{value:"1.0.0",id:"100",level:2}],u={toc:s};function p(e){let{components:t,...a}=e;return(0,l.kt)("wrapper",(0,i.Z)({},u,a,{components:t,mdxType:"MDXLayout"}),(0,l.kt)("h1",{id:"changelog"},"Changelog"),(0,l.kt)("p",null,"All notable changes to this project will be documented in this file."),(0,l.kt)("p",null,"The format is based on ",(0,l.kt)("a",{parentName:"p",href:"https://keepachangelog.com/en/1.0.0/"},"Keep a Changelog"),"\nand this project adheres to ",(0,l.kt)("a",{parentName:"p",href:"https://semver.org/spec/v2.0.0.html"},"Semantic Versioning"),"."),(0,l.kt)("h1",{id:"150"},"1.5.0"),(0,l.kt)("h3",{id:"fixed"},"Fixed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"(CLI) ",(0,l.kt)("a",{parentName:"li",href:"https://projekte.kosit.org/kosit/validator/-/issues/93"},"#93")," Remove usage information, when validation failed"),(0,l.kt)("li",{parentName:"ul"},"(CLI) ",(0,l.kt)("a",{parentName:"li",href:"https://projekte.kosit.org/kosit/validator/-/issues/95"},"#95"),' NPE when using empty repository definition (-r "")')),(0,l.kt)("h3",{id:"added"},"Added"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"(CLI) Support for multiple configurations and multiple repositories. See ",(0,l.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator/blob/master/docs/cli.md"},"cli documentation")," for details"),(0,l.kt)("li",{parentName:"ul"},"(API) Possibility to use preconfigured Saxon ",(0,l.kt)("inlineCode",{parentName:"li"},"Processor")," instance for validation")),(0,l.kt)("h3",{id:"changed"},"Changed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("p",{parentName:"li"},"(DAEMON) UI rewrite based on ",(0,l.kt)("a",{parentName:"p",href:"https://docusaurus.io"},"Docusaurs"))),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("p",{parentName:"li"},"(\nAPI) ",(0,l.kt)("a",{parentName:"p",href:"https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy"},"ResolvingConfigurationStrategy.java#getProcessor()"),"\nis removed.")),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("p",{parentName:"li"},"(CORE) Bump ",(0,l.kt)("a",{parentName:"p",href:"https://www.saxonica.com/documentation11/documentation.xml"},"Saxon HE")," to 11.4")),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("p",{parentName:"li"},"(CORE) Bump ",(0,l.kt)("a",{parentName:"p",href:"https://github.com/eclipse-ee4j/jaxb-ri"},"jaxb-ri")," to 2.3.7")),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("p",{parentName:"li"},"(CORE) CLI parsing based on pico-cli, commons-cli is removed"))),(0,l.kt)("h2",{id:"142"},"1.4.2"),(0,l.kt)("h3",{id:"fixed-1"},"Fixed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"(CLI) ",(0,l.kt)("a",{parentName:"li",href:"https://projekte.kosit.org/kosit/validator/-/issues/74"},"#74")," fix ansi output of the cli version"),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator/issues/80"},"#80")," using classloader to initialize jaxb context (to support\nusage in OSGi\nenvironments)"),(0,l.kt)("li",{parentName:"ul"},"[#75]"," (",(0,l.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator/issues/75"},"https://github.com/itplr-kosit/validator/issues/75"),") Improve logging on invalid documents")),(0,l.kt)("h2",{id:"141"},"1.4.1"),(0,l.kt)("h3",{id:"fixed-2"},"Fixed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"Allow more than 3 customLevel elements in scenarios (see xrechnung\nconfiguration ",(0,l.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator-configuration-xrechnung/issues/49"}," issue 49"),")"),(0,l.kt)("li",{parentName:"ul"},"Remove saxon signature from java8 uber-jar (see ",(0,l.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator/issues/67"},"67"),")")),(0,l.kt)("h2",{id:"140"},"1.4.0"),(0,l.kt)("h3",{id:"fixed-3"},"Fixed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"date conversion when\nusing ",(0,l.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator/blob/d7beb1040418ae5cbeb9427532fd87482f55756c/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java#L109"},"ConfigurationBuilder#date(Date)")),(0,l.kt)("li",{parentName:"ul"},"(CLI) ",(0,l.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator/issues/51"},"#51")," Suffix of report xml is missing"),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator/issues/53"},"#53")," Fix copyright and licensing information"),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator/issues/56"},"#56")," ",(0,l.kt)("inlineCode",{parentName:"li"},"namespace")," element content needs trimming"),(0,l.kt)("li",{parentName:"ul"},"[DAEMON][#57]","(",(0,l.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator/issues/57"},"https://github.com/itplr-kosit/validator/issues/57"),") Reading large inputs correctly")),(0,l.kt)("h3",{id:"added-1"},"Added"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"read saxon XdmNode with InputFactory"),(0,l.kt)("li",{parentName:"ul"},"(CLI) custom output without the various log messages"),(0,l.kt)("li",{parentName:"ul"},"(CLI) options to set the log level (",(0,l.kt)("inlineCode",{parentName:"li"},"-X")," = full debug output, ",(0,l.kt)("inlineCode",{parentName:"li"},"-l ")," set a specific level)"),(0,l.kt)("li",{parentName:"ul"},"(CLI) return code is not 0 on rejected results"),(0,l.kt)("li",{parentName:"ul"},"(CLI) read (single) test target from stdin"),(0,l.kt)("li",{parentName:"ul"},"[DAEMON]"," name inputs via request URI")),(0,l.kt)("h3",{id:"changed-1"},"Changed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"InputFactory has methods to read any java.xml.transform.Source as Input not only StreamSources"),(0,l.kt)("li",{parentName:"ul"},'InputFactory uses a generated UUID as name for SourceInput, if no "real" name can be derived'),(0,l.kt)("li",{parentName:"ul"},"saxon dependency update (minor, 9.9.1-7)"),(0,l.kt)("li",{parentName:"ul"},"[DAEMON]"," proper status codes when returning results (see ",(0,l.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator/blob/master/docs/daemon.md#status-codes"},"daemon documentation"),")")),(0,l.kt)("h2",{id:"131"},"1.3.1"),(0,l.kt)("h3",{id:"fixed-4"},"Fixed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("inlineCode",{parentName:"li"},"getFailedAsserts()")," and ",(0,l.kt)("inlineCode",{parentName:"li"},"isSchematronValid()"),"\nin ",(0,l.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/impl/DefaultResult.java"},"DefaultResult.java"),"\ndo not reflect actual schematron validation result"),(0,l.kt)("li",{parentName:"ul"},"processing aborts on schematron execution errors (e.g. errors within schematron logic). The validator now generates a\nreport in such cases."),(0,l.kt)("li",{parentName:"ul"},"exception while resolving when using XSLT's ",(0,l.kt)("inlineCode",{parentName:"li"},"unparsed-text()")," function within report generation")),(0,l.kt)("h3",{id:"added-2"},"Added"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"(CLI) summary report")),(0,l.kt)("h3",{id:"changed-2"},"Changed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"engine info contains version number of the validator (configurations can output this in the report for maintainance\npuposes)"),(0,l.kt)("li",{parentName:"ul"},"options to customize serialized report file names (cmdline only) via ",(0,l.kt)("inlineCode",{parentName:"li"},"--report-prefix")," and ",(0,l.kt)("inlineCode",{parentName:"li"},"--report-postfix")),(0,l.kt)("li",{parentName:"ul"},"remove unused dependency Apache Commons HTTP")),(0,l.kt)("h2",{id:"130"},"1.3.0"),(0,l.kt)("h3",{id:"added-3"},"Added"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"Added a builder style configuration API to configure scenarios"),(0,l.kt)("li",{parentName:"ul"},"Added an option to configure xml security e.g. to load from http sources or not from a specific repository\n(so loading is configurable less restrictive, default strategy is to only load from a local repository)"),(0,l.kt)("li",{parentName:"ul"},"Support java.xml.transform.Source as Input")),(0,l.kt)("h3",{id:"changed-3"},"Changed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"Inputs are NOT read into memory (e.g. Byte-Array) prior processing within the validator. This reduces memory\nconsumption."),(0,l.kt)("li",{parentName:"ul"},"Overall processing of xml files is based on Saxon s9api. No JAXP or SAX classes are used by\nthe validator (this further improves performance and memory consumption)")),(0,l.kt)("h3",{id:"deprecations"},"Deprecations"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"CheckConfiguration is deprecated now. Use Configuration.load(...) or Configuration.build(...)")),(0,l.kt)("h2",{id:"121"},"1.2.1"),(0,l.kt)("h3",{id:"fixed-5"},"Fixed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"Validator is creating invalid createReportInput xml in case of no scenario match")),(0,l.kt)("h2",{id:"120"},"1.2.0"),(0,l.kt)("h3",{id:"added-4"},"Added"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"Provide access to schematron result\nthrough ",(0,l.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator/blob/master/src/main/java/de/kosit/validationtool/api/Result.java"},"Result.java"),(0,l.kt)("ul",{parentName:"li"},(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("em",{parentName:"li"},"Result#getFailedAsserts()")," returns a list of failed asserts found by schematron"),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("em",{parentName:"li"},"Result#isSchematronValid()")," convinience access to evaluate whether schematron was processed without any ",(0,l.kt)("em",{parentName:"li"},"\nFailedAsserts"))))),(0,l.kt)("h3",{id:"changed-4"},"Changed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("em",{parentName:"li"},"Result#getAcceptRecommendation()")," does not ",(0,l.kt)("em",{parentName:"li"},"only")," work when ",(0,l.kt)("em",{parentName:"li"},"acceptMatch")," is configured in the scenario",(0,l.kt)("ul",{parentName:"li"},(0,l.kt)("li",{parentName:"ul"},"schema correctness is a precondition, if the checked instance is not valid, this evaluates to ",(0,l.kt)("em",{parentName:"li"},"REJECTED")),(0,l.kt)("li",{parentName:"ul"},"if ",(0,l.kt)("em",{parentName:"li"},"acceptMatch")," is configured, the result is based on the boolean result of the xpath expression evaluated against\nthe generated report"),(0,l.kt)("li",{parentName:"ul"},"if ",(0,l.kt)("em",{parentName:"li"},"no")," ",(0,l.kt)("em",{parentName:"li"},"acceptMatch")," is configured, the result is based on evaluation of schema and schematron correctness"),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("em",{parentName:"li"},"UNDEFINED")," is only returned, when processing is stopped somehow"))),(0,l.kt)("li",{parentName:"ul"},(0,l.kt)("em",{parentName:"li"},"Result#isAcceptable()")," can now evaluate to true, when no ",(0,l.kt)("em",{parentName:"li"},"acceptMatch")," is configured (see above)")),(0,l.kt)("h2",{id:"113"},"1.1.3"),(0,l.kt)("h3",{id:"fixed-6"},"Fixed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"XXE vulnerability when reading xml documents with Saxon ",(0,l.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator/issues/44"},"#44")),(0,l.kt)("li",{parentName:"ul"},"validator unintentionally stopped when schematron processing has errors.\nSee ",(0,l.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator/issues/41"},"#41"),".")),(0,l.kt)("h2",{id:"112"},"1.1.2"),(0,l.kt)("h3",{id:"fixed-7"},"Fixed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"NPE in Result.getReportDocument for malformed xml input")),(0,l.kt)("h2",{id:"111"},"1.1.1"),(0,l.kt)("h3",{id:"added-5"},"Added"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"Convenience method for accessing information about well-formedness in Result"),(0,l.kt)("li",{parentName:"ul"},"Convenience method for accessing information about schema validation result in Result")),(0,l.kt)("h3",{id:"fixed-8"},"Fixed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"NPE when validating non-XML files")),(0,l.kt)("h2",{id:"110"},"1.1.0"),(0,l.kt)("h3",{id:"added-6"},"Added"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"Enhanced API-Usage e.g. return ",(0,l.kt)("em",{parentName:"li"},"Result")," object with processing information"),(0,l.kt)("li",{parentName:"ul"},"Support loading scenarios and content from a JAR-File"),(0,l.kt)("li",{parentName:"ul"},"Simple Daemon-Mode exposing validation functionality via http"),(0,l.kt)("li",{parentName:"ul"},"cli option to serialize the 'report input' xml document to ",(0,l.kt)("em",{parentName:"li"},"cwd")," (current working directory)"),(0,l.kt)("li",{parentName:"ul"},"Documentation in ",(0,l.kt)("inlineCode",{parentName:"li"},"docs")," folder")),(0,l.kt)("h3",{id:"changed-5"},"Changed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"Use s9api (e.g. XdmNode) internally for loading and holding xml objects (further memory optimization)"),(0,l.kt)("li",{parentName:"ul"},"Builds with java 8 and >= 11"),(0,l.kt)("li",{parentName:"ul"},"Packages for java8 and java >= 11 (with jaxb included)"),(0,l.kt)("li",{parentName:"ul"},"Translated README.md")),(0,l.kt)("h2",{id:"102"},"1.0.2"),(0,l.kt)("h3",{id:"fixed-9"},"Fixed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"Memory issues when validating multiple targets")),(0,l.kt)("h2",{id:"101"},"1.0.1"),(0,l.kt)("h3",{id:"changed-6"},"Changed"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"Removed XRechnung configuration from release artifacts and source (moved\nto ",(0,l.kt)("a",{parentName:"li",href:"https://github.com/itplr-kosit/validator-configuration-xrechnung"},"own repository")," )")),(0,l.kt)("h2",{id:"100"},"1.0.0"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"Initial Release")))}p.isMDXComponent=!0}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/common.f13082de.js b/src/main/resources/ui/assets/js/common.f13082de.js
new file mode 100644
index 0000000..4416107
--- /dev/null
+++ b/src/main/resources/ui/assets/js/common.f13082de.js
@@ -0,0 +1 @@
+(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[592],{3905:function(e,t,n){"use strict";n.d(t,{Zo:function(){return u},kt:function(){return m}});var r=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var c=r.createContext({}),s=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=s(e.components);return r.createElement(c.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,a=e.originalType,c=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),d=s(n),m=o,f=d["".concat(c,".").concat(m)]||d[m]||p[m]||a;return n?r.createElement(f,i(i({ref:t},u),{},{components:n})):r.createElement(f,i({ref:t},u))}));function m(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var a=n.length,i=new Array(a);i[0]=d;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:o,i[1]=l;for(var s=2;sdocument.documentElement.dataset.theme||"light";var y=function(e){let{children:t,language:n="markup",enableCopy:c=!1,download:y}=e;const{siteConfig:v}=(0,i.Z)(),g=function(){const[e,t]=(0,o.useState)(f);return(0,o.useEffect)((()=>{const e=new MutationObserver((()=>{t(f())}));return e.observe(document.documentElement,{subtree:!1,attributeFilter:["data-theme"]}),()=>e.disconnect()})),e}(),h=v.themeConfig.prism.theme,b=v.themeConfig.prism.darkTheme,k="light"===g?h:b;return o.createElement("div",{className:p},o.createElement(a.ZP,(0,r.Z)({},a.lG,{code:t,language:n,theme:k}),(e=>{let{className:t,style:n,tokens:r,getLineProps:a,getTokenProps:i}=e;return o.createElement("pre",{className:(0,l.Z)(t,u),style:n},r.map(((e,t)=>o.createElement("div",a({line:e,key:t}),e.map(((e,t)=>o.createElement("span",i({token:e,key:t}))))))))})),(c||y)&&o.createElement("div",{className:d},c&&o.createElement("button",{className:m,type:"button","aria-label":"Copy content",title:"Copy content",onClick:async()=>{try{navigator.clipboard.writeText(t)}catch{}}},o.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor"},o.createElement("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}))),y&&o.createElement("button",{className:m,type:"button","aria-label":"Download content as file",title:"Download content as file",onClick:()=>{y&&y.fileName&&y.mime&&s()(t,y.fileName,y.mime)}},o.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor"},o.createElement("path",{d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"})))))}},7547:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(7294),o="errorDisplay_QTmW",a="title_GCFt";var i=function(e){let{title:t,children:n}=e;return r.createElement("div",{role:"alert",className:o},r.createElement("strong",{className:a},t),n)}},8222:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(7294),o=n(3285),a="headline_fEIe";var i=function(e){let{children:t,layoutDescription:n,description:i,title:l,headline:c}=e;return r.createElement(o.Z,{description:n,title:l},r.createElement("main",{className:"container padding-top--md padding-bottom--lg"},r.createElement("h1",{className:a},c),r.createElement("p",null,i),t))}},7506:function(e,t,n){"use strict";n.d(t,{e:function(){return a}});var r=n(7294),o=n(2263);let a;!function(e){e.Idle="idle",e.Loading="loading",e.Success="success",e.Failure="failure"}(a||(a={}));const i={status:a.Idle,data:null,error:null};t.Z=function(){var e;const[t,n]=(0,r.useState)(i),{siteConfig:l}=(0,o.Z)(),c=null==(e=l.customFields)?void 0:e.apiBase,s=(0,r.useRef)(!0);(0,r.useEffect)((()=>()=>{s.current=!1}),[]);const u=(0,r.useCallback)(((e,t)=>{n((e=>({...e,status:a.Loading}))),fetch(function(e,t){return`/${t.split("/").concat(e.split("/")).filter(Boolean).join("/")}`}(e,c),t).then((e=>e.text().then((t=>({data:t,ok:e.ok,code:e.status}))))).then((e=>{let{data:t,ok:r,code:o}=e;s.current&&n(r?{status:a.Success,data:t,error:null}:e=>({...e,status:a.Failure,error:{code:o,message:t}}))})).catch((e=>{s.current&&n((t=>({...t,status:a.Failure,error:{code:0,message:(null==e||null==e.toString?void 0:e.toString())||"An unknown error occurred"}})))}))}),[c]);return(0,r.useMemo)((()=>({...t,request:u})),[u,t])}},5823:function(e){e.exports=function(e,t,n,r){var o=new Blob(void 0!==r?[r,e]:[e],{type:n||"application/octet-stream"});if(void 0!==window.navigator.msSaveBlob)window.navigator.msSaveBlob(o,t);else{var a=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(o):window.webkitURL.createObjectURL(o),i=document.createElement("a");i.style.display="none",i.href=a,i.setAttribute("download",t),void 0===i.download&&i.setAttribute("target","_blank"),document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i),window.URL.revokeObjectURL(a)}),200)}}},3746:function(e,t,n){"use strict";n.d(t,{ZP:function(){return y},lG:function(){return i}});var r=n(7410),o={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},a=n(7294),i={Prism:r.Z,theme:o};function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(){return c=Object.assign||function(e){for(var t=1;t0&&e[n-1]===t?e:e.concat(t)},d=function(e,t){var n=e.plain,r=Object.create(null),o=e.styles.reduce((function(e,n){var r=n.languages,o=n.style;return r&&!r.includes(t)||n.types.forEach((function(t){var n=c({},e[t],o);e[t]=n})),e}),r);return o.root=n,o.plain=c({},n,{backgroundColor:null}),o};function m(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}var f=function(e){function t(){for(var t=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];e.apply(this,n),l(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var n=e.theme?d(e.theme,e.language):void 0;return t.themeDict=n})),l(this,"getLineProps",(function(e){var n=e.key,r=e.className,o=e.style,a=c({},m(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),i=t.getThemeDict(t.props);return void 0!==i&&(a.style=i.plain),void 0!==o&&(a.style=void 0!==a.style?c({},a.style,o):o),void 0!==n&&(a.key=n),r&&(a.className+=" "+r),a})),l(this,"getStyleForToken",(function(e){var n=e.types,r=e.empty,o=n.length,a=t.getThemeDict(t.props);if(void 0!==a){if(1===o&&"plain"===n[0])return r?{display:"inline-block"}:void 0;if(1===o&&!r)return a[n[0]];var i=r?{display:"inline-block"}:{},l=n.map((function(e){return a[e]}));return Object.assign.apply(Object,[i].concat(l))}})),l(this,"getTokenProps",(function(e){var n=e.key,r=e.className,o=e.style,a=e.token,i=c({},m(e,["key","className","style","token"]),{className:"token "+a.types.join(" "),children:a.content,style:t.getStyleForToken(a),key:void 0});return void 0!==o&&(i.style=void 0!==i.style?c({},i.style,o):o),void 0!==n&&(i.key=n),r&&(i.className+=" "+r),i})),l(this,"tokenize",(function(e,t,n,r){var o={code:t,grammar:n,language:r,tokens:[]};e.hooks.run("before-tokenize",o);var a=o.tokens=e.tokenize(o.code,o.grammar,o.language);return e.hooks.run("after-tokenize",o),a}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,n=e.language,r=e.code,o=e.children,a=this.getThemeDict(this.props),i=t.languages[n];return o({tokens:function(e){for(var t=[[]],n=[e],r=[0],o=[e.length],a=0,i=0,l=[],c=[l];i>-1;){for(;(a=r[i]++)0?m:["plain"],d=f):(m=p(m,f.type),f.alias&&(m=p(m,f.alias)),d=f.content),"string"==typeof d){var y=d.split(s),v=y.length;l.push({types:m,content:y[0]});for(var g=1;g{o(t,{headers:{"Content-Type":"application/xml"}})}),[t,o]),a.createElement(a.Fragment,null,c===i.e.Failure&&s&&a.createElement(l.Z,{title:"An error occurred while fetching"},a.createElement(r.Z,null,s.message)),c===i.e.Success&&u&&a.createElement(r.Z,{download:{fileName:n,mime:"application/xml"},enableCopy:!0},u))}},2406:function(e,t,n){n.r(t);var a=n(7294),r=n(8222),l=n(6275);t.default=function(){return a.createElement(r.Z,{title:"Health information",layoutDescription:"Health and status information about the system",headline:"Server health information",description:"Information about health and status of the running system."},a.createElement(l.Z,{endpoint:"/server/health",fileName:"health.xml"}))}}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/eae68ef6.43fba47a.js b/src/main/resources/ui/assets/js/eae68ef6.43fba47a.js
new file mode 100644
index 0000000..4d0cd54
--- /dev/null
+++ b/src/main/resources/ui/assets/js/eae68ef6.43fba47a.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[962,118],{6275:function(e,t,n){n.d(t,{Z:function(){return o}});var a=n(7294),r=n(5833),i=n(7547),l=n(7506);var o=function(e){let{endpoint:t,fileName:n}=e;const{request:o,data:c,error:u,status:d}=(0,l.Z)();return(0,a.useEffect)((()=>{o(t,{headers:{"Content-Type":"application/xml"}})}),[t,o]),a.createElement(a.Fragment,null,d===l.e.Failure&&u&&a.createElement(i.Z,{title:"An error occurred while fetching"},a.createElement(r.Z,null,u.message)),d===l.e.Success&&c&&a.createElement(r.Z,{download:{fileName:n,mime:"application/xml"},enableCopy:!0},c))}},3596:function(e,t,n){n.r(t);var a=n(7294),r=n(8222),i=n(6275);t.default=function(){return a.createElement(r.Z,{title:"Validator configuration",layoutDescription:"The currently loaded validator configuration",headline:"Validator configuration",description:"View the currently loaded validator configuration."},a.createElement(i.Z,{endpoint:"/server/config",fileName:"config.xml"}))}},2536:function(e,t,n){n.r(t);var a=n(3596);t.default=a.default}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/f9512c76.5069c08d.js b/src/main/resources/ui/assets/js/f9512c76.5069c08d.js
new file mode 100644
index 0000000..9148329
--- /dev/null
+++ b/src/main/resources/ui/assets/js/f9512c76.5069c08d.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[870],{5745:function(e){e.exports=JSON.parse('{"name":"docusaurus-plugin-content-pages","id":"default"}')}}]);
\ No newline at end of file
diff --git a/src/main/resources/ui/assets/js/main.3f408954.js b/src/main/resources/ui/assets/js/main.3f408954.js
new file mode 100644
index 0000000..3b515da
--- /dev/null
+++ b/src/main/resources/ui/assets/js/main.3f408954.js
@@ -0,0 +1,2 @@
+/*! For license information please see main.3f408954.js.LICENSE.txt */
+(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[179],{723:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(7294),a=n(7462),o=n(8356),i=n.n(o),l=n(6887),s={"01614a01":[()=>n.e(983).then(n.t.bind(n,3769,19)),"/mnt/c/Users/apenski/Developer/source/validator/server/ui/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json",3769],17896441:[()=>Promise.all([n.e(532),n.e(592),n.e(601),n.e(918)]).then(n.bind(n,3332)),"@theme/DocItem",3332],"1be78505":[()=>Promise.all([n.e(532),n.e(514)]).then(n.bind(n,9963)),"@theme/DocPage",9963],"1df93b7f":[()=>Promise.all([n.e(532),n.e(592),n.e(523),n.e(237)]).then(n.bind(n,8451)),"@site/src/pages/index.tsx",8451],"1f391b9e":[()=>Promise.all([n.e(532),n.e(592),n.e(601),n.e(85)]).then(n.bind(n,4247)),"@theme/MDXPage",4247],"393be207":[()=>Promise.all([n.e(592),n.e(414)]).then(n.bind(n,3123)),"@site/src/pages/markdown-page.md",3123],"5d7f3e2f":[()=>Promise.all([n.e(592),n.e(910)]).then(n.bind(n,809)),"@site/docs/configurations.md",809],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,6809)),"@generated/docusaurus.config",6809],"5fbc5cf1":[()=>Promise.all([n.e(592),n.e(207)]).then(n.bind(n,7480)),"@site/docs/api.md",7480],"779c529c":[()=>Promise.all([n.e(532),n.e(592),n.e(118)]).then(n.bind(n,3596)),"@site/src/pages/config/ConfigPage.tsx",3596],"798a5b56":[()=>Promise.all([n.e(532),n.e(592),n.e(433)]).then(n.bind(n,6411)),"@site/src/pages/health/index.ts",6411],"935f2afb":[()=>n.e(53).then(n.t.bind(n,1109,19)),"~docs/default/version-current-metadata-prop-751.json",1109],"9beb87c2":[()=>Promise.all([n.e(592),n.e(80)]).then(n.bind(n,1016)),"@site/docs/changelog.md",1016],e44a8e24:[()=>Promise.all([n.e(532),n.e(592),n.e(981)]).then(n.bind(n,2406)),"@site/src/pages/health/HealthPage.tsx",2406],eae68ef6:[()=>Promise.all([n.e(532),n.e(592),n.e(962)]).then(n.bind(n,2536)),"@site/src/pages/config/index.ts",2536],f9512c76:[()=>n.e(870).then(n.t.bind(n,5745,19)),"/mnt/c/Users/apenski/Developer/source/validator/server/ui/.docusaurus/docusaurus-plugin-content-pages/default/plugin-route-context-module-100.json",5745]};function u(e){let{error:t,retry:n,pastDelay:a}=e;return t?r.createElement("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"}},r.createElement("p",null,String(t)),r.createElement("div",null,r.createElement("button",{type:"button",onClick:n},"Retry"))):a?r.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"}},r.createElement("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb"},r.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2"},r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"8"},r.createElement("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"}))))):null}var c=n(9670),d=n(226);function f(e,t){if("*"===e)return i()({loading:u,loader:()=>n.e(972).then(n.bind(n,4972)),modules:["@theme/NotFound"],webpack:()=>[4972],render(e,t){const n=e.default;return r.createElement(d.z,{value:{plugin:{name:"native",id:"default"}}},r.createElement(n,t))}});const o=l[`${e}-${t}`],f={},p=[],m=[],h=(0,c.Z)(o);return Object.entries(h).forEach((e=>{let[t,n]=e;const r=s[n];r&&(f[t]=r[0],p.push(r[1]),m.push(r[2]))})),i().Map({loading:u,loader:f,modules:p,webpack:()=>m,render(t,n){const i=JSON.parse(JSON.stringify(o));Object.entries(t).forEach((t=>{let[n,r]=t;const a=r.default;if(!a)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof a&&"function"!=typeof a||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{a[e]=r[e]}));let o=i;const l=n.split(".");l.slice(0,-1).forEach((e=>{o=o[e]})),o[l[l.length-1]]=a}));const l=i.__comp;delete i.__comp;const s=i.__context;return delete i.__context,r.createElement(d.z,{value:s},r.createElement(l,(0,a.Z)({},i,n)))}})}var p=[{path:"/config/",component:f("/config/","ca7"),exact:!0},{path:"/config/ConfigPage",component:f("/config/ConfigPage","574"),exact:!0},{path:"/health/",component:f("/health/","97a"),exact:!0},{path:"/health/HealthPage",component:f("/health/HealthPage","bff"),exact:!0},{path:"/markdown-page",component:f("/markdown-page","c39"),exact:!0},{path:"/docs",component:f("/docs","578"),routes:[{path:"/docs/api",component:f("/docs/api","33a"),exact:!0,sidebar:"tutorialSidebar"},{path:"/docs/changelog",component:f("/docs/changelog","fe5"),exact:!0,sidebar:"tutorialSidebar"},{path:"/docs/configurations",component:f("/docs/configurations","d70"),exact:!0,sidebar:"tutorialSidebar"}]},{path:"/",component:f("/","d2a"),exact:!0},{path:"*",component:f("*")}]},8934:function(e,t,n){"use strict";n.d(t,{_:function(){return a},t:function(){return o}});var r=n(7294);const a=r.createContext(!1);function o(e){let{children:t}=e;const[n,o]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{o(!0)}),[]),r.createElement(a.Provider,{value:n},t)}},9383:function(e,t,n){"use strict";var r=n(7294),a=n(3935),o=n(3727),i=n(405),l=n(412),s=[n(2497),n(3310),n(8320),n(2295)],u=n(723),c=n(6550),d=n(8790);function f(e){let{children:t}=e;return r.createElement(r.Fragment,null,t)}var p=n(7462),m=n(5742),h=n(2263),g=n(4996),v=n(6668),b=n(1944),y=n(4711),w=n(9727),k=n(3320),E=n(197);function S(){const{i18n:{defaultLocale:e,localeConfigs:t}}=(0,h.Z)(),n=(0,y.l)();return r.createElement(m.Z,null,Object.entries(t).map((e=>{let[t,{htmlLang:a}]=e;return r.createElement("link",{key:t,rel:"alternate",href:n.createUrl({locale:t,fullyQualified:!0}),hrefLang:a})})),r.createElement("link",{rel:"alternate",href:n.createUrl({locale:e,fullyQualified:!0}),hrefLang:"x-default"}))}function x(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,h.Z)(),a=function(){const{siteConfig:{url:e}}=(0,h.Z)(),{pathname:t}=(0,c.TH)();return e+(0,g.Z)(t)}(),o=t?`${n}${t}`:a;return r.createElement(m.Z,null,r.createElement("meta",{property:"og:url",content:o}),r.createElement("link",{rel:"canonical",href:o}))}function C(){const{i18n:{currentLocale:e}}=(0,h.Z)(),{metadata:t,image:n}=(0,v.L)();return r.createElement(r.Fragment,null,r.createElement(m.Z,null,r.createElement("meta",{name:"twitter:card",content:"summary_large_image"}),r.createElement("body",{className:w.h})),n&&r.createElement(b.d,{image:n}),r.createElement(x,null),r.createElement(S,null),r.createElement(E.Z,{tag:k.HX,locale:e}),r.createElement(m.Z,null,t.map(((e,t)=>r.createElement("meta",(0,p.Z)({key:t},e))))))}const T=new Map;function _(e){if(T.has(e.pathname))return{...e,pathname:T.get(e.pathname)};if((0,d.f)(u.Z,e.pathname).some((e=>{let{route:t}=e;return!0===t.exact})))return T.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return T.set(e.pathname,t),{...e,pathname:t}}var A=n(8934),L=n(8940);function R(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{var r;const a=(null==(r=t.default)?void 0:r[e])??t[e];return null==a?void 0:a(...n)}));return()=>a.forEach((e=>null==e?void 0:e()))}var P=function(e){let{children:t,location:n,previousLocation:a}=e;return(0,r.useLayoutEffect)((()=>{a!==n&&(a&&function(e){const{hash:t}=e;if(t){const e=decodeURIComponent(t.substring(1)),n=document.getElementById(e);null==n||n.scrollIntoView()}else window.scrollTo(0,0)}(n),R("onRouteDidUpdate",{previousLocation:a,location:n}))}),[a,n]),t};function N(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,d.f)(u.Z,e))).flat();return Promise.all(t.map((e=>null==e.route.component.preload?void 0:e.route.component.preload())))}class O extends r.Component{constructor(e){super(e),this.previousLocation=void 0,this.routeUpdateCleanupCb=void 0,this.previousLocation=null,this.routeUpdateCleanupCb=l.Z.canUseDOM?R("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=R("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),N(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return r.createElement(P,{previousLocation:this.previousLocation,location:t},r.createElement(c.AW,{location:t,render:()=>e}))}}var D=O;const I="docusaurus-base-url-issue-banner-container",M="docusaurus-base-url-issue-banner-suggestion-container",F="__DOCUSAURUS_INSERT_BASEURL_BANNER";function B(e){return`\nwindow['${F}'] = true;\n\ndocument.addEventListener('DOMContentLoaded', maybeInsertBanner);\n\nfunction maybeInsertBanner() {\n var shouldInsert = window['${F}'];\n shouldInsert && insertBanner();\n}\n\nfunction insertBanner() {\n var bannerContainer = document.getElementById('${I}');\n if (!bannerContainer) {\n return;\n }\n var bannerHtml = ${JSON.stringify(function(e){return`\n