Skip to content

Commit

Permalink
corrected test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jstaerk committed May 17, 2024
1 parent d5df6d9 commit 0720c76
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -324,6 +318,12 @@ public void validate() throws IrrecoverableValidationError {
@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");
}


}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,13 @@ public void testXRValidation() {
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()
Expand Down

0 comments on commit 0720c76

Please sign in to comment.