XSLT unit test

Are you missing a feature? Request its implementation here.
rrliu
Posts: 37
Joined: Sun Feb 12, 2006 10:34 pm

XSLT unit test

Post by rrliu »

I would like to see Oxygen support XSLT unit testing. In the simplest case I imagine something like this: I embed, say, in an annotation in a template, several testing scenarios. Each scenario consists of a context, any parameters I might wish to supply to the template, and the expected outcome of the transformation. When instructed to unit-test the template Oxygen would run each scenario by invoking the template in the specified context with the specified parameters and comparing the output to the expected outcome. It would also be nice if the expected outcome could assume the form of a collection of Schematron-like assertions. A further improvement on this simple case would be allowing tests to be kept separate from the templates in external files and templates to refer to them.
george
Site Admin
Posts: 2097
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Richard,

See
http://www.jenitennison.com/xslt/utilit ... t-testing/
You can find there also a description about how to use that from oXygen
...
The way I use it is that I've rigged up <oXygen/> with an "External Tool" so that I can hit a button and have the tests run and the results come up in the browser. If you use <oXygen/>, it's easy enough to do: go to Tools > External Tools > Preferences, click New and fill in the form as follows (I have the unit testing files in D:\library\unit testing):

Name

Test Stylesheet
Description

Runs the unit tests embedded in the current stylesheet
Working Directory

D:\library\unit testing
Command

"D:\library\unit testing\test.bat" ${cf}
...
Best Regards,
George
Post Reply