Bug fix for building scenario with schematron.

This commit is contained in:
ywu 2024-08-20 21:44:18 +02:00
parent 5184f86c5e
commit 71a705c39d
4 changed files with 25 additions and 2 deletions

View file

@ -140,6 +140,25 @@ public class ScenarioBuilderTest {
assertThat(configuration.getNamespace()).isEmpty();
}
@Test
public void testConfigureWithSchematron() {
final ContentRepository repository = Simple.createContentRepository();
final XPathExecutable match = repository.createXPath("//*", null);
final XPathExecutable accept = repository.createXPath("//*", null);
final ScenarioBuilder builder = createScenario();
builder.getNamespaces().clear();
builder.match(match);
builder.acceptWith(accept);
final Result<Scenario, String> result = builder.build(repository);
assertThat(result.isValid()).isTrue();
final ScenarioType configuration = result.getObject().getConfiguration();
assertThat(configuration.getMatch()).isNotEmpty();
assertThat(configuration.getAcceptMatch()).isNotEmpty();
assertThat(configuration.getNamespace()).isEmpty();
assertThat(configuration.getValidateWithSchematron()).isNotEmpty();
}
@Test
public void testBasicAttributes() {
final ContentRepository repository = Simple.createContentRepository();