diff --git a/.gitignore b/.gitignore
index a70a722..8d2ff7e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@
# Log file
*.log
+.idea
#*.iml
# Package Files #
@@ -34,15 +35,9 @@ src/generated
.project
.classpath
.factorypath
-.idea/
-.settings/
+.settings
.vscode
*.code-workspace
*.xpr
# Testing stuff
xrechnung
-
-# Mac stuff
-.DS_Store
-andre*-simple.xml
-somePrefix*.xml
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 56e5cc7..5673d45 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,8 +3,7 @@ image: maven:latest
variables:
BUILD_PROPS: "-Dbuild.revision=$CI_COMMIT_SHA -Dbuild.branch=$CI_COMMIT_REF_NAME -Dbuild.number=$CI_PIPELINE_IID -Dfile.encoding=UTF-8 -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false"
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
- MAVEN_CLI_OPTS: " --batch-mode --update-snapshots --errors --fail-at-end --show-version -s .mvn/settings.xml"
- MAVEN_CLI_OPTS_CENTRAL: " --batch-mode --show-version -s .mvn/settings-maven-central.xml"
+ MAVEN_CLI_OPTS: " --batch-mode --errors --fail-at-end --show-version -s .mvn/settings.xml"
before_script:
- export CI_JOB_TIMESTAMP="-Dbuild.timestamp=$(date --utc --iso-8601=seconds)"
@@ -93,11 +92,6 @@ deploy:
- 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
-deploy-snapshot:
- extends: java-8
- script:
- - mvn $MAVEN_CLI_OPTS_CENTRAL -P release-snapshot deploy
-
create-build-image:
stage: deploy
image: docker:latest
diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml
new file mode 100644
index 0000000..ef7efd6
--- /dev/null
+++ b/.idea/checkstyle-idea.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..c09264f
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/copyright/KoSIT_Validator.xml b/.idea/copyright/KoSIT_Validator.xml
new file mode 100644
index 0000000..16895e8
--- /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/.idea/eclipseCodeFormatter.xml b/.idea/eclipseCodeFormatter.xml
new file mode 100644
index 0000000..a63598c
--- /dev/null
+++ b/.idea/eclipseCodeFormatter.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..893896a
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..4d7210a
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/saveactions_settings.xml b/.idea/saveactions_settings.xml
new file mode 100644
index 0000000..3b2acd8
--- /dev/null
+++ b/.idea/saveactions_settings.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.mvn/settings-maven-central.xml b/.mvn/settings-maven-central.xml
deleted file mode 100644
index 7fc46fe..0000000
--- a/.mvn/settings-maven-central.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- central
- ${MVN_CENTRAL_USER}
- ${MVN_CENTRAL_TOKEN}
-
-
-
diff --git a/.mvn/settings.xml b/.mvn/settings.xml
index 0b53a90..d1b2b61 100644
--- a/.mvn/settings.xml
+++ b/.mvn/settings.xml
@@ -1,6 +1,36 @@
-
+
+
+
+
gitlab-maven
diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..4b3eff9
--- /dev/null
+++ b/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,127 @@
+cleanup.add_default_serial_version_id=false
+cleanup.add_generated_serial_version_id=true
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_missing_override_annotations_interface_methods=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=true
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_functional_interfaces=false
+cleanup.convert_to_enhanced_for_loop=true
+cleanup.correct_indentation=false
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.insert_inferred_type_arguments=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=true
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=true
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_redundant_type_arguments=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_anonymous_class_creation=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_lambda=true
+cleanup.use_parentheses_in_expressions=true
+cleanup.use_this_for_non_static_field_access=true
+cleanup.use_this_for_non_static_field_access_only_if_necessary=false
+cleanup.use_this_for_non_static_method_access=true
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup.use_type_arguments=false
+cleanup_profile=_initCleanUpProfile
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_init
+formatter_settings_version=23
+org.eclipse.jdt.ui.ignorelowercasenames=true
+org.eclipse.jdt.ui.importorder=java;javax;org;com;lombok;de;
+org.eclipse.jdt.ui.javadoc=true
+org.eclipse.jdt.ui.ondemandthreshold=99
+org.eclipse.jdt.ui.staticondemandthreshold=99
+org.eclipse.jdt.ui.text.custom_code_templates=/**\r\n * The ${bare_field_name} of this {@link ${enclosing_type}}.\r\n * \r\n * @return the ${bare_field_name}\r\n *//**\r\n * Sets the ${bare_field_name} of this {@link ${enclosing_type}}.\r\n *\r\n * @param ${param} the new ${bare_field_name} to set\r\n *//**\r\n * Creates a new instance of {@link ${enclosing_type}}.\r\n * ${tags}\r\n *//**\r\n * ${todo} Describe this class\r\n *\r\n * @author ${user}\r\n * ${tags}\r\n *//**\r\n * ${todo} Describe this method\r\n * ${tags}\r\n *//**\r\n * ${todo} Describe why this method is overridden.\r\n *//**\r\n * ${tags}\r\n * ${see_to_target}\r\n */${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}\r\n\r\n\r\n\r\n// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();// ${todo} Auto-generated method stub\r\n${body_statement}${body_statement}\r\n// ${todo} Auto-generated constructor stubreturn ${field};${field} \= ${param};
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=true
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=true
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=true
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=true
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=false
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=false
+sp_cleanup.use_parentheses_in_expressions=true
+sp_cleanup.use_this_for_non_static_field_access=true
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false
+sp_cleanup.use_this_for_non_static_method_access=true
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/.settings/settings.xml b/.settings/settings.xml
new file mode 100644
index 0000000..d1b2b61
--- /dev/null
+++ b/.settings/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 7214bfe..2690237 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,10 +21,10 @@
KoSIT XML Prüftool Implementierung
- org.kosit
+ de.kosit
+ 1.5.1
+
validationtool
- 1.5.1-SNAPSHOT
-
KoSIT XML Validator against XSD and Schematron based on defined scenarios.
@@ -67,25 +67,12 @@
12.8
2.0.17
-
project.local
project
file:${project.basedir}/libs
-
-
- Central Portal Snapshots
- central-portal-snapshots
- https://central.sonatype.com/repository/maven-snapshots/
-
- false
-
-
- true
-
-
@@ -185,26 +172,6 @@
true
-
-
-
-
- org.sonatype.central
- central-publishing-maven-plugin
- 0.8.0
- true
-
- central
- true
-
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
- 3.2.8
-
-
-
@@ -623,6 +590,7 @@
org.apache.maven.plugins
maven-gpg-plugin
+ 3.2.8
sign-artifacts
@@ -692,17 +660,6 @@
-
- release-snapshot
-
-
-
- org.sonatype.central
- central-publishing-maven-plugin
-
-
-
-
@@ -712,14 +669,12 @@
- scm:git:https://github.com/itplr-kosit/validator.git
+ https://github.com/itplr-kosit/validationtool.git
scm:git:https://projekte.kosit.org/kosit/validator.git
- release/1.5.x
+ v1.1.0
https://github.com/itplr-kosit/validator
-
https://github.com/itplr-kosit/validator
-
Apache License, Version 2.0
@@ -727,4 +682,12 @@
repo
+
+
+ sonatype-nexus-staging
+ Nexus Release Repository
+ https://oss.sonatype.org/service/local/staging/deploy/maven2
+
+
+
diff --git a/src/main/java/de/kosit/validationtool/impl/Scenario.java b/src/main/java/de/kosit/validationtool/impl/Scenario.java
index d92768a..23deb7d 100644
--- a/src/main/java/de/kosit/validationtool/impl/Scenario.java
+++ b/src/main/java/de/kosit/validationtool/impl/Scenario.java
@@ -16,20 +16,22 @@
package de.kosit.validationtool.impl;
-import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Optional;
import javax.xml.transform.URIResolver;
import javax.xml.validation.Schema;
-import de.kosit.validationtool.api.ResolvingConfigurationStrategy;
-import de.kosit.validationtool.model.scenarios.ResourceType;
-import de.kosit.validationtool.model.scenarios.ScenarioType;
import lombok.AllArgsConstructor;
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;
@@ -78,11 +80,7 @@ public class Scenario {
private Transformation reportTransformation;
public List getSchematronValidations() {
- // Must return a mutable list
- if (this.schematronValidations == null) {
- this.schematronValidations = new ArrayList<>();
- }
- return this.schematronValidations;
+ return this.schematronValidations == null ? Collections.emptyList() : this.schematronValidations;
}
public String getName() {
@@ -97,9 +95,9 @@ public class Scenario {
}
/**
- * Returns a new XPath selector for evaluating the {@link de.kosit.validationtool.api.AcceptRecommendation}.
+ * Liefert einen neuen XPath-Selector zur Evaluierung der {@link de.kosit.validationtool.api.AcceptRecommendation}.
*
- * @return new selector
+ * @return neuer Selector
*/
public Optional getAcceptSelector() {
final XPathSelector selector = this.acceptExecutable != null ? this.acceptExecutable.load() : null;
diff --git a/src/test/java/de/kosit/validationtool/config/ScenarioBuilderTest.java b/src/test/java/de/kosit/validationtool/config/ScenarioBuilderTest.java
index f9f5590..42f2f58 100644
--- a/src/test/java/de/kosit/validationtool/config/ScenarioBuilderTest.java
+++ b/src/test/java/de/kosit/validationtool/config/ScenarioBuilderTest.java
@@ -34,6 +34,7 @@ import de.kosit.validationtool.impl.Scenario;
import de.kosit.validationtool.impl.model.Result;
import de.kosit.validationtool.model.scenarios.NamespaceType;
import de.kosit.validationtool.model.scenarios.ScenarioType;
+
import net.sf.saxon.s9api.XPathExecutable;
/**
@@ -139,25 +140,6 @@ public class ScenarioBuilderTest {
assertThat(configuration.getNamespace()).isEmpty();
}
- @Test
- public void testConfigureWithSchematron() {
- final ContentRepository repository = Simple.createContentRepository();
- final XPathExecutable match = repository.createXPath("//*", null);
- final XPathExecutable accept = repository.createXPath("//*", null);
- final ScenarioBuilder builder = createScenario();
- builder.getNamespaces().clear();
-
- builder.match(match);
- builder.acceptWith(accept);
- final Result result = builder.build(repository);
- assertThat(result.isValid()).isTrue();
- final ScenarioType configuration = result.getObject().getConfiguration();
- assertThat(configuration.getMatch()).isNotEmpty();
- assertThat(configuration.getAcceptMatch()).isNotEmpty();
- assertThat(configuration.getNamespace()).isEmpty();
- assertThat(configuration.getValidateWithSchematron()).isNotEmpty();
- }
-
@Test
public void testBasicAttributes() {
final ContentRepository repository = Simple.createContentRepository();
diff --git a/src/test/java/de/kosit/validationtool/config/TestConfigurationFactory.java b/src/test/java/de/kosit/validationtool/config/TestConfigurationFactory.java
index 0daacf7..79ec407 100644
--- a/src/test/java/de/kosit/validationtool/config/TestConfigurationFactory.java
+++ b/src/test/java/de/kosit/validationtool/config/TestConfigurationFactory.java
@@ -20,7 +20,6 @@ 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 static de.kosit.validationtool.config.ConfigurationBuilder.schematron;
import java.net.URI;
import java.util.Date;
@@ -47,7 +46,6 @@ public class TestConfigurationFactory {
public static ScenarioBuilder createScenario() {
return scenario("simple").validate(schema("Sample Schema").schemaLocation(URI.create("simple.xsd")))
- .validate(schematron("Sample Schematron").source(Simple.SCHEMATRON))
.with(report("Report für eRechnung").source("report.xsl")).acceptWith("count(//test:rejected) = 0")
.declareNamespace("cri", "http://www.xoev.de/de/validator/framework/1/createreportinput")
.declareNamespace("rpt", "http://validator.kosit.de/test-report")
diff --git a/src/test/java/de/kosit/validationtool/impl/Helper.java b/src/test/java/de/kosit/validationtool/impl/Helper.java
index 4562fb6..334791c 100644
--- a/src/test/java/de/kosit/validationtool/impl/Helper.java
+++ b/src/test/java/de/kosit/validationtool/impl/Helper.java
@@ -32,6 +32,7 @@ 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;
import net.sf.saxon.s9api.SaxonApiException;
import net.sf.saxon.s9api.Serializer;
@@ -83,8 +84,6 @@ public class Helper {
public static final URI SCHEMA = REPOSITORY_URI.resolve("simple.xsd");
- public static final URI SCHEMATRON = REPOSITORY_URI.resolve("simple-schematron-error.xsl");
-
public static final ContentRepository createContentRepository() {
final ResolvingConfigurationStrategy strategy = ResolvingMode.STRICT_RELATIVE.getStrategy();
return new ContentRepository(Helper.getTestProcessor(), strategy, Simple.REPOSITORY_URI);