mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
(chore) load from jar test case added
This commit is contained in:
parent
183ddab179
commit
4e48730c71
10 changed files with 43 additions and 17 deletions
|
|
@ -27,8 +27,10 @@ import static de.kosit.validationtool.impl.Helper.Simple.REJECTED;
|
|||
import static de.kosit.validationtool.impl.Helper.Simple.SCHEMATRON_INVALID;
|
||||
import static de.kosit.validationtool.impl.Helper.Simple.SIMPLE_VALID;
|
||||
import static de.kosit.validationtool.impl.Helper.Simple.UNKNOWN;
|
||||
import static java.util.Objects.requireNonNull;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
|
@ -57,13 +59,22 @@ public class DefaultCheckTest {
|
|||
// for checking certain error scenarios.
|
||||
private DefaultCheck errorCheck;
|
||||
|
||||
private DefaultCheck jarScenarioCheck;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
public void setup() throws URISyntaxException {
|
||||
final Configuration validConfig = Configuration.load(Simple.SCENARIOS, Simple.REPOSITORY_URI).build();
|
||||
this.validCheck = new DefaultCheck(validConfig);
|
||||
|
||||
final Configuration errorConfig = Configuration.load(Simple.ERROR_SCENARIOS, Simple.REPOSITORY_URI).build();
|
||||
this.errorCheck = new DefaultCheck(errorConfig);
|
||||
|
||||
final Configuration jarConfig = Configuration
|
||||
.load(requireNonNull(DefaultCheckTest.class.getClassLoader().getResource("simple/packaged/scenarios.xml")).toURI(),
|
||||
requireNonNull(DefaultCheckTest.class.getClassLoader().getResource("simple/packaged/repository/")).toURI())
|
||||
.build();
|
||||
|
||||
this.jarScenarioCheck = new DefaultCheck(jarConfig);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -77,6 +88,17 @@ public class DefaultCheckTest {
|
|||
assertThat(doc.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.ACCEPTABLE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testJarCase() {
|
||||
final Result doc = this.jarScenarioCheck.checkInput(read(SIMPLE_VALID));
|
||||
assertThat(doc).isNotNull();
|
||||
assertThat(doc.getReport()).isNotNull();
|
||||
assertThat(doc.isAcceptable()).isTrue();
|
||||
assertThat(doc.isSchematronValid()).isTrue();
|
||||
assertThat(doc.isSchemaValid()).isTrue();
|
||||
assertThat(doc.getAcceptRecommendation()).isEqualTo(AcceptRecommendation.ACCEPTABLE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWithoutAcceptMatch() {
|
||||
final Result doc = this.validCheck.checkInput(read(Simple.FOO));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue