public void testGetMultiple() throws Exception { Document dom = getAsDOM( BASEPATH + "?service=csw&version=2.0.2&request=GetRecordById&elementsetname=summary&id=urn:uuid:19887a8a-f6b0-4a63-ae56-7fba0e17801f,urn:uuid:1ef30a8b-876d-4828-9246-c37ab4510bbd"); // print(dom); checkValidationErrors(dom); // check we have the expected results assertXpathEvaluatesTo("2", "count(//csw:SummaryRecord/dc:identifier)", dom); assertXpathEvaluatesTo( "1", "count(//csw:SummaryRecord[dc:identifier='urn:uuid:19887a8a-f6b0-4a63-ae56-7fba0e17801f'])", dom); assertXpathEvaluatesTo( "1", "count(//csw:SummaryRecord[dc:identifier='urn:uuid:1ef30a8b-876d-4828-9246-c37ab4510bbd'])", dom); assertXpathEvaluatesTo( "http://purl.org/dc/dcmitype/Service", "//csw:SummaryRecord[dc:identifier='urn:uuid:1ef30a8b-876d-4828-9246-c37ab4510bbd']/dc:type", dom); assertXpathEvaluatesTo( "Proin sit amet justo. In justo. Aenean adipiscing nulla id tellus.", "//csw:SummaryRecord[dc:identifier='urn:uuid:1ef30a8b-876d-4828-9246-c37ab4510bbd']/dct:abstract", dom); }
public void testGetNothing() throws Exception { Document dom = getAsDOM( BASEPATH + "?service=csw&version=2.0.2&request=GetRecordById&elementsetname=summary&id=REC-1,REC-2"); // print(dom); checkValidationErrors(dom); // check we have the expected results assertXpathEvaluatesTo("0", "count(//csw:SummaryRecord)", dom); }
public void testGetBrief() throws Exception { Document dom = getAsDOM( BASEPATH + "?service=csw&version=2.0.2&request=GetRecordById&elementsetname=brief&id=urn:uuid:19887a8a-f6b0-4a63-ae56-7fba0e17801f"); // print(dom); checkValidationErrors(dom); // check we have the expected results assertXpathEvaluatesTo("1", "count(//csw:BriefRecord/dc:identifier)", dom); assertXpathEvaluatesTo( "urn:uuid:19887a8a-f6b0-4a63-ae56-7fba0e17801f", "//csw:BriefRecord/dc:identifier", dom); assertXpathEvaluatesTo("Lorem ipsum", "//csw:BriefRecord/dc:title", dom); assertXpathEvaluatesTo("http://purl.org/dc/dcmitype/Image", "//csw:BriefRecord/dc:type", dom); assertXpathEvaluatesTo("", "//csw:BriefRecord/dc:subject", dom); }
public void testDataInline() throws Exception { // Standard Test A.4.4.2, A.4.4.4 String xml = "<wps:Execute service='WPS' version='1.0.0' xmlns:wps='http://www.opengis.net/wps/1.0.0' " + "xmlns:ows='http://www.opengis.net/ows/1.1'>" + "<ows:Identifier>gt:buffer</ows:Identifier>" + "<wps:DataInputs>" + "<wps:Input>" + "<ows:Identifier>geom1</ows:Identifier>" + "<wps:Data>" + "<wps:ComplexData>" + "<gml:Polygon xmlns:gml='http://www.opengis.net/gml'>" + "<gml:exterior>" + "<gml:LinearRing>" + "<gml:coordinates>1 1 2 1 2 2 1 2 1 1</gml:coordinates>" + "</gml:LinearRing>" + "</gml:exterior>" + "</gml:Polygon>" + "</wps:ComplexData>" + "</wps:Data>" + "</wps:Input>" + "<wps:Input>" + "<ows:Identifier>buffer</ows:Identifier>" + "<wps:Data>" + "<wps:LiteralData>1</wps:LiteralData>" + "</wps:Data>" + "</wps:Input>" + "</wps:DataInputs>" + "<wps:ResponseForm>" + "<wps:ResponseDocument storeExecuteResponse='false'>" + "<wps:Output>" + "<ows:Identifier>result</ows:Identifier>" + "</wps:Output>" + "</wps:ResponseDocument>" + "</wps:ResponseForm>" + "</wps:Execute>"; // System.out.println(xml); Document d = postAsDOM("wps", xml); checkValidationErrors(d); assertEquals("wps:ExecuteResponse", d.getDocumentElement().getNodeName()); assertXpathExists("/wps:ExecuteResponse/wps:Status/wps:ProcessSucceeded", d); assertXpathExists( "/wps:ExecuteResponse/wps:ProcessOutputs/wps:Output/wps:Data/wps:ComplexData/gml:Polygon", d); }
public void testGetFull() throws Exception { Document dom = getAsDOM( BASEPATH + "?service=csw&version=2.0.2&request=GetRecordById&elementsetname=full&id=urn:uuid:19887a8a-f6b0-4a63-ae56-7fba0e17801f"); // print(dom); checkValidationErrors(dom); // check we have the expected results assertXpathEvaluatesTo( "urn:uuid:19887a8a-f6b0-4a63-ae56-7fba0e17801f", "//csw:Record/dc:identifier", dom); assertXpathEvaluatesTo("Lorem ipsum", "//csw:Record/dc:title", dom); assertXpathEvaluatesTo("http://purl.org/dc/dcmitype/Image", "//csw:Record/dc:type", dom); assertXpathEvaluatesTo("Tourism--Greece", "//csw:Record/dc:subject", dom); assertXpathEvaluatesTo("image/svg+xml", "//csw:Record/dc:format", dom); assertXpathEvaluatesTo( "Quisque lacus diam, placerat mollis, pharetra in, commodo sed, augue. Duis iaculis arcu vel arcu.", "//csw:Record/dct:abstract", dom); assertXpathEvaluatesTo("GR-22", "//csw:Record/dct:spatial", dom); }
public void testDataInlineRawOutput() throws Exception { // Standard Test A.4.4.3 String xml = "<wps:Execute service='WPS' version='1.0.0' xmlns:wps='http://www.opengis.net/wps/1.0.0' " + "xmlns:ows='http://www.opengis.net/ows/1.1'>" + "<ows:Identifier>gt:buffer</ows:Identifier>" + "<wps:DataInputs>" + "<wps:Input>" + "<ows:Identifier>geom1</ows:Identifier>" + "<wps:Data>" + "<wps:ComplexData>" + "<gml:Polygon xmlns:gml='http://www.opengis.net/gml'>" + "<gml:exterior>" + "<gml:LinearRing>" + "<gml:coordinates>1 1 2 1 2 2 1 2 1 1</gml:coordinates>" + "</gml:LinearRing>" + "</gml:exterior>" + "</gml:Polygon>" + "</wps:ComplexData>" + "</wps:Data>" + "</wps:Input>" + "<wps:Input>" + "<ows:Identifier>buffer</ows:Identifier>" + "<wps:Data>" + "<wps:LiteralData>1</wps:LiteralData>" + "</wps:Data>" + "</wps:Input>" + "</wps:DataInputs>" + "<wps:ResponseForm>" + " <wps:RawDataOutput>" + " <ows:Identifier>result</ows:Identifier>" + " </wps:RawDataOutput>" + " </wps:ResponseForm>" + "</wps:Execute>"; Document d = postAsDOM("wps", xml); checkValidationErrors(d, new GMLConfiguration()); assertEquals("gml:Polygon", d.getDocumentElement().getNodeName()); }