diff --git a/core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractGlobalDefinition.java b/core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractGlobalDefinition.java index bb8100c24..f89623f0d 100644 --- a/core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractGlobalDefinition.java +++ b/core/src/main/java/gov/nist/secauto/metaschema/core/model/AbstractGlobalDefinition.java @@ -60,12 +60,6 @@ public final QName getDefinitionQName() { return definitionQName.get(); } - @Override - public final boolean isInline() { - // never inline - return false; - } - @Override public final INSTANCE getInlineInstance() { // never inline diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/RootAssemblyBindingMatcher.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/RootAssemblyBindingMatcher.java index 40ab248f2..838da028c 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/RootAssemblyBindingMatcher.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/RootAssemblyBindingMatcher.java @@ -51,4 +51,9 @@ public Class getBoundClassForXmlQName(QName rootQName) { public Class getBoundClassForJsonName(String rootName) { return getRootJsonName().equals(rootName) ? getClazz() : null; } + + @Override + public String toString() { + return getDefinition().getRootXmlQName().toString(); + } } diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundDefinitionModelComplex.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundDefinitionModelComplex.java index 59036b177..3ae7306d0 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundDefinitionModelComplex.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/IBoundDefinitionModelComplex.java @@ -26,11 +26,6 @@ public interface IBoundDefinitionModelComplex @NonNull Map> getJsonProperties(@Nullable Predicate flagFilter); - @Override - default boolean isInline() { - return getBoundClass().getEnclosingClass() != null; - } - @Nullable Method getBeforeDeserializeMethod(); diff --git a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/AbstractBoundDefinitionModelComplex.java b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/AbstractBoundDefinitionModelComplex.java index b05c8e1ca..e175ef956 100644 --- a/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/AbstractBoundDefinitionModelComplex.java +++ b/databind/src/main/java/gov/nist/secauto/metaschema/databind/model/impl/AbstractBoundDefinitionModelComplex.java @@ -96,11 +96,6 @@ public final QName getDefinitionQName() { return definitionQName.get(); } - @Override - public boolean isInline() { - return getBoundClass().getEnclosingClass() != null; - } - @Override public Method getBeforeDeserializeMethod() { return beforeDeserializeMethod; diff --git a/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractValidateContentCommand.java b/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractValidateContentCommand.java index 79ed64351..782891066 100644 --- a/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractValidateContentCommand.java +++ b/metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractValidateContentCommand.java @@ -194,9 +194,7 @@ public void execute() throws CommandExecutionException { IValidationResult validationResult = null; try { - IModule module = bindingContext.registerModule( - getModule(getCommandLine(), bindingContext)); - + IModule module = bindingContext.registerModule(getModule(getCommandLine(), bindingContext)); if (!cmdLine.hasOption(NO_SCHEMA_VALIDATION_OPTION)) { // perform schema validation validationResult = getSchemaValidationProvider(module, getCommandLine(), bindingContext) diff --git a/metaschema-cli/src/test/java/gov/nist/secauto/metaschema/cli/CLITest.java b/metaschema-cli/src/test/java/gov/nist/secauto/metaschema/cli/CLITest.java index 1e27f86b3..27efe0397 100644 --- a/metaschema-cli/src/test/java/gov/nist/secauto/metaschema/cli/CLITest.java +++ b/metaschema-cli/src/test/java/gov/nist/secauto/metaschema/cli/CLITest.java @@ -12,6 +12,7 @@ import gov.nist.secauto.metaschema.cli.processor.ExitCode; import gov.nist.secauto.metaschema.cli.processor.ExitStatus; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -44,7 +45,8 @@ void evaluateResult(@NonNull ExitStatus status, @NonNull ExitCode expectedCode, } private static Stream providesValues() { - @SuppressWarnings("serial") List values = new LinkedList<>() { + @SuppressWarnings("serial") + List values = new LinkedList<>() { { add(Arguments.of(new String[] {}, ExitCode.INVALID_COMMAND, NO_EXCEPTION_CLASS)); @@ -179,6 +181,15 @@ private static Stream providesValues() { "../core/metaschema/schema/metaschema/metaschema-module-metaschema.xml", }, ExitCode.OK, NO_EXCEPTION_CLASS)); + add(Arguments.of( + new String[] { "validate-content", + "-m", + "src/test/resources/content/215-module.xml", + "src/test/resources/content/215.xml", + "--disable-schema-validation", + "--show-stack-trace" + }, + ExitCode.FAIL, NO_EXCEPTION_CLASS)); } }; @@ -198,4 +209,16 @@ void testAllCommands(@NonNull String[] args, @NonNull ExitCode expectedExitCode, evaluateResult(CLI.runCli(fullArgs), expectedExitCode, expectedThrownClass); } } + + @Test + void test() { + String[] cliArgs = { "validate-content", + "-m", + "src/test/resources/content/215-module.xml", + "src/test/resources/content/215.xml", + "--disable-schema-validation", + "--show-stack-trace" + }; + CLI.runCli(cliArgs); + } }