Skip to content
A.J. Stein edited this page Jun 21, 2023 · 2 revisions

XSLT Implementation Tests

Manual Schema Testing

By convention, developers in the Metaschema project for schema-based (JSON Schema and XML Schema) provide a test schema and two or more example document instances. For the two or more example document instances that end in _PASS.json or _PASS.xml indicate the examples should correctly validate against the schema and produce no errors. Example document instances that end in _FAIL.json or _FAIL.xml should not correctly validate against the schema, with a validator yielding one or more relevant errors because the document is missing required data elements or the existing data elements are not correct.

A developer can use xmllint or ajv to validate an example JSON or XML document instance respectively against its schema.

Developers can also use the OxygenXML IDE to validate a document instance with JSON Schema and XML Schema by the following the instructions below.

  1. Open the example document instance in the IDE.

image

  1. Open the validate wizard menu and select validate with.

image

  1. Select the appropriate schema (in this case JSON) and use the file picker to find the schema.

image

  1. Review the output and determine if the document yields one or more errors or no errors as appropriate for the given test.

image

XSpec Tests

A developer can use the the XSpec CLI for Linux, macOS, and Windows environments to run the tests or opt to run them using the scenario runner integrated into the OxygenXML IDE. To do the latter, review the following steps.

  1. Open the relevant XSpec file in the IDE.

image

  1. Select the default XSpec runner (in step 3) to open the HTML-based report in your default browser or use the integrated XSpec Helper Plugin to view the results integrated into the IDE.

  2. For the default XSpec runner, click the Configuration Transformation Scenarios wizard and select the XSpec file, then click the Apply Associated button.

image

image

  1. Select the Window > Show View > XSpec Helper options in the ribbon menu. Then click the green play button specifically in the plugin to review results.

image

image

Clone this wiki locally