corrected test cases
This commit is contained in:
@@ -1,14 +1,8 @@
|
||||
package org.mustangproject.validator;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
@@ -324,6 +318,12 @@ public class PDFValidator extends Validator {
|
||||
@Override
|
||||
public void setFilename(String filename) throws IrrecoverableValidationError {
|
||||
this.pdfFilename = filename;
|
||||
try {
|
||||
fileContents=Files.readAllBytes(Paths.get(pdfFilename));
|
||||
} catch (IOException ex) {
|
||||
throw new IrrecoverableValidationError("Could not read file");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -181,13 +181,13 @@ public class LibraryTest extends ResourceCase {
|
||||
String res = zfv.validate(tempFile.getAbsolutePath());
|
||||
assertThat(res).valueByXPath("count(//error)")
|
||||
.asInt()
|
||||
.isEqualTo(1);// there is an error inthe XRechnung validatoion artefacts: https://github.com/itplr-kosit/validator-configuration-xrechnung/issues/84
|
||||
.isEqualTo(0);
|
||||
assertThat(res).valueByXPath("/validation/summary/@status")
|
||||
.asString()
|
||||
.isEqualTo("invalid");// expect to be valid because XR notices are, well, only notices
|
||||
.isEqualTo("valid");// expect to be valid because XR notices are, well, only notices
|
||||
assertThat(res).valueByXPath("/validation/xml/summary/@status")
|
||||
.asString()
|
||||
.isEqualTo("invalid");
|
||||
.isEqualTo("valid");
|
||||
|
||||
assertThat(res).valueByXPath("count(//notice)")
|
||||
.asInt()
|
||||
|
||||
Reference in New Issue
Block a user