xsl-list
[Top] [All Lists]

Re: Junit-type Framework for XSLT 2 Functions and Templates?

2005-05-16 13:39:57
Eric van der Vlist's XSLTunit:

             http://xsltunit.org/


Of course, this was a 2002 work -- probably Eric can tell us if he's
thought about extending XSLTunit to XSLT 2.0.


In my opinion, a very important componenet of any automated testing
framework is a test-data generator.

  Do we have a tool that given a schema generates a sequence of
instances, which (in its infinite entirety) covers all instances
defined by the schema and is ordered from simple to more complex (e.g.
by the length of the produced xml document)?


I have asked this question at least twice on separate occasions and
the answer seems to be negative.


Cheers,
Dimitre Novatchev


On 5/17/05, Eliot Kimber <ekimber(_at_)innodata-isogen(_dot_)com> wrote:
I've started doing work with XSLT 2 and I'm finding that, with the new
built-in function mechanism in XSLT 2, along with all the new built-in
functions string processing and what not, that I'm writing more
XSLT-level functions that I have in the past (in the past I would tend
to write these functions as Java extension functions).

As these functions tend to be easily testable using automated tests I
naturally created another test XSLT that provides unit tests for these
functions. But it's not quite as convenient as having a real unit test
framework ala JUnit.

I'm wondering if anyone has thought about the best way to implement a
unit testing framework for XSLT 2? The approach I'm thinking about at
the moment would use one transform to process a set of unit test
templates in order to generate a new transform that would run the tests
and apply the results.

Another approach that might be productive would be to write a Java
application that evaluates an input transform consisting of unit test
templates and then applying those templates individually, under Java
control (and in this case you could even make each template call part of
a real JUnit unit test, letting you take advantage of support for JUnit
in tools like Eclipse). But this would be a Java-centric approach and it
would probably be better to have something that is pure XSLT.

I haven't pushed on it, but it would be ideal if there was some way to
apply the sort of introspection approach that JUnit uses--that is, have
a transform that processes itself in order to find the test case
templates and run them, reporting success or failure. But I don't think
there's any way to do this directly (because there's no evaluate()
function in standard XSLT.

Any ideas about how best to proceed?

Cheers,

Eliot
--
W. Eliot Kimber
Professional Services
Innodata Isogen
9390 Research Blvd, #410
Austin, TX 78759
(512) 372-8155

ekimber(_at_)innodata-isogen(_dot_)com
www.innodata-isogen.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--