opengeospatial / ets-csw202

Executable Test Suite for CSW 2.0.2
Other
2 stars 1 forks source link

A sequence of more than one item is not allowed as the first argument of compare() #21

Closed keshavnangare closed 6 years ago

keshavnangare commented 6 years ago

Some tests are get failed with the following service URL.

http://gptogc.esri.com/geoportal/csw?request=GetCapabilities&service=CSW&AcceptVersions=2.0.2

Test Name : csw:csw-2.0.2-GetRecordById-tc1.2 type Mandatory
net.sf.saxon.s9api.SaxonApiException: Error in call to extension function {public org.w3c.dom.NodeList com.occamlab.te.TECore.request(org.w3c.dom.Document,java.lang.String) throws java.lang.Throwable}: Exception in extension function java.lang.reflect.InvocationTargetException
    at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:192)
    at com.occamlab.te.TECore.executeTemplate(TECore.java:607)
    at com.occamlab.te.TECore.executeTest(TECore.java:818)
    at com.occamlab.te.TECore.callTest(TECore.java:1021)
Test Name : ctl:SchematronValidatingParser type Mandatory
net.sf.saxon.s9api.SaxonApiException: A sequence of more than one item is not allowed as the first argument of compare() ("http://maps.peterborough.ca/ar...", "{0000C159-6FB1-43BD-881F-A68B6...") 
    at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:192)
    at com.occamlab.te.TECore.executeTemplate(TECore.java:607)
    at com.occamlab.te.TECore.executeTest(TECore.java:818)
    at com.occamlab.te.TECore.callTest(TECore.java:1021)
    at sun.reflect.GeneratedMethodAccessor40.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at net.sf.saxon.functions.ExtensionFunctionCall.invokeMethod(ExtensionFunctionCall.java:533)
    at net.sf.saxon.functions.ExtensionFunctionCall.call(ExtensionFunctionCall.java:256)
    at net.sf.saxon.functions.ExtensionFunctionCall.iterate(ExtensionFunctionCall.java:147)
    at net.sf.saxon.expr.Expression.evaluateItem(Expression.java:352)
    at net.sf.saxon.instruct.SimpleContentConstructor.evaluateItem(SimpleContentConstructor.java:261)
    at net.sf.saxon.instruct.ValueOf.processLeavingTail(ValueOf.java:233)
    at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:409)
    at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:409)
    at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:409)
    at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:409)
    at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:409)
    at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:409)
    at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:409)
    at net.sf.saxon.instruct.Instruction.process(Instruction.java:94)
    at net.sf.saxon.expr.LetExpression.process(LetExpression.java:380)
    at net.sf.saxon.instruct.ForEach.processLeavingTail(ForEach.java:300)
    at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:551)
    at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:175)
    at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:343)
    at net.sf.saxon.Controller.transformDocument(Controller.java:1736)
    at net.sf.saxon.Controller.transform(Controller.java:1560)
    at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:190)
    at com.occamlab.te.TECore.executeTemplate(TECore.java:607)
    at com.occamlab.te.TECore.executeTest(TECore.java:818)
    at com.occamlab.te.TECore.callTest(TECore.java:1021)

Log file is here. log.txt

lorebiga commented 6 years ago

I'm not able to reproduce this error. In general, the capabilities document seems invalid. Have you tried validating it?

dstenger commented 6 years ago

@keshav-nangare Can you please recheck the reported error? Can you also add what environment you used for testing?

keshavnangare commented 6 years ago

This issue is reproducible on local as well as on beta environment, according to the error log I think the service is invalid.

Locally tested on: OS: Windows 8.1 Teamengine: 5.2 ets-csw20 : 1.17

dstenger commented 6 years ago

We should check if the error message can be improved.

lgoltz commented 6 years ago

Well, I can reproduce the failure too. Test csw:csw-2.0.2-GetRecordById-tc1.2 fails with the failure above. The following request (https://gptogc.esri.com/geoportal/csw)

<csw:GetRecords xmlns="http://www.occamlab.com/ctl"
                xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
                xmlns:ctl="http://www.occamlab.com/ctl"
                xmlns:dc="http://purl.org/dc/elements/1.1/"
                xmlns:dct="http://purl.org/dc/terms/"
                xmlns:gen="java:com.occamlab.te.Generator"
                xmlns:ows="http://www.opengis.net/ows"
                xmlns:p="http://teamengine.sourceforge.net/parsers"
                xmlns:parsers="http://www.occamlab.com/te/parsers"
                xmlns:saxon="http://saxon.sf.net/"
                xmlns:te="http://www.occamlab.com/te"
                xmlns:tec="java:com.occamlab.te.TECore"
                xmlns:tems="java:com.occamlab.te.web.MonitorServlet"
                xmlns:xi="http://www.w3.org/2001/XInclude"
                xmlns:xlink="http://www.w3.org/1999/xlink"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                resultType="results"
                service="CSW"
                version="2.0.2">
   <csw:Query typeNames="csw:Record">
      <csw:ElementSetName>brief</csw:ElementSetName>
   </csw:Query>
</csw:GetRecords>

returns a GetRecords response with multiple BriefRecords and dc:identifier. E.g.:

<csw:BriefRecord>
         <dc:identifier scheme="urn:x-esri:specification:ServiceType:ArcIMS:Metadata:FileID">http://www.tnccmaps.org:80/arcgis/services/GDE/pGDEs_FoxCanyonwebmap_GDEs/MapServer/1</dc:identifier>
         <dc:identifier scheme="urn:x-esri:specification:ServiceType:ArcIMS:Metadata:DocID">{631CD53C-ABCB-4A03-AB89-8248F2B12A5B}</dc:identifier>

Test test does not consider multiple occurrences of dc:identifier, it selects all: https://github.com/opengeospatial/ets-csw202/blob/4bd0a94d1bc40def874c79e665e5775170128e6f/src/main/scripts/ctl/GetRecordById/CSW-GetRecordById-GET.xml#L159

This should be fixed to select the first one and rechecked if the failure occurs any longer.