mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
#41 fix validation of garbage e.g. non xml files
Testing also with not wellformed xml files
This commit is contained in:
parent
fa5966d464
commit
5e579dcd11
3 changed files with 16 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ package de.kosit.validationtool.impl;
|
|||
|
||||
import static de.kosit.validationtool.api.InputFactory.read;
|
||||
import static de.kosit.validationtool.impl.Helper.Simple.GARBAGE;
|
||||
import static de.kosit.validationtool.impl.Helper.Simple.NOT_WELLFORMED;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.File;
|
||||
|
|
@ -113,4 +114,13 @@ public class DefaultCheckTest {
|
|||
assertThat(result.isProcessingSuccessful()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotWellFormed() {
|
||||
final Result result = this.implementation.checkInput(read(NOT_WELLFORMED));
|
||||
assertThat(result).isNotNull();
|
||||
assertThat(result.isWellformed()).isFalse();
|
||||
assertThat(result.isSchemaValid()).isFalse();
|
||||
assertThat(result.isProcessingSuccessful()).isFalse();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ public class Helper {
|
|||
|
||||
public static final URI INVALID = ROOT.resolve("input/simple-invalid.xml");
|
||||
|
||||
public static final URI NOT_WELLFORMED = ROOT.resolve("input/simple-not-wellformed.xml");
|
||||
|
||||
public static final URI UNKNOWN = ROOT.resolve("input/unknown.xml");
|
||||
|
||||
public static final URI GARBAGE = ROOT.resolve("input/no-xml.file");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<simple xmlns="http://validator.kosit.de/test-sample">
|
||||
<inner>asldkfj</inner>
|
||||
Loading…
Add table
Add a link
Reference in a new issue