Project

Profile

Help

Does the .NET 10 TestRunner work out of the box?

Added by Martin Honnen about 2 years ago

The Saxon resources for .NET in the CS samples contain various classes for a test runner/driver, I wonder whether they are supposed to work out of the box or should compile.

When I pull the sources into a .NET framework project where Saxon HE 10.8 has been added from a NuGet I get many error/warnings, in particular in Environment.cs https://saxonica.plan.io/projects/saxonmirrorhe/repository/he/revisions/he-restored-saxon10_6/entry/src/samples/cs/TestRunner10.0/Environment.cs where it seems it is ambiguous whether any reference to Resource or/and ResourceCollection in the code refers the .NET or the Java class/interface of that name (it uses using Saxon.Api; and there is https://www.saxonica.com/html/documentation10/dotnetdoc/Saxon/Api/Resource.html and https://www.saxonica.com/html/documentation10/dotnetdoc/Saxon/Api/ResourceCollection.html but it also does using net.sf.saxon.lib; and there is https://www.saxonica.com/html/documentation10/javadoc/net/sf/saxon/lib/Resource.html and https://www.saxonica.com/html/documentation10/javadoc/net/sf/saxon/lib/ResourceCollection.html).

Before I get lost too deeply trying to understand that, is that code used in your tests of Saxon HE .NET? Does it work as it appears in the resources download and/or how it appears in the repository?


Replies (2)

RE: Does the .NET 10 TestRunner work out of the box? - Added by Michael Kay about 2 years ago

I'll take a look at it when I get to a Windows machine.

RE: Does the .NET 10 TestRunner work out of the box? - Added by Martin Honnen about 2 years ago

I made some progress, I think all Resource and ResourceCollection in the Environment.cs need to refer to the net.sf.saxon.lib ones, not the .NET ones.

But there are other oddities, the document of the .NET processor says in https://www.saxonica.com/html/documentation10/dotnetdoc/Saxon/Api/Processor.html#SchemaManager about the SchemaManager property that it is null for a non schema-aware processor and the test driver seems to try to exploit that test to decide whether to validate input documents.

However, in my tests with Saxon 10.8 .NET HE, the SchemaManager on the .NET side is not null, its underlying fields/properties are, but I had to try to comment out code using such checks so that no attempt to use non available document validation was done.

I think there is one bug in https://saxonica.plan.io/projects/saxonmirrorhe/repository/he/revisions/he-saxon10_6/entry/src/samples/cs/TestRunner10.0/Environment.cs#L573, it tries to create a .NET Uri but I think it needs to do obj = new java.net.URL(href);, to create a Java URL.

I then managed to get the Xslt30TestSuiteDriver to run, it seems you have to rename its Mainxxx method to Main to to that.

To run the whole test suite without crashing, I had to comment out two accumulator test cases (test-case name="accumulator-080" and accumulator-080s), otherwise Saxon would crash the test suite run with a stack overflow exception.

    (1-2/2)

    Please register to reply