mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
32-UpdatePluginsAndDependencies#4
This commit is contained in:
parent
2425e91b87
commit
68371eb911
12 changed files with 48 additions and 18 deletions
6
pom.xml
6
pom.xml
|
|
@ -99,12 +99,12 @@
|
|||
<version.packaged-test-scenarios>1.0.2</version.packaged-test-scenarios>
|
||||
<version.picocli>4.7.7</version.picocli>
|
||||
<version.pmd>7.13.0</version.pmd>
|
||||
<version.rest-assured>5.5.1</version.rest-assured>
|
||||
<version.rest-assured>5.5.2</version.rest-assured>
|
||||
<version.rewrite-logging-frameworks>3.8.0</version.rewrite-logging-frameworks>
|
||||
<version.rewrite-migrate-java>3.9.0</version.rewrite-migrate-java>
|
||||
<version.rewrite-static-analysis>2.9.0</version.rewrite-static-analysis>
|
||||
<version.rewrite-testing-frameworks>3.8.0</version.rewrite-testing-frameworks>
|
||||
<version.saxon-he>12.6</version.saxon-he>
|
||||
<version.saxon-he>12.7</version.saxon-he>
|
||||
<version.slf4j-api>2.0.17</version.slf4j-api>
|
||||
<version.slf4j-simple>2.0.17</version.slf4j-simple>
|
||||
<!-- Plugins -->
|
||||
|
|
@ -137,7 +137,7 @@
|
|||
<version.maven-site-plugin>3.21.0</version.maven-site-plugin>
|
||||
<version.maven-source-plugin>3.3.1</version.maven-source-plugin>
|
||||
<version.maven-surefire-plugin>3.5.3</version.maven-surefire-plugin>
|
||||
<version.rewrite-maven-plugin>6.8.0</version.rewrite-maven-plugin>
|
||||
<version.rewrite-maven-plugin>6.8.1</version.rewrite-maven-plugin>
|
||||
<version.spotbugs-maven-plugin>4.9.3.0</version.spotbugs-maven-plugin>
|
||||
<version.versions-maven-plugin>2.18.0</version.versions-maven-plugin>
|
||||
</properties>
|
||||
|
|
|
|||
|
|
@ -59,7 +59,9 @@ class CheckAssertionAction implements CheckAction {
|
|||
|
||||
@Override
|
||||
public void check(Bag results) {
|
||||
log.info("Checking assertions for {}", results.getInput().getName());
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("Checking assertions for {}", results.getInput().getName());
|
||||
}
|
||||
final List<AssertionType> toCheck = findAssertions(results.getName());
|
||||
final List<String> errors = new ArrayList<>();
|
||||
if (toCheck != null && !toCheck.isEmpty()) {
|
||||
|
|
@ -71,7 +73,9 @@ class CheckAssertionAction implements CheckAction {
|
|||
}
|
||||
});
|
||||
if (errors.isEmpty()) {
|
||||
log.info("{} assertions successfully verified for {}", toCheck.size(), results.getName());
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("{} assertions successfully verified for {}", toCheck.size(), results.getName());
|
||||
}
|
||||
} else {
|
||||
log.warn("{} assertion of {} failed while checking {}", errors.size(), toCheck.size(), results.getName());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,9 @@ class ExtractHtmlContentAction implements CheckAction {
|
|||
final Path file = this.outputDirectory.resolve(name + ".html");
|
||||
final Serializer serializer = this.processor.newSerializer(file.toFile());
|
||||
try {
|
||||
log.info("Writing report html '{}' to {}", name, file.toAbsolutePath());
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("Writing report html '{}' to {}", name, file.toAbsolutePath());
|
||||
}
|
||||
serializer.serializeNode(node);
|
||||
} catch (final SaxonApiException e) {
|
||||
log.error("Error extracting html content to {}", file.toAbsolutePath(), e);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,9 @@ class SerializeReportAction implements CheckAction {
|
|||
public void check(final Bag results) {
|
||||
final Path file = this.outputDirectory.resolve(this.namingStrategy.createName(results.getName()));
|
||||
try {
|
||||
log.info("Serializing result to {}", file.toAbsolutePath());
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("Serializing result to {}", file.toAbsolutePath());
|
||||
}
|
||||
final Serializer serializer = this.processor.newSerializer(file.toFile());
|
||||
serializer.serializeNode(results.getReport());
|
||||
} catch (final SaxonApiException e) {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,9 @@ public class SerializeReportInputAction implements CheckAction {
|
|||
public void check(final Bag results) {
|
||||
final Path file = this.outputDirectory.resolve(results.getName() + "-reportInput.xml");
|
||||
try {
|
||||
log.info("Serializing result to {}", file.toAbsolutePath());
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("Serializing result to {}", file.toAbsolutePath());
|
||||
}
|
||||
final String xml = this.conversionService.writeXml(results.getReportInput());
|
||||
Files.write(file, xml.getBytes());
|
||||
} catch (final IOException e) {
|
||||
|
|
|
|||
|
|
@ -167,7 +167,9 @@ public class Validator {
|
|||
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);
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("Processing {} object(s) completed in {}ms", targets.size(), processingTime);
|
||||
}
|
||||
return check.isSuccessful(results) ? ReturnValue.SUCCESS : ReturnValue.createFailed(check.getNotAcceptableCount(results));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -187,7 +187,9 @@ public class ConfigurationLoader {
|
|||
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());
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("Loading scenario content from {}", this.getScenarioRepository());
|
||||
}
|
||||
} else {
|
||||
throw new IllegalStateException(
|
||||
String.format("Can not load scenarios from %s due to %s", getScenarioDefinition(), handler.getErrorDescription()));
|
||||
|
|
|
|||
|
|
@ -89,7 +89,9 @@ public class Daemon {
|
|||
server.createContext("/server/config", new ConfigHandler(check.getConfiguration(), converter));
|
||||
server.setExecutor(createExecutor());
|
||||
server.start();
|
||||
log.info("Server {} started", server.getAddress());
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("Server {} started", server.getAddress());
|
||||
}
|
||||
writeOut("Daemon started. Visit http://{0}", this.bindAddress + ":" + this.port);
|
||||
} catch (final IOException e) {
|
||||
log.error("Error starting HttpServer for Validator: {}", e.getMessage(), e);
|
||||
|
|
|
|||
|
|
@ -114,16 +114,22 @@ public class DefaultCheck implements Check {
|
|||
|
||||
protected Result runCheckInternal(final CheckAction.Bag t) {
|
||||
final long started = System.currentTimeMillis();
|
||||
log.info("Checking content of {}", t.getInput().getName());
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("Checking content of {}", t.getInput().getName());
|
||||
}
|
||||
for (final CheckAction action : this.checkSteps) {
|
||||
final long start = System.currentTimeMillis();
|
||||
if (!action.isSkipped(t)) {
|
||||
action.check(t);
|
||||
}
|
||||
log.debug("Step {} finished in {}ms", action.getClass().getSimpleName(), System.currentTimeMillis() - start);
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Step {} finished in {}ms", action.getClass().getSimpleName(), System.currentTimeMillis() - start);
|
||||
}
|
||||
}
|
||||
t.setFinished(true);
|
||||
log.info("Finished check of {} in {}ms\n", t.getInput().getName(), System.currentTimeMillis() - started);
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("Finished check of {} in {}ms\n", t.getInput().getName(), System.currentTimeMillis() - started);
|
||||
}
|
||||
return createResult(t);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,9 @@ public final class ScenarioRepository {
|
|||
}
|
||||
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());
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("The following scenarios are available:\n{}", summarizeScenarios());
|
||||
}
|
||||
}
|
||||
|
||||
public Scenario getFallbackScenario() {
|
||||
|
|
|
|||
|
|
@ -49,9 +49,13 @@ public class ScenarioSelectionAction implements CheckAction {
|
|||
results.setScenarioSelectionResult(scenarioTypeResult);
|
||||
if (!scenarioTypeResult.getObject().isFallback()) {
|
||||
report.setScenario(scenarioTypeResult.getObject().getConfiguration());
|
||||
log.info("Scenario {} identified for {}", scenarioTypeResult.getObject().getName(), results.getInput().getName());
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("Scenario {} identified for {}", scenarioTypeResult.getObject().getName(), results.getInput().getName());
|
||||
}
|
||||
} else {
|
||||
log.info("No valid scenario configuration found for {}", results.getInput().getName());
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("No valid scenario configuration found for {}", results.getInput().getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -136,7 +136,9 @@ public class SchemaValidationAction implements CheckAction {
|
|||
private long inMemoryLimit = Long.parseLong(System.getProperty(LIMIT_PARAMETER, BA_LIMIT.toString())) * FileUtils.ONE_MB;
|
||||
|
||||
private Result<Boolean, XMLSyntaxError> validate(final Bag results, final Scenario scenario) {
|
||||
log.debug("Validating document using scenario {}", scenario.getConfiguration().getName());
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Validating document using scenario {}", scenario.getConfiguration().getName());
|
||||
}
|
||||
final CollectingErrorEventHandler errorHandler = new CollectingErrorEventHandler();
|
||||
try ( final SourceProvider validateInput = resolveSource(results) ) {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue