forked from metaschema-framework/metaschema-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test default and custom constraint msgs for metaschema-framework#215
- Loading branch information
1 parent
38f49ea
commit 760f31b
Showing
3 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<METASCHEMA xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://csrc.nist.gov/ns/oscal/metaschema/1.0 https://raw.githubusercontent.com/metaschema-framework/metaschema/0441e6d4c9bce5b6c40b4647148019e4f47bed08/schema/xml/metaschema.xsd"> | ||
<schema-name>Module for metaschema-framework/metaschema-java#215</schema-name> | ||
<schema-version>0.1.0</schema-version> | ||
<short-name>model215</short-name> | ||
<namespace>https://github.com/metaschema-framework/metaschema-java/issues/215</namespace> | ||
<json-base-uri>https://github.com/metaschema-framework/metaschema-java/issues/215</json-base-uri> | ||
<define-assembly name="root"> | ||
<root-name>message-root</root-name> | ||
<model> | ||
<define-field name="expect-default-non-zero" as-type="integer" min-occurs="1"/> | ||
<define-field name="expect-custom-non-zero" as-type="integer" min-occurs="1"/> | ||
<define-field name="matches-default-regex-letters-only" as-type="string" min-occurs="1"/> | ||
<define-field name="matches-custom-regex-letters-only" as-type="string" min-occurs="1"/> | ||
</model> | ||
<constraint> | ||
<expect id="expect-default-non-zero" level="ERROR" target="expect-default-non-zero" test=". > 0"/> | ||
<expect id="expect-custom-non-zero" level="ERROR" target="expect-custom-non-zero" test=". > 0"> | ||
<message>No default message, custom error message for expect-custom-non-zero constraint.</message> | ||
</expect> | ||
<matches id="matches-default-regex-letters-only" level="ERROR" target="matches-default-regex-letters-only" regex="^[a-zA-Z]$"/> | ||
<matches id="matches-custom-regex-letters-only" level="ERROR" target="matches-custom-regex-letters-only" regex="^[a-zA-Z]$"> | ||
<message>No default message, custom error message for matches-custom-regex-letters-only constraint.</message> | ||
</matches> | ||
</constraint> | ||
</define-assembly> | ||
</METASCHEMA> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<message-root xmlns="https://github.com/metaschema-framework/metaschema-java/issues/215"> | ||
<expect-default-non-zero>0</expect-default-non-zero> | ||
<expect-custom-non-zero>0</expect-custom-non-zero> | ||
<matches-default-regex-letters-only>1</matches-default-regex-letters-only> | ||
<matches-custom-regex-letters-only>1</matches-custom-regex-letters-only> | ||
</message-root> |