diff --git a/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java b/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java index 64b75f1..d47ebd6 100644 --- a/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java +++ b/src/main/java/de/kosit/validationtool/api/CheckConfiguration.java @@ -29,7 +29,7 @@ import java.util.List; import java.util.Map; /** - * Zentrale Konfigration einer Prüf-Instanz. + * Zentrale Konfiguration einer Prüf-Instanz. * * @author Andreas Penski * @deprecated since 1.3.0 use {@link Configuration} instead. Will be removed in 2.0 @@ -42,7 +42,7 @@ import java.util.Map; public class CheckConfiguration implements Configuration { /** - * URL, die auf die scenerio.xml Datei zeigt. + * URL, die auf die scenario.xml Datei zeigt. */ private final URI scenarioDefinition; diff --git a/src/main/java/de/kosit/validationtool/api/Configuration.java b/src/main/java/de/kosit/validationtool/api/Configuration.java index 0512235..27f8bea 100644 --- a/src/main/java/de/kosit/validationtool/api/Configuration.java +++ b/src/main/java/de/kosit/validationtool/api/Configuration.java @@ -35,7 +35,7 @@ import java.util.Map; * {@link Check} * *

- * Both methods can be used via convinience methods. See below. + * Both methods can be used via convenience methods. See below. * * @author Andreas Penski */ diff --git a/src/main/java/de/kosit/validationtool/api/Input.java b/src/main/java/de/kosit/validationtool/api/Input.java index 7b3f598..f1060b4 100644 --- a/src/main/java/de/kosit/validationtool/api/Input.java +++ b/src/main/java/de/kosit/validationtool/api/Input.java @@ -44,7 +44,7 @@ public interface Input { /** * The digest algorithm used for computing the {@link #getHashCode()} * - * @return the name of the digest algorith + * @return the name of the digest algorithm */ String getDigestAlgorithm(); diff --git a/src/main/java/de/kosit/validationtool/api/InputFactory.java b/src/main/java/de/kosit/validationtool/api/InputFactory.java index dfb7bb5..524b388 100644 --- a/src/main/java/de/kosit/validationtool/api/InputFactory.java +++ b/src/main/java/de/kosit/validationtool/api/InputFactory.java @@ -50,10 +50,10 @@ import static org.apache.commons.lang3.StringUtils.isNotEmpty; @Slf4j public class InputFactory { - static final String DEFAULT_ALGORITH = "SHA-256"; + static final String DEFAULT_ALGORITHM = "SHA-256"; /** - * Pseudo hashcode algorithm name, which indicates, thate the hashcode of the {@link Input} is actually the name. + * Pseudo hashcode algorithm name, which indicates that the hashcode of the {@link Input} is actually the name. */ static final String PSEUDO_NAME_ALGORITHM = "NAME"; @@ -66,7 +66,7 @@ public class InputFactory { } InputFactory(final String specifiedAlgorithm) { - this.algorithm = isNotEmpty(specifiedAlgorithm) ? specifiedAlgorithm : DEFAULT_ALGORITH; + this.algorithm = isNotEmpty(specifiedAlgorithm) ? specifiedAlgorithm : DEFAULT_ALGORITHM; // check validity StreamHelper.createDigest(this.algorithm); } @@ -79,11 +79,11 @@ public class InputFactory { * @return ein Prüf-Eingabe-Objekt */ public static Input read(final Path path) { - return read(path, DEFAULT_ALGORITH); + return read(path, DEFAULT_ALGORITHM); } /** - * 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 path der Prüflings @@ -103,7 +103,7 @@ public class InputFactory { * @return ein Prüf-Eingabe-Objekt */ public static Input read(final File file) { - return read(file, DEFAULT_ALGORITH); + return read(file, DEFAULT_ALGORITHM); } /** @@ -114,11 +114,11 @@ public class InputFactory { * @return ein Prüf-Eingabe-Objekt */ public static Input read(final URI uri) { - return read(uri, DEFAULT_ALGORITH); + return read(uri, DEFAULT_ALGORITHM); } /** - * 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 uri URI des Prüflings @@ -141,7 +141,7 @@ public class InputFactory { * @return ein Prüf-Eingabe-Objekt */ public static Input read(final URL url) { - return read(url, DEFAULT_ALGORITH); + return read(url, DEFAULT_ALGORITHM); } /** @@ -175,7 +175,7 @@ public class InputFactory { */ public static Input read(final Source source) { if (source instanceof StreamSource) { - return read(source, source.getSystemId(), DEFAULT_ALGORITH); + return read(source, source.getSystemId(), DEFAULT_ALGORITHM); } final String name = UUID.randomUUID().toString(); return read(source, name, PSEUDO_NAME_ALGORITHM, name.getBytes()); @@ -219,7 +219,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 file der Prüflings @@ -237,7 +237,7 @@ public class InputFactory { } /** - * Liest einen Prüfling von der übergebenen byte-Sequenz. Es wird ein definierter Algorithmis zur Ermittlung der + * Liest einen Prüfling von der übergebenen byte-Sequenz. Es wird ein definierter Algorithmus zur Ermittlung der * Prüfsumme genutzt. * * @param input URL des Prüflings @@ -245,11 +245,11 @@ public class InputFactory { */ public static Input read(final byte[] input, final String name) { checkNull(input); - return read(input, name, DEFAULT_ALGORITH); + return read(input, name, DEFAULT_ALGORITHM); } /** - * Liest einen Prüfling von der übergebenen byte-Sequenz. Es wird ein definierter Algorithmis zur Ermittlung der + * Liest einen Prüfling von der übergebenen byte-Sequenz. Es wird ein definierter Algorithmus zur Ermittlung der * Prüfsumme genutzt. * * @param input URL des Prüflings @@ -282,7 +282,7 @@ public class InputFactory { * @return einen Prüfling in eingelesener Form */ public static Input read(final InputStream inputStream, final String name) { - return read(inputStream, name, DEFAULT_ALGORITH); + return read(inputStream, name, DEFAULT_ALGORITHM); } /** diff --git a/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java b/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java index f9404d9..4fec836 100644 --- a/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java +++ b/src/main/java/de/kosit/validationtool/api/ResolvingConfigurationStrategy.java @@ -31,8 +31,8 @@ import java.net.URI; * The KoSIT Validator provides out of the box implementations with various security levels based on openjdk SAX stack. *

* If you decide to implement a custom strategy, please be aware of XML security within your stack. The validator - * components beyond this strategy asume secured implementation of the interfaces provided by this strategy. There is no - * effort to mitigate or prevent xml related security issues such as XXE, loading external sources etc. Your would be + * components beyond this strategy assume secured implementation of the interfaces provided by this strategy. There is + * no effort to mitigate or prevent xml related security issues such as XXE, loading external sources etc. Your would be * responsible for this! * * @see de.kosit.validationtool.impl.ResolvingMode diff --git a/src/main/java/de/kosit/validationtool/api/Result.java b/src/main/java/de/kosit/validationtool/api/Result.java index 0aff251..077036e 100644 --- a/src/main/java/de/kosit/validationtool/api/Result.java +++ b/src/main/java/de/kosit/validationtool/api/Result.java @@ -104,7 +104,7 @@ public interface Result { * * @return true wenn well-formed */ - boolean isWellformed(); + boolean isWellFormed(); /** * Returns true, if schematron has been checked and the result does not contain any {@link FailedAssert diff --git a/src/main/java/de/kosit/validationtool/api/XmlError.java b/src/main/java/de/kosit/validationtool/api/XmlError.java index 47dfb81..706f155 100644 --- a/src/main/java/de/kosit/validationtool/api/XmlError.java +++ b/src/main/java/de/kosit/validationtool/api/XmlError.java @@ -17,7 +17,7 @@ package de.kosit.validationtool.api; /** - * Fehlerobjekt für die Bereitstellung von Fehlern aus der internen Verarbeitung, bspw. Schema-Validation-Fehler. + * Fehlerobjekt für die Bereitstellung von Fehlern aus der internen Verarbeitung, z.B. Schema-Validation-Fehler. * * @author Andreas Penski */ @@ -42,7 +42,7 @@ public interface XmlError { /** * Gibt optional eine Zeilennummer an, aus der der Fehler resultiert. * - * @return die Zeitelnnummer + * @return die Zeilennummer */ Integer getRowNumber(); diff --git a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java index fd84c4c..8db6aa1 100644 --- a/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java +++ b/src/main/java/de/kosit/validationtool/cmd/CommandLineApplication.java @@ -52,7 +52,7 @@ public class CommandLineApplication { final ReturnValue resultStatus = mainProgram(args); if (!resultStatus.equals(ReturnValue.DAEMON_MODE)) { if (!resultStatus.equals(ReturnValue.HELP_REQUEST) && resultStatus.getCode() >= 0) { - sayGoodby(resultStatus); + sayGoodbye(resultStatus); } System.exit(resultStatus.getCode()); } else { @@ -60,7 +60,7 @@ public class CommandLineApplication { } } - private static void sayGoodby(final ReturnValue resultStatus) { + private static void sayGoodbye(final ReturnValue resultStatus) { Printer.writeOut("\n##############################"); if (resultStatus.equals(ReturnValue.SUCCESS)) { Printer.writeOut("# " + new Line(Code.GREEN).add("Validation successful!").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 b0c068c..8561ec3 100644 --- a/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java +++ b/src/main/java/de/kosit/validationtool/cmd/InternalCheck.java @@ -84,11 +84,11 @@ class InternalCheck extends DefaultCheck { 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(), textcolor); - grid.addCell(value.isSchemaValid() ? "Y" : "N", textcolor); - grid.addCell(value.isSchematronValid() ? "Y" : "N", textcolor); - grid.addCell(value.getAcceptRecommendation(), textcolor); + final Code textColor = value.isAcceptable() ? Code.GREEN : Code.RED; + grid.addCell(e.getKey(), textColor); + grid.addCell(value.isSchemaValid() ? "Y" : "N", textColor); + grid.addCell(value.isSchematronValid() ? "Y" : "N", textColor); + grid.addCell(value.getAcceptRecommendation(), textColor); grid.addCell(joinErrors(value)); }); return grid; diff --git a/src/main/java/de/kosit/validationtool/cmd/TypeConverter.java b/src/main/java/de/kosit/validationtool/cmd/TypeConverter.java index 3210d58..1ad8f99 100644 --- a/src/main/java/de/kosit/validationtool/cmd/TypeConverter.java +++ b/src/main/java/de/kosit/validationtool/cmd/TypeConverter.java @@ -45,15 +45,15 @@ class TypeConverter { private static T convert(final Class type, final String value) { final T def; - final String[] splitted = defaultIfBlank(value, "").split("="); - if (splitted.length == 1) { + final String[] items = defaultIfBlank(value, "").split("="); + if (items.length == 1) { def = createNewInstance(type); def.setName(getDefaultName(type)); - def.setPath(Paths.get(splitted[0].trim())); - } else if (splitted.length == 2) { + def.setPath(Paths.get(items[0].trim())); + } else if (items.length == 2) { def = createNewInstance(type); - def.setName(splitted[0].trim()); - def.setPath(Paths.get(splitted[1].trim())); + def.setName(items[0].trim()); + def.setPath(Paths.get(items[1].trim())); } else { throw new IllegalArgumentException("Not a valid repository specification " + value); } diff --git a/src/main/java/de/kosit/validationtool/cmd/Validator.java b/src/main/java/de/kosit/validationtool/cmd/Validator.java index abd9f32..9c8c992 100644 --- a/src/main/java/de/kosit/validationtool/cmd/Validator.java +++ b/src/main/java/de/kosit/validationtool/cmd/Validator.java @@ -56,7 +56,7 @@ import static org.apache.commons.lang3.StringUtils.EMPTY; import static org.apache.commons.lang3.StringUtils.isNotEmpty; /** - * Actual evaluation and processing of CommandLineOptions argumtens. + * Actual evaluation and processing of CommandLineOptions arguments. * * @author Andreas Penski */ @@ -184,7 +184,7 @@ public class Validator { checkUnused(mappedScenarios, mappedRepos); return mappedScenarios.entrySet().stream().map(e -> { - assertFileExistance(e.getValue(), "scenario"); + assertFileExistence(e.getValue(), "scenario"); final URI scenarioLocation = e.getValue().toUri(); final URI repositoryLocation = findRepository(e.getKey(), mappedRepos); @@ -321,7 +321,7 @@ public class Validator { } @SuppressWarnings("SameParameterValue") - private static void assertFileExistance(final Path f, final String type) { + private static void assertFileExistence(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())); diff --git a/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java b/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java index 4fcceba..0dfc1bc 100644 --- a/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java +++ b/src/main/java/de/kosit/validationtool/config/ConfigurationBuilder.java @@ -151,7 +151,7 @@ public class ConfigurationBuilder { /** * Adds a description to this configuration. * - * @param description the descriptioin + * @param description the description * @return this */ public ConfigurationBuilder description(final String description) { @@ -262,7 +262,7 @@ public class ConfigurationBuilder { } /** - * Builds the actual {@link Configuration} by validating all builder inputs and constructing neccessary objects. + * Builds the actual {@link Configuration} by validating all builder inputs and constructing necessary objects. * * @return a valid configuration * @throws IllegalStateException when the configuration is not valid/complete diff --git a/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java b/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java index 151299f..4ccdeb6 100644 --- a/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java +++ b/src/main/java/de/kosit/validationtool/config/ConfigurationLoader.java @@ -69,7 +69,7 @@ public class ConfigurationLoader { protected final Map parameters = new HashMap<>(); /** - * URL, die auf die scenerio.xml Datei zeigt. + * URL, die auf die scenario.xml Datei zeigt. */ @Getter(AccessLevel.PACKAGE) private final URI scenarioDefinition; @@ -115,8 +115,8 @@ public class ConfigurationLoader { } private static Scenario createFallback(final Scenarios scenarios, final ContentRepository repository) { - final ResourceType noscenarioResource = scenarios.getNoScenarioReport().getResource(); - return new FallbackBuilder().source(noscenarioResource.getLocation()).name(noscenarioResource.getName()).build(repository) + final ResourceType noScenarioResource = scenarios.getNoScenarioReport().getResource(); + return new FallbackBuilder().source(noScenarioResource.getLocation()).name(noScenarioResource.getName()).build(repository) .getObject(); } @@ -140,7 +140,7 @@ public class ConfigurationLoader { s.setUriResolver(repository.getResolver()); s.setUnparsedTextURIResolver(repository.getUnparsedTextURIResolver()); if (def.getAcceptMatch() != null) { - s.setAcceptExecutable(repository.createAccepptExecutable(def)); + s.setAcceptExecutable(repository.createAcceptExecutable(def)); } return s; } diff --git a/src/main/java/de/kosit/validationtool/config/FallbackBuilder.java b/src/main/java/de/kosit/validationtool/config/FallbackBuilder.java index f616dc6..9595917 100644 --- a/src/main/java/de/kosit/validationtool/config/FallbackBuilder.java +++ b/src/main/java/de/kosit/validationtool/config/FallbackBuilder.java @@ -66,8 +66,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. + * Specifies a source for this report. This is either used to compile the report transformation or as documentation + * for a precompiled transformation. * * @param source the source * @return this @@ -78,8 +78,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. + * Specifies a source for this report. This is either used to compile the report transformation or as documentation + * for a precompiled transformation. * * @param source the source * @return this @@ -91,8 +91,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. + * Specifies a source for this report. This is either used to compile the report transformation or as documentation + * for a precompiled transformation. * * @param source the source * @return this diff --git a/src/main/java/de/kosit/validationtool/config/ReportBuilder.java b/src/main/java/de/kosit/validationtool/config/ReportBuilder.java index 6901173..d6e92ed 100644 --- a/src/main/java/de/kosit/validationtool/config/ReportBuilder.java +++ b/src/main/java/de/kosit/validationtool/config/ReportBuilder.java @@ -83,8 +83,8 @@ public class ReportBuilder implements Builder { /** * Add a xpath expression to compute acceptance for the scenario. You can leverage declared namespaces. * - * @param acceptXpath the xpath expresison + * @param acceptXpath the xpath expression * @return this */ public ScenarioBuilder acceptWith(final String acceptXpath) { diff --git a/src/main/java/de/kosit/validationtool/config/SchemaBuilder.java b/src/main/java/de/kosit/validationtool/config/SchemaBuilder.java index 4cff609..4894bb2 100644 --- a/src/main/java/de/kosit/validationtool/config/SchemaBuilder.java +++ b/src/main/java/de/kosit/validationtool/config/SchemaBuilder.java @@ -70,7 +70,7 @@ public class SchemaBuilder implements Builder path.toUpperCase().endsWith("." + e.name())).findFirst().orElse(Mediatype.MD); + static MediaType resolveBySuffix(final String path) { + 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/CollectingErrorEventHandler.java b/src/main/java/de/kosit/validationtool/impl/CollectingErrorEventHandler.java index afffbe8..32d0001 100644 --- a/src/main/java/de/kosit/validationtool/impl/CollectingErrorEventHandler.java +++ b/src/main/java/de/kosit/validationtool/impl/CollectingErrorEventHandler.java @@ -102,7 +102,7 @@ public class CollectingErrorEventHandler implements ValidationEventHandler, Erro } /** - * Zeigt an, ob es Validierungs-Ereignisse gab. + * Zeigt an, ob es Validierungsereignisse gab. * * @return true, wenn mindestens ein Validierungsereignis aufgetreten ist */ diff --git a/src/main/java/de/kosit/validationtool/impl/ContentRepository.java b/src/main/java/de/kosit/validationtool/impl/ContentRepository.java index 351ca7b..4aa2e63 100644 --- a/src/main/java/de/kosit/validationtool/impl/ContentRepository.java +++ b/src/main/java/de/kosit/validationtool/impl/ContentRepository.java @@ -55,7 +55,7 @@ import java.util.Map; import java.util.stream.Collectors; /** - * Repository für verschiedene XML Artefakte zur Vearbeitung der Prüfszenarien. + * Repository für verschiedene XML Artefakte zur Verarbeitung der Prüfszenarien. * * @author Andreas Penski */ @@ -163,7 +163,7 @@ public class ContentRepository { } /** - * Erzeugt ein Schema auf Basis der übegebenen URIs + * Erzeugt ein Schema auf Basis der übergebenen URIs * * @param uris die uris in String-Repräsentation * @return das Schema @@ -243,7 +243,7 @@ public class ContentRepository { return createXPath(s.getMatch(), namespaces); } - public XPathExecutable createAccepptExecutable(final ScenarioType s) { + public XPathExecutable createAcceptExecutable(final ScenarioType s) { final Map namespaces = s.getNamespace().stream() .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/ConversionService.java b/src/main/java/de/kosit/validationtool/impl/ConversionService.java index 787e6e5..dc48915 100644 --- a/src/main/java/de/kosit/validationtool/impl/ConversionService.java +++ b/src/main/java/de/kosit/validationtool/impl/ConversionService.java @@ -122,7 +122,7 @@ public class ConversionService { } /** - * Initialisiert den conversion service mit den angegegebenen Packages. + * Initialisiert den conversion service mit den angegebenen Packages. * * @param context packages für den JAXB Kontext */ @@ -134,7 +134,7 @@ public class ConversionService { } /** - * Initialsiert den conversion service mit dem angegebenen Kontextpfad + * Initialisiert den conversion service mit dem angegebenen Kontextpfad * * @param contextPath der Kontextpfad */ diff --git a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java index 3556723..c6c18ef 100644 --- a/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java +++ b/src/main/java/de/kosit/validationtool/impl/DefaultCheck.java @@ -50,8 +50,8 @@ import java.util.stream.Collectors; import static de.kosit.validationtool.impl.DateFactory.createTimestamp; /** - * The reference implementation for the validation process. After initialisation, instances are threadsafe and should be - * reused since initializing saxon runtime objects is a rather heavyweight process. + * The reference implementation for the validation process. After initialisation, instances are thread safe and should + * be reused since initializing saxon runtime objects is a rather heavyweight process. * * @author Andreas Penski */ @@ -129,7 +129,7 @@ public class DefaultCheck implements Check { private Result createResult(final Bag t) { final DefaultResult result = new DefaultResult(t.getReport(), t.getAcceptStatus(), new HtmlExtractor(this.processor)); - result.setWellformed(t.getParserResult().isValid()); + result.setWellFormed(t.getParserResult().isValid()); result.setReportInput(t.getReportInput()); if (t.getSchemaValidationResult() != null) { result.setSchemaViolations(convertErrors(t.getSchemaValidationResult().getErrors())); diff --git a/src/main/java/de/kosit/validationtool/impl/DefaultResult.java b/src/main/java/de/kosit/validationtool/impl/DefaultResult.java index a18d9a2..ef9ea4d 100644 --- a/src/main/java/de/kosit/validationtool/impl/DefaultResult.java +++ b/src/main/java/de/kosit/validationtool/impl/DefaultResult.java @@ -70,7 +70,7 @@ public class DefaultResult implements Result { @Getter @Setter - private boolean wellformed; + private boolean wellFormed; public DefaultResult(final XdmNode report, final AcceptRecommendation recommendation, final HtmlExtractor htmlExtractor) { this.report = report; @@ -109,7 +109,7 @@ public class DefaultResult implements Result { } /** - * Extrahiert evtl. im Report vorhandene HTML-Fragmente als String. + * Extrahiert eventuell im Report vorhandene HTML-Fragmente als String. * * @return Liste mit HTML Strings. */ @@ -118,7 +118,7 @@ public class DefaultResult implements Result { } /** - * Extrahiert evtl. im Report vorhandene HTML-Fragmente. + * Extrahiert eventuell im Report vorhandene HTML-Fragmente. * * @return Liste mit HTML Nodes. */ @@ -127,7 +127,7 @@ public class DefaultResult implements Result { } /** - * Extrahiert evtl. im Report vorhandene HTML-Fragmente als {@link Element}. + * Extrahiert eventuell im Report vorhandene HTML-Fragmente als {@link Element}. * * @return Liste mit HTML Elementen. */ diff --git a/src/main/java/de/kosit/validationtool/impl/EngineInformation.java b/src/main/java/de/kosit/validationtool/impl/EngineInformation.java index ab323e5..a4d5fef 100644 --- a/src/main/java/de/kosit/validationtool/impl/EngineInformation.java +++ b/src/main/java/de/kosit/validationtool/impl/EngineInformation.java @@ -21,7 +21,7 @@ import java.io.InputStream; import java.util.Properties; /** - * Hält statische Informatione über diesen Validator. + * Hält statische Informationen über diesen Validator. * * @author Andreas Penski */ diff --git a/src/main/java/de/kosit/validationtool/impl/HtmlExtractor.java b/src/main/java/de/kosit/validationtool/impl/HtmlExtractor.java index 64a7234..626d1b4 100644 --- a/src/main/java/de/kosit/validationtool/impl/HtmlExtractor.java +++ b/src/main/java/de/kosit/validationtool/impl/HtmlExtractor.java @@ -97,7 +97,7 @@ public class HtmlExtractor { } /** - * Extrahiert evtl. vorhandene HTML-Knoten als String. + * Extrahiert eventuell vorhandene HTML-Knoten als String. * * @param node der root knoten * @return HTML-Fragment als String diff --git a/src/main/java/de/kosit/validationtool/impl/input/ResourceInput.java b/src/main/java/de/kosit/validationtool/impl/input/ResourceInput.java index d0a82b9..5d37930 100644 --- a/src/main/java/de/kosit/validationtool/impl/input/ResourceInput.java +++ b/src/main/java/de/kosit/validationtool/impl/input/ResourceInput.java @@ -31,7 +31,7 @@ import java.net.URL; * An {@link Input} carries an {@link URL} which can be used for all 'locatable' inputs such as {@link File}, * {@link java.nio.file.Path} and any other {@link URL}. *

- * This stream is NOT read into memory. So this implementation has good in memory efficieny. The validation process MAY + * This stream is NOT read into memory. So this implementation has good in memory efficiency. The validation process MAY * read the stream more than once. Make sure, that the {@link URL} points to fast I/O devices * * @author Andreas Penski diff --git a/src/main/java/de/kosit/validationtool/impl/input/XdmNodeInput.java b/src/main/java/de/kosit/validationtool/impl/input/XdmNodeInput.java index 0083f5d..86e9557 100644 --- a/src/main/java/de/kosit/validationtool/impl/input/XdmNodeInput.java +++ b/src/main/java/de/kosit/validationtool/impl/input/XdmNodeInput.java @@ -42,7 +42,7 @@ public class XdmNodeInput implements Input { @Override public Source getSource() { - // usually not neccessary to be called. + // usually not necessary 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 74d5492..175e126 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/CheckAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/CheckAction.java @@ -34,7 +34,7 @@ import java.util.Collections; /** * Interface, welches von allen Prüfschritten implementiert wird. Der Parameter vom Typ {@link Bag} dient dabei sowohl - * als Quellce für Eingabe Parameter als auch für die Aufnahme von Ergebnisse, die an weitere Schritte weitergeleitet + * als Quelle für Eingabeparameter als auch für die Aufnahme von Ergebnissen, die an weitere Schritte weitergeleitet * werden sollen. * * @author Andreas Penski @@ -82,7 +82,7 @@ public interface CheckAction { } /** - * Signalisiert einen vorzeitigen Stop der Vearbeitung. + * Signalisiert einen vorzeitigen Stop der Verarbeitung. */ public void stopProcessing(final String error) { stopProcessing(Collections.singleton(error)); @@ -112,7 +112,7 @@ public interface CheckAction { } /** - * Ausfürhung des Prüfschrittes und Erweiterung der gesammelten Informationen. + * Ausführung des Prüfschrittes und Erweiterung der gesammelten Informationen. * * @param results die Informationssammlung */ diff --git a/src/main/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceAction.java b/src/main/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceAction.java index 3c76a68..87a85cd 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceAction.java @@ -41,7 +41,7 @@ public class ComputeAcceptanceAction implements CheckAction { // xml wurde aus irgendwelchen Gründen nicht korrekt verarbeitet, dann lassen wir es als undefined return; } - if (preCondtionsMatch(results)) { + if (preConditionsMatch(results)) { final Optional acceptMatch = results.getScenarioSelectionResult().getObject().getAcceptSelector(); if (results.getSchemaValidationResult().isValid() && acceptMatch.isPresent()) { evaluateAcceptanceMatch(results, acceptMatch.get()); @@ -81,7 +81,7 @@ public class ComputeAcceptanceAction implements CheckAction { } } - private static boolean preCondtionsMatch(final Bag results) { + private static boolean preConditionsMatch(final Bag results) { return results.getReport() != null && results.getSchemaValidationResult() != null && results.getScenarioSelectionResult() != null; } 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 bbdfd56..a1bbbb6 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/CreateReportAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/CreateReportAction.java @@ -150,7 +150,7 @@ public class CreateReportAction implements CheckAction { @Override public void setFeature(final String name, final boolean value) throws SAXNotRecognizedException { - // this inverts the logic from JaxbSource pseude parser + // this inverts the logic from JaxbSource pseudo parser if (name.equals(SAX_FEATURES_NAMESPACES) && !value) { throw new SAXNotRecognizedException(name); } 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 37a427b..bdfc297 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/DocumentParseAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/DocumentParseAction.java @@ -60,7 +60,7 @@ public class DocumentParseAction implements CheckAction { try { if (content instanceof XdmNodeInput && hasCompatibleConfiguration((XdmNodeInput) content)) { - // parsing not neccessary + // parsing not necessary result = new Result<>(((XdmNodeInput) content).getNode()); } else { final DocumentBuilder builder = this.processor.newDocumentBuilder(); 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 d5116cf..2df878c 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/SchemaValidationAction.java @@ -48,14 +48,14 @@ import java.nio.file.Files; import java.nio.file.Path; /** - * Schema valiation of the {@link Input} with the schema of the supplied scenario. This implementation is based on JDK + * Schema validation of the {@link Input} with the schema of the supplied scenario. This implementation is based on JDK * functionality and therefore needs a {@link Source} to do the actual validation. Since we base the validator on Saxon * HE functionality, we have no support for schema in Saxon (e.g. the in memory version of the document is not * schema-aware) and need to re-read the actual source. *

* Since the actual {@link Input} implementation may not be read twice, we must serialize the previously read document. * This implementation tries to do the validation in an efficient manner. If possible the source is read a second time - * to validate. If not, the source is serialized to the heap upon re-read/validaiton up to a configurable file size. The + * to validate. If not, the source is serialized to the heap upon re-read/validation up to a configurable file size. The * document is serialized to a temporary file otherwise. * * @author Andreas Penski @@ -180,7 +180,7 @@ public class SchemaValidationAction implements CheckAction { } - @SuppressWarnings("squid:S2095") // intentionally return open stream/autoclosable here + @SuppressWarnings("squid:S2095") // intentionally return open stream/autocloseable here private SerializedDocument serialize(final Input input, final XdmNode object) throws IOException, SaxonApiException { final SerializedDocument doc; if (input instanceof AbstractInput && ((AbstractInput) input).getLength() < getInMemoryLimit()) { 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 d9a5165..37fbe5c 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/SchematronValidationAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/SchematronValidationAction.java @@ -101,14 +101,14 @@ public class SchematronValidationAction implements CheckAction { @Override public boolean isSkipped(final Bag results) { - return hasNoSchematrons(results.getScenarioSelectionResult().getObject()) || isSchemaInvalid(results); + return hasNoSchematron(results.getScenarioSelectionResult().getObject()) || isSchemaInvalid(results); } private static boolean isSchemaInvalid(final Bag results) { return results.getSchemaValidationResult() == null || results.getSchemaValidationResult().isInvalid(); } - private static boolean hasNoSchematrons(final Scenario object) { + private static boolean hasNoSchematron(final Scenario object) { return object.getSchematronValidations().isEmpty(); } } diff --git a/src/main/java/de/kosit/validationtool/impl/tasks/ValidateReportInputAction.java b/src/main/java/de/kosit/validationtool/impl/tasks/ValidateReportInputAction.java index 13d301a..2cdf3f9 100644 --- a/src/main/java/de/kosit/validationtool/impl/tasks/ValidateReportInputAction.java +++ b/src/main/java/de/kosit/validationtool/impl/tasks/ValidateReportInputAction.java @@ -49,7 +49,7 @@ public class ValidateReportInputAction implements CheckAction { } /** - * Validatiert das gegebene JAXB-Objekt gegen das konfigurierte Schema + * Validiert das gegebene JAXB-Objekt gegen das konfigurierte Schema * * @param object das JAXB-Objekt * @param der Typ des Objekts diff --git a/src/main/java/de/kosit/validationtool/impl/xml/ProcessorProvider.java b/src/main/java/de/kosit/validationtool/impl/xml/ProcessorProvider.java index 7353cc3..101bd15 100644 --- a/src/main/java/de/kosit/validationtool/impl/xml/ProcessorProvider.java +++ b/src/main/java/de/kosit/validationtool/impl/xml/ProcessorProvider.java @@ -69,7 +69,7 @@ public class ProcessorProvider { } } - protected static final String DISSALLOW_DOCTYPE_DECL_FEATURE = "http://apache.org/xml/features/disallow-doctype-decl"; + protected static final String DISALLOW_DTD_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"; @@ -105,11 +105,11 @@ public class ProcessorProvider { 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 + // Konfiguration des zu verwendenden Parsers, wenn Saxon selbst einen erzeugen muss processor.getUnderlyingConfiguration().setConfigurationProperty(FeatureKeys.XML_PARSER_FEATURE + encode(FEATURE_SECURE_PROCESSING), true); // NOSONAR - processor.getUnderlyingConfiguration() - .setConfigurationProperty(FeatureKeys.XML_PARSER_FEATURE + encode(DISSALLOW_DOCTYPE_DECL_FEATURE), true); // NOSONAR + processor.getUnderlyingConfiguration().setConfigurationProperty(FeatureKeys.XML_PARSER_FEATURE + encode(DISALLOW_DTD_FEATURE), + true); // NOSONAR processor.getUnderlyingConfiguration().setConfigurationProperty(FeatureKeys.XML_PARSER_FEATURE + encode(LOAD_EXTERNAL_DTD_FEATURE), false); // NOSONAR processor.getUnderlyingConfiguration() diff --git a/src/test/java/de/kosit/validationtool/api/InputFactoryTest.java b/src/test/java/de/kosit/validationtool/api/InputFactoryTest.java index 126f684..c98099b 100644 --- a/src/test/java/de/kosit/validationtool/api/InputFactoryTest.java +++ b/src/test/java/de/kosit/validationtool/api/InputFactoryTest.java @@ -58,8 +58,8 @@ public class InputFactoryTest { @Test public void testDefaultDigestAlgorithm() { - assertThat(new InputFactory().getAlgorithm()).isEqualTo(InputFactory.DEFAULT_ALGORITH); - assertThat(new InputFactory("").getAlgorithm()).isEqualTo(InputFactory.DEFAULT_ALGORITH); + assertThat(new InputFactory().getAlgorithm()).isEqualTo(InputFactory.DEFAULT_ALGORITHM); + assertThat(new InputFactory("").getAlgorithm()).isEqualTo(InputFactory.DEFAULT_ALGORITHM); } @Test @@ -156,7 +156,7 @@ public class InputFactoryTest { } @Test - public void testUnexistingInput() { + public void testNotExistingInput() { assertThrows(IllegalArgumentException.class, () -> InputFactory.read(Simple.NOT_EXISTING)); } diff --git a/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java b/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java index 8154a66..33eeb45 100644 --- a/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java +++ b/src/test/java/de/kosit/validationtool/cmd/CommandlineApplicationTest.java @@ -178,7 +178,7 @@ public class CommandlineApplicationTest { CommandLineApplication.mainProgram(args); assertThat(CommandLine.getErrorOutput()).contains(RESULT_OUTPUT); assertThat(CommandLine.getOutputLines()).haveAtLeastOne(new Condition<>( - s -> StringUtils.contains(s, ""), "Must " + "contain xml preambel")); + s -> StringUtils.contains(s, ""), "Must " + "contain xml preamble")); } @Test diff --git a/src/test/java/de/kosit/validationtool/cmd/DefaultNamingStrategyTest.java b/src/test/java/de/kosit/validationtool/cmd/DefaultNamingStrategyTest.java index e7004e8..49a742b 100644 --- a/src/test/java/de/kosit/validationtool/cmd/DefaultNamingStrategyTest.java +++ b/src/test/java/de/kosit/validationtool/cmd/DefaultNamingStrategyTest.java @@ -64,7 +64,7 @@ public class DefaultNamingStrategyTest { } @Test - public void testUnknownExtenson() { + public void testUnknownExtension() { final DefaultNamingStrategy strategy = new DefaultNamingStrategy(); assertThat(strategy.createName("test.ext")).isEqualTo("test.ext-report.xml"); strategy.setPrefix("prefix"); diff --git a/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java b/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java index a4966fb..786d15f 100644 --- a/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java +++ b/src/test/java/de/kosit/validationtool/cmd/ExtractHtmlActionTest.java @@ -35,7 +35,7 @@ import java.util.stream.Stream; import static org.assertj.core.api.Assertions.assertThat; /** - * Testet die HTML-Extrkation des Kommondazeilenprogramms. + * Testet die HTML-Extraktion des Kommandozeilenprogramms. * * @author Andreas Penski */ diff --git a/src/test/java/de/kosit/validationtool/impl/ConversionServiceTest.java b/src/test/java/de/kosit/validationtool/impl/ConversionServiceTest.java index a139ea7..789acd5 100644 --- a/src/test/java/de/kosit/validationtool/impl/ConversionServiceTest.java +++ b/src/test/java/de/kosit/validationtool/impl/ConversionServiceTest.java @@ -84,7 +84,7 @@ public class ConversionServiceTest { @Test public void testUnmarshalIllFormed() { assertThrows(ConversionService.ConversionException.class, - () -> this.service.readXml(Invalid.SCENARIOS_ILLFORMED, Scenarios.class, this.repository.createSchema(SCHEMA))); + () -> this.service.readXml(Invalid.SCENARIOS_ILL_FORMED, Scenarios.class, this.repository.createSchema(SCHEMA))); } @Test diff --git a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java index dc105f7..7e6fac9 100644 --- a/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java +++ b/src/test/java/de/kosit/validationtool/impl/DefaultCheckTest.java @@ -144,7 +144,7 @@ public class DefaultCheckTest { public void testGarbage() { final Result result = this.validCheck.checkInput(read(GARBAGE)); assertThat(result).isNotNull(); - assertThat(result.isWellformed()).isFalse(); + assertThat(result.isWellFormed()).isFalse(); assertThat(result.isSchemaValid()).isFalse(); assertThat(result.isProcessingSuccessful()).isFalse(); } @@ -153,7 +153,7 @@ public class DefaultCheckTest { public void testNoScenario() { final Result result = this.validCheck.checkInput(read(UNKNOWN)); assertThat(result).isNotNull(); - assertThat(result.isWellformed()).isTrue(); + assertThat(result.isWellFormed()).isTrue(); assertThat(result.isProcessingSuccessful()).isTrue(); assertThat(result.isSchemaValid()).isFalse(); assertThat(result.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.REJECT); @@ -162,9 +162,9 @@ public class DefaultCheckTest { @Test public void testNotWellFormed() { - final Result result = this.validCheck.checkInput(read(NOT_WELLFORMED)); + final Result result = this.validCheck.checkInput(read(NOT_WELL_FORMED)); assertThat(result).isNotNull(); - assertThat(result.isWellformed()).isFalse(); + assertThat(result.isWellFormed()).isFalse(); assertThat(result.isSchemaValid()).isFalse(); assertThat(result.isProcessingSuccessful()).isFalse(); assertThat(result.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.REJECT); @@ -176,7 +176,7 @@ public class DefaultCheckTest { public void testRejectAcceptMatch() { final Result result = this.validCheck.checkInput(read(REJECTED)); assertThat(result).isNotNull(); - assertThat(result.isWellformed()).isTrue(); + assertThat(result.isWellFormed()).isTrue(); assertThat(result.isSchemaValid()).isTrue(); assertThat(result.isProcessingSuccessful()).isTrue(); assertThat(result.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.REJECT); @@ -189,13 +189,13 @@ public class DefaultCheckTest { public void testSchematronFailed() { final Result result = this.validCheck.checkInput(read(SCHEMATRON_INVALID)); assertThat(result).isNotNull(); - assertThat(result.isWellformed()).isTrue(); + assertThat(result.isWellFormed()).isTrue(); 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!!! + // acceptMatch overrules schematron!!! assertThat(result.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.ACCEPTABLE); assertThat(result.isAcceptable()).isTrue(); assertThat(result.getReport()).isNotNull(); @@ -207,7 +207,7 @@ public class DefaultCheckTest { public void testSchematronFailedWithoutAcceptMatch() { final Result result = this.validCheck.checkInput(read(FOO_SCHEMATRON_INVALID)); assertThat(result).isNotNull(); - assertThat(result.isWellformed()).isTrue(); + assertThat(result.isWellFormed()).isTrue(); assertThat(result.isSchemaValid()).isTrue(); result.getFailedAsserts(); assertThat(result.isSchematronValid()).isFalse(); diff --git a/src/test/java/de/kosit/validationtool/impl/Helper.java b/src/test/java/de/kosit/validationtool/impl/Helper.java index b4ee388..136cc88 100644 --- a/src/test/java/de/kosit/validationtool/impl/Helper.java +++ b/src/test/java/de/kosit/validationtool/impl/Helper.java @@ -70,7 +70,7 @@ public class Helper { public static final URI SCHEMATRON_INVALID = ROOT.resolve("input/simple-schematron-invalid.xml"); - public static final URI NOT_WELLFORMED = ROOT.resolve("input/simple-not-wellformed.xml"); + public static final URI NOT_WELL_FORMED = ROOT.resolve("input/simple-not-wellformed.xml"); public static final URI UNKNOWN = ROOT.resolve("input/unknown.xml"); @@ -95,11 +95,11 @@ public class Helper { public static class Invalid { - public static final URI ROOT = EXAMPLES_DIR.resolve("invaid/"); + public static final URI ROOT = EXAMPLES_DIR.resolve("invalid/"); public static final URI SCENARIOS = ROOT.resolve("scenarios.xml"); - public static final URI SCENARIOS_ILLFORMED = ROOT.resolve("scenarios-illformed.xml"); + public static final URI SCENARIOS_ILL_FORMED = ROOT.resolve("scenarios-illformed.xml"); } 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 27075f9..09485b4 100644 --- a/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java +++ b/src/test/java/de/kosit/validationtool/impl/tasks/ComputeAcceptanceActionTest.java @@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class ComputeAcceptanceActionTest { - private static final String DOESNOT_EXIST = "count(//doesnotExist) = 0"; + private static final String DOES_NOT_EXIST = "count(//doesnotExist) = 0"; private final ComputeAcceptanceAction action = new ComputeAcceptanceAction(); @@ -66,7 +66,7 @@ public class ComputeAcceptanceActionTest { @Test public void testValidAcceptMatch() { final Bag bag = createBag(true, true); - bag.getScenarioSelectionResult().getObject().setAcceptExecutable(createXpath(DOESNOT_EXIST)); + bag.getScenarioSelectionResult().getObject().setAcceptExecutable(createXpath(DOES_NOT_EXIST)); this.action.check(bag); assertThat(bag.getAcceptStatus()).isEqualTo(AcceptRecommendation.ACCEPTABLE); } @@ -82,7 +82,7 @@ public class ComputeAcceptanceActionTest { @Test public void testAcceptMatchOverridesSchematronErrors() { final Bag bag = createBag(true, false); - bag.getScenarioSelectionResult().getObject().setAcceptExecutable(createXpath(DOESNOT_EXIST)); + bag.getScenarioSelectionResult().getObject().setAcceptExecutable(createXpath(DOES_NOT_EXIST)); this.action.check(bag); assertThat(bag.getAcceptStatus()).isEqualTo(AcceptRecommendation.ACCEPTABLE); } @@ -90,7 +90,7 @@ public class ComputeAcceptanceActionTest { @Test public void testValidAcceptMatchOnSchemaFailed() { final Bag bag = createBag(false, true); - bag.getScenarioSelectionResult().getObject().setAcceptExecutable(createXpath(DOESNOT_EXIST)); + bag.getScenarioSelectionResult().getObject().setAcceptExecutable(createXpath(DOES_NOT_EXIST)); this.action.check(bag); assertThat(bag.getAcceptStatus()).isEqualTo(AcceptRecommendation.REJECT); } 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 6111dcd..4341c48 100644 --- a/src/test/java/de/kosit/validationtool/impl/tasks/DocumentParseActionTest.java +++ b/src/test/java/de/kosit/validationtool/impl/tasks/DocumentParseActionTest.java @@ -52,8 +52,8 @@ public class DocumentParseActionTest { } @Test - public void testIllformed() { - final Result result = this.action.parseDocument(read(Simple.NOT_WELLFORMED)); + public void testIllFormed() { + final Result result = this.action.parseDocument(read(Simple.NOT_WELL_FORMED)); assertThat(result).isNotNull(); assertThat(result.getErrors()).isNotEmpty(); assertThat(result.getObject()).isNull(); 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 ab42d58..f35c763 100644 --- a/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java +++ b/src/test/java/de/kosit/validationtool/impl/tasks/SchemaValidatorActionTest.java @@ -89,7 +89,7 @@ public class SchemaValidatorActionTest { public void testNoRepeatableRead() throws Exception { try ( final InputStream inputStream = Simple.SIMPLE_VALID.toURL().openStream() ) { final Bag bag = createBag(InputFactory.read(new StreamSource(inputStream))); - // don't read the real inputstream here! + // don't read the real input stream here! bag.setParserResult(Helper.parseDocument(InputFactory.read(Simple.SIMPLE_VALID.toURL()))); this.service.check(bag); assertThat(bag.getSchemaValidationResult()).isNotNull(); 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 446c3fe..38a5667 100644 --- a/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java +++ b/src/test/java/de/kosit/validationtool/impl/tasks/TestBagBuilder.java @@ -68,18 +68,18 @@ public class TestBagBuilder { return bag; } - private static Scenario createScenario(final URI schemafile) { + 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.setLocation(schemaFile.getRawPath()); r.setName("invoice"); v.getResource().add(r); t.setValidateWithXmlSchema(v); final Scenario scenario = new Scenario(t); - scenario.setSchema(createSchema(schemafile.toURL())); + scenario.setSchema(createSchema(schemaFile.toURL())); final ResolvingConfigurationStrategy strategy = ResolvingMode.STRICT_RELATIVE.getStrategy(); scenario.setFactory(strategy); return scenario; diff --git a/src/test/resources/examples/invalid/scenarios-illforned.xml b/src/test/resources/examples/invalid/scenarios-illformed.xml similarity index 100% rename from src/test/resources/examples/invalid/scenarios-illforned.xml rename to src/test/resources/examples/invalid/scenarios-illformed.xml