mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
#11 jdk11 support
This commit is contained in:
parent
248f460500
commit
70149817bf
17 changed files with 391 additions and 149 deletions
|
|
@ -1,4 +1,4 @@
|
|||
FROM openjdk:8
|
||||
FROM openjdk:11
|
||||
|
||||
RUN mkdir /opt/validationtool
|
||||
ADD maven/validationtool-standalone.jar /opt/validationtool
|
||||
|
|
|
|||
8
src/main/docker/daemon/Dockerfile-java8
Normal file
8
src/main/docker/daemon/Dockerfile-java8
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
FROM openjdk:8
|
||||
|
||||
RUN mkdir /opt/validationtool
|
||||
ADD maven/validationtool-standalone.jar /opt/validationtool
|
||||
ADD run.sh /opt/validationtool/
|
||||
ADD config/ /opt/validationtool/
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["bash", "/opt/validationtool/run.sh" ]
|
||||
8
src/main/docker/daemon/Dockerfile-java8-jdk-jaxb
Normal file
8
src/main/docker/daemon/Dockerfile-java8-jdk-jaxb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
FROM openjdk:8
|
||||
|
||||
RUN mkdir /opt/validationtool
|
||||
ADD maven/validationtool-standalone.jar /opt/validationtool
|
||||
ADD run.sh /opt/validationtool/
|
||||
ADD config/ /opt/validationtool/
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["bash", "/opt/validationtool/run.sh" ]
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
cd /opt/validationtool && java -jar validationtool-standalone.jar -s scenarios.xml -D
|
||||
cd /opt/validationtool && java -jar validationtool-standalone.jar -s scenarios.xml -D -H 0.0.0.0
|
||||
|
|
@ -28,6 +28,7 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.security.DigestInputStream;
|
||||
|
|
@ -226,6 +227,8 @@ public class InputFactory {
|
|||
byte[] hash = digest.digest();
|
||||
log.debug("Generated hashcode for {} is {}", name, DatatypeConverter.printHexBinary(hash));
|
||||
out.flush();
|
||||
log.info(new String(out.toByteArray(), Charset.forName("utf8")).substring(0,
|
||||
out.toByteArray().length < 100 ? out.toByteArray().length : 100));
|
||||
return new Input(out.toByteArray(), name, hash, digest.getAlgorithm());
|
||||
} catch (IOException e) {
|
||||
throw new IllegalArgumentException(MESSAGE_OPEN_STREAM_ERROR + name, e);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ import net.sf.saxon.s9api.XdmNode;
|
|||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class CheckAssertionAction implements CheckAction {
|
||||
class CheckAssertionAction implements CheckAction {
|
||||
|
||||
private final Assertions assertions;
|
||||
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ public class CommandLineApplication {
|
|||
printHelp(options);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
private static int determinePort(CommandLine cmd) {
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ class Daemon {
|
|||
@Override
|
||||
public void handle(HttpExchange httpExchange) throws IOException {
|
||||
try {
|
||||
log.debug("Incoming request");
|
||||
String requestMethod = httpExchange.getRequestMethod();
|
||||
if (requestMethod.equals("POST")) {
|
||||
InputStream inputStream = httpExchange.getRequestBody();
|
||||
|
|
@ -82,7 +83,7 @@ class Daemon {
|
|||
} else {
|
||||
writeError(httpExchange, 405, "Es ist nur die POST-Methode erlaubt!");
|
||||
}
|
||||
} catch (TransformerException e) {
|
||||
} catch (Exception e) {
|
||||
writeError(httpExchange, 500, "Interner Fehler bei der Verarbeitung des Requests: " + e.getMessage());
|
||||
log.error("Es ist ein Fehler aufgetreten. Das Dokument kann nicht geprüft werden", e);
|
||||
}
|
||||
|
|
@ -189,7 +190,7 @@ class Daemon {
|
|||
server.createContext("/health", new HealthHandler(check.getRepository().getScenarios()));
|
||||
server.setExecutor(Executors.newFixedThreadPool(threadCount));
|
||||
server.start();
|
||||
log.info("Server ist erfolgreich gestartet");
|
||||
log.info("Server unter Port {} ist erfolgreich gestartet", port);
|
||||
} catch (IOException e) {
|
||||
log.error("Fehler beim HttpServer erstellen!", e.getMessage(), e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ import net.sf.saxon.s9api.XdmNode;
|
|||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class ExtractHtmlContentAction implements CheckAction {
|
||||
class ExtractHtmlContentAction implements CheckAction {
|
||||
|
||||
private static final QName NAME_ATTRIBUTE = new QName("data-report-type");
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
* @author Andreas Penski
|
||||
*/
|
||||
@Slf4j
|
||||
public class PrintMemoryStats implements de.kosit.validationtool.impl.tasks.CheckAction {
|
||||
class PrintMemoryStats implements de.kosit.validationtool.impl.tasks.CheckAction {
|
||||
|
||||
private static final int BYTES_PER_K = 1024;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import net.sf.saxon.s9api.Serializer;
|
|||
* @author Andreas Penski
|
||||
*/
|
||||
@Slf4j
|
||||
public class PrintReportAction implements CheckAction {
|
||||
class PrintReportAction implements CheckAction {
|
||||
|
||||
@Override
|
||||
public void check(Bag results) {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import net.sf.saxon.s9api.Serializer;
|
|||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class SerializeReportAction implements CheckAction {
|
||||
class SerializeReportAction implements CheckAction {
|
||||
|
||||
private final Path outputDirectory;
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public class DocumentParseAction implements CheckAction {
|
|||
log.debug("Exception while parsing {}", content.getName(), e);
|
||||
XMLSyntaxError error = new XMLSyntaxError();
|
||||
error.setSeverity(XMLSyntaxErrorSeverity.SEVERITY_FATAL_ERROR);
|
||||
error.setMessage(String.format("IOException while reading resource %s", content.getName()));
|
||||
error.setMessage(String.format("IOException while reading resource %s: %s", content.getName(), e.getMessage()));
|
||||
result = new Result<>(Collections.singleton(error));
|
||||
}
|
||||
|
||||
|
|
@ -84,6 +84,9 @@ public class DocumentParseAction implements CheckAction {
|
|||
results.setParserResult(parserResult);
|
||||
v.getXmlSyntaxError().addAll(parserResult.getErrors());
|
||||
results.getReportInput().setValidationResultsWellformedness(v);
|
||||
if (parserResult.isInvalid()) {
|
||||
log.info("Parsing war nicht erfolgreich: {} -> {}", parserResult.getObject(), parserResult.getErrors());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue