This is an automated email from the git hooks/post-receive script. sebastic pushed a commit to branch master in repository zoo-project.
commit 0e112c3bc651c34d25d81dec730ab8fd3784e6cc Author: Bas Couwenberg <[email protected]> Date: Sun Jan 22 19:41:55 2017 +0100 Imported Upstream version 1.6.0~rc2+ds --- testing/README | 30 ++++ testing/extractExceptionInfo.xsl | 14 ++ testing/extractStatusLocation.xsl | 15 ++ testing/requests/dp.xml | 4 + testing/requests/igml_o.xml | 19 +++ testing/requests/ijson_o.xml | 19 +++ testing/requests/ir_o.xml | 17 +++ testing/requests/ir_o_async.xml | 17 +++ testing/requests/ir_or.xml | 17 +++ testing/requests/ir_or_async.xml | 17 +++ testing/requests/irb_o.xml | 22 +++ testing/requests/irb_o_async.xml | 22 +++ testing/requests/irb_or.xml | 22 +++ testing/requests/irb_or_async.xml | 22 +++ testing/run.sh | 255 +++++++++++++++++++++++++++++++ zoo-project/zoo-kernel/configure | 49 ++++-- zoo-project/zoo-kernel/configure.ac | 30 +++- zoo-project/zoo-kernel/request_parser.c | 22 ++- zoo-project/zoo-kernel/server_internal.c | 36 ++--- zoo-project/zoo-kernel/service.c | 10 +- 20 files changed, 620 insertions(+), 39 deletions(-) diff --git a/testing/README b/testing/README new file mode 100644 index 0000000..7611f41 --- /dev/null +++ b/testing/README @@ -0,0 +1,30 @@ +Please use the following syntaxe: + + ./run.sh <WPSInstance> <ServiceName> + +where <WPSInstance> should be the url to a WPS Server and <ServiceName> should +be the service name you want to run tests with. + +For instance to test the Buffer service on a localhost WPS server, use the +following command: + + ./run.sh http://localhost/cgi-bin/zoo_loader.cgi Buffer + + +Important note: sometimes XML validation failed because xmllint is unable to download +a file required to validate. In such case, you can use the file /etc/xml/catalog on your +local machine to use a local copy of the missing file. + +For instance, in case xml.xsd can't be downloaded, then you can download a copy using +this url http://www.w3.org/2001/xml.xsd, store it in /etc/schemas directory and then +use the following /etc/xml/catalog file: + +<?xml version="1.0"?> +<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"> +<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> +<rewriteSystem systemIdStartString="http://www.w3.org/2001/xml.xsd" + rewritePrefix="file:///etc/schemas/xml.xsd" /> +</catalog> + +Obviously, you can do similar manipulation for the OGC schemas to use local files +rather than downloading them for each tests. diff --git a/testing/extractExceptionInfo.xsl b/testing/extractExceptionInfo.xsl new file mode 100644 index 0000000..af1b699 --- /dev/null +++ b/testing/extractExceptionInfo.xsl @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:ows="http://www.opengis.net/ows/1.1" + xmlns:xlink="http://www.w3.org/1999/xlink"> + + <xsl:output method="text"/> + + <xsl:template match="*/*"> + <xsl:text>Code: </xsl:text><xsl:value-of select="@exceptionCode" /><xsl:text>, Locator: </xsl:text><xsl:value-of select="@locator" /> + </xsl:template> + +</xsl:stylesheet> diff --git a/testing/extractStatusLocation.xsl b/testing/extractStatusLocation.xsl new file mode 100644 index 0000000..8d410a9 --- /dev/null +++ b/testing/extractStatusLocation.xsl @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:ows="http://www.opengis.net/ows/1.1" + xmlns:wps="http://www.opengis.net/wps/1.0.0" + xmlns:xlink="http://www.w3.org/1999/xlink"> + + <xsl:output method="text"/> + + <xsl:template match="wps:ExecuteResponse"> + <xsl:value-of select="@statusLocation" /> + </xsl:template> + +</xsl:stylesheet> diff --git a/testing/requests/dp.xml b/testing/requests/dp.xml new file mode 100644 index 0000000..00e3f1e --- /dev/null +++ b/testing/requests/dp.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> +<DescribeProcess xmlns="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsDescribeProcess_request.xsd" service="WPS" version="1.0.0" language="en-US"> + <ows:Identifier>ServiceName</ows:Identifier> +</DescribeProcess> diff --git a/testing/requests/igml_o.xml b/testing/requests/igml_o.xml new file mode 100644 index 0000000..cc5b828 --- /dev/null +++ b/testing/requests/igml_o.xml @@ -0,0 +1,19 @@ +<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" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsExecute_request.xsd"> +<ows:Identifier>ServiceName</ows:Identifier> +<wps:DataInputs> +<wps:Input> +<ows:Identifier>InputName</ows:Identifier> +<ows:Title>Playground area</ows:Title> +<wps:Data> +<wps:ComplexData mimeType="text/xml"><wfs:FeatureCollection xmlns="http://www.opengis.net/wfs" xmlns:wfs="http://www.opengis.net/wfs" xmlns:topp="http://www.openplans.org/topp" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openplans.org/topp http://www.zoo-project.org:8082/geoserver/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=topp%3Astates http://www.opengis.net/wfs http://www [...] +</wps:Data> +</wps:Input> +</wps:DataInputs> +<wps:ResponseForm> +<wps:ResponseDocument> +<wps:Output> +<ows:Identifier>Result</ows:Identifier> +</wps:Output> +</wps:ResponseDocument> +</wps:ResponseForm> +</wps:Execute> diff --git a/testing/requests/ijson_o.xml b/testing/requests/ijson_o.xml new file mode 100644 index 0000000..d430059 --- /dev/null +++ b/testing/requests/ijson_o.xml @@ -0,0 +1,19 @@ +<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" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsExecute_request.xsd"> +<ows:Identifier>ServiceName</ows:Identifier> +<wps:DataInputs> +<wps:Input> +<ows:Identifier>InputPolygon</ows:Identifier> +<ows:Title>Playground area</ows:Title> +<wps:Data> +<wps:ComplexData mimeType="application/json">{"type":"Polygon","coordinates":[[[-102.036758,36.988972],[-106.860657,36.989491],[-109.047821,36.996643],[-109.055199,38.24493],[-109.052864,39.518196],[-109.050591,40.210545],[-109.047638,40.998474],[-107.918037,41.00341],[-104.051201,41.003227],[-102.620789,41.000225],[-102.047279,40.998077],[-102.04557,40.697323],[-102.036758,36.988972]]]}</wps:ComplexData> +</wps:Data> +</wps:Input> +</wps:DataInputs> +<wps:ResponseForm> +<wps:ResponseDocument> +<wps:Output> +<ows:Identifier>Result</ows:Identifier> +</wps:Output> +</wps:ResponseDocument> +</wps:ResponseForm> +</wps:Execute> diff --git a/testing/requests/ir_o.xml b/testing/requests/ir_o.xml new file mode 100644 index 0000000..935f5ed --- /dev/null +++ b/testing/requests/ir_o.xml @@ -0,0 +1,17 @@ +<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" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsExecute_request.xsd"> +<ows:Identifier>ServiceName</ows:Identifier> +<wps:DataInputs> +<wps:Input> +<ows:Identifier>InputPolygon</ows:Identifier> +<ows:Title>Playground area</ows:Title> +<wps:Reference xlink:href="http://www.zoo-project.org:8082/geoserver/ows?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.0.0&typename=topp:states&SRS=EPSG:4326&FeatureID=states.15" /> +</wps:Input> +</wps:DataInputs> +<wps:ResponseForm> +<wps:ResponseDocument> +<wps:Output> +<ows:Identifier>Result</ows:Identifier> +</wps:Output> +</wps:ResponseDocument> +</wps:ResponseForm> +</wps:Execute> diff --git a/testing/requests/ir_o_async.xml b/testing/requests/ir_o_async.xml new file mode 100644 index 0000000..cc00ca1 --- /dev/null +++ b/testing/requests/ir_o_async.xml @@ -0,0 +1,17 @@ +<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" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsExecute_request.xsd"> +<ows:Identifier>ServiceName</ows:Identifier> +<wps:DataInputs> +<wps:Input> +<ows:Identifier>InputPolygon</ows:Identifier> +<ows:Title>Playground area</ows:Title> +<wps:Reference xlink:href="http://www.zoo-project.org:8082/geoserver/ows?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.0.0&typename=topp:states&SRS=EPSG:4326&FeatureID=states.15" /> +</wps:Input> +</wps:DataInputs> +<wps:ResponseForm> +<wps:ResponseDocument storeExecuteResponse="true" status="true"> +<wps:Output> +<ows:Identifier>Result</ows:Identifier> +</wps:Output> +</wps:ResponseDocument> +</wps:ResponseForm> +</wps:Execute> diff --git a/testing/requests/ir_or.xml b/testing/requests/ir_or.xml new file mode 100644 index 0000000..3a44c19 --- /dev/null +++ b/testing/requests/ir_or.xml @@ -0,0 +1,17 @@ +<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" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsExecute_request.xsd"> +<ows:Identifier>ServiceName</ows:Identifier> +<wps:DataInputs> +<wps:Input> +<ows:Identifier>InputPolygon</ows:Identifier> +<ows:Title>Playground area</ows:Title> +<wps:Reference xlink:href="http://www.zoo-project.org:8082/geoserver/ows?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.0.0&typename=topp:states&SRS=EPSG:4326&FeatureID=states.15" /> +</wps:Input> +</wps:DataInputs> +<wps:ResponseForm> +<wps:ResponseDocument> +<wps:Output asReference="true"> +<ows:Identifier>Result</ows:Identifier> +</wps:Output> +</wps:ResponseDocument> +</wps:ResponseForm> +</wps:Execute> diff --git a/testing/requests/ir_or_async.xml b/testing/requests/ir_or_async.xml new file mode 100644 index 0000000..b6cd538 --- /dev/null +++ b/testing/requests/ir_or_async.xml @@ -0,0 +1,17 @@ +<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" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsExecute_request.xsd"> +<ows:Identifier>ServiceName</ows:Identifier> +<wps:DataInputs> +<wps:Input> +<ows:Identifier>InputPolygon</ows:Identifier> +<ows:Title>Playground area</ows:Title> +<wps:Reference xlink:href="http://www.zoo-project.org:8082/geoserver/ows?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.0.0&typename=topp:states&SRS=EPSG:4326&FeatureID=states.15" /> +</wps:Input> +</wps:DataInputs> +<wps:ResponseForm> +<wps:ResponseDocument storeExecuteResponse="true" status="true"> +<wps:Output asReference="true"> +<ows:Identifier>Result</ows:Identifier> +</wps:Output> +</wps:ResponseDocument> +</wps:ResponseForm> +</wps:Execute> diff --git a/testing/requests/irb_o.xml b/testing/requests/irb_o.xml new file mode 100644 index 0000000..ad43aa2 --- /dev/null +++ b/testing/requests/irb_o.xml @@ -0,0 +1,22 @@ +<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" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsExecute_request.xsd"> +<ows:Identifier>ServiceName</ows:Identifier> +<wps:DataInputs> +<wps:Input> +<ows:Identifier>InputPolygon</ows:Identifier> +<ows:Title>Playground area</ows:Title> +<wps:Reference xlink:href="http://www.zoo-project.org:8082/geoserver/ows" method="POST"> +<wps:Header key="Content-type" value="text/xml" /> +<wps:Body> +<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" maxFeatures="10" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><wfs:Query typeName="states" srsName="EPSG:4326"><ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:BBOX><ogc:PropertyName>the_geom</ogc:PropertyName><gml:Envelope xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:4326"><gml:lowerCorne [...] +</wps:Body> +</wps:Reference> +</wps:Input> +</wps:DataInputs> +<wps:ResponseForm> +<wps:ResponseDocument> +<wps:Output> +<ows:Identifier>Result</ows:Identifier> +</wps:Output> +</wps:ResponseDocument> +</wps:ResponseForm> +</wps:Execute> diff --git a/testing/requests/irb_o_async.xml b/testing/requests/irb_o_async.xml new file mode 100644 index 0000000..5c6f7f3 --- /dev/null +++ b/testing/requests/irb_o_async.xml @@ -0,0 +1,22 @@ +<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" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsExecute_request.xsd"> +<ows:Identifier>ServiceName</ows:Identifier> +<wps:DataInputs> +<wps:Input> +<ows:Identifier>InputPolygon</ows:Identifier> +<ows:Title>Playground area</ows:Title> +<wps:Reference xlink:href="http://www.zoo-project.org:8082/geoserver/ows" method="POST"> +<wps:Header key="Content-type" value="text/xml" /> +<wps:Body> +<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" maxFeatures="10" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><wfs:Query typeName="states" srsName="EPSG:4326"><ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:BBOX><ogc:PropertyName>the_geom</ogc:PropertyName><gml:Envelope xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:4326"><gml:lowerCorne [...] +</wps:Body> +</wps:Reference> +</wps:Input> +</wps:DataInputs> +<wps:ResponseForm> +<wps:ResponseDocument storeExecuteResponse="true" status="true"> +<wps:Output> +<ows:Identifier>Result</ows:Identifier> +</wps:Output> +</wps:ResponseDocument> +</wps:ResponseForm> +</wps:Execute> diff --git a/testing/requests/irb_or.xml b/testing/requests/irb_or.xml new file mode 100644 index 0000000..ac9f6e0 --- /dev/null +++ b/testing/requests/irb_or.xml @@ -0,0 +1,22 @@ +<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" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsExecute_request.xsd"> +<ows:Identifier>ServiceName</ows:Identifier> +<wps:DataInputs> +<wps:Input> +<ows:Identifier>InputPolygon</ows:Identifier> +<ows:Title>Playground area</ows:Title> +<wps:Reference xlink:href="http://www.zoo-project.org:8082/geoserver/ows" method="POST"> +<wps:Header key="Content-type" value="text/xml" /> +<wps:Body> +<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" maxFeatures="10" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><wfs:Query typeName="states" srsName="EPSG:4326"><ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:BBOX><ogc:PropertyName>the_geom</ogc:PropertyName><gml:Envelope xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:4326"><gml:lowerCorne [...] +</wps:Body> +</wps:Reference> +</wps:Input> +</wps:DataInputs> +<wps:ResponseForm> +<wps:ResponseDocument> +<wps:Output asReference="true"> +<ows:Identifier>Result</ows:Identifier> +</wps:Output> +</wps:ResponseDocument> +</wps:ResponseForm> +</wps:Execute> diff --git a/testing/requests/irb_or_async.xml b/testing/requests/irb_or_async.xml new file mode 100644 index 0000000..cda070d --- /dev/null +++ b/testing/requests/irb_or_async.xml @@ -0,0 +1,22 @@ +<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" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsExecute_request.xsd"> +<ows:Identifier>ServiceName</ows:Identifier> +<wps:DataInputs> +<wps:Input> +<ows:Identifier>InputPolygon</ows:Identifier> +<ows:Title>Playground area</ows:Title> +<wps:Reference xlink:href="http://www.zoo-project.org:8082/geoserver/ows" method="POST"> +<wps:Header key="Content-type" value="text/xml" /> +<wps:Body> +<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" maxFeatures="10" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><wfs:Query typeName="states" srsName="EPSG:4326"><ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:BBOX><ogc:PropertyName>the_geom</ogc:PropertyName><gml:Envelope xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:4326"><gml:lowerCorne [...] +</wps:Body> +</wps:Reference> +</wps:Input> +</wps:DataInputs> +<wps:ResponseForm> +<wps:ResponseDocument storeExecuteResponse="true" status="true"> +<wps:Output asReference="true"> +<ows:Identifier>Result</ows:Identifier> +</wps:Output> +</wps:ResponseDocument> +</wps:ResponseForm> +</wps:Execute> diff --git a/testing/run.sh b/testing/run.sh new file mode 100755 index 0000000..134782d --- /dev/null +++ b/testing/run.sh @@ -0,0 +1,255 @@ +#!/bin/bash + +Usage=$(cat <<EOF +Please use the following syntaxe: + + ./run.sh <WPSInstance> <ServiceName> <Request> + +where <WPSInstance> should be the url to a WPS Server, <ServiceName> should +be the service name you want to run tests with (you can use multiple service +names, use quote and seperate them using space), <Request> should contain the +requests you want to use (you can use more than one at a time). + +For instance to test the Buffer service on a localhost WPS server, use the +following command: + + ./run.sh http://localhost/cgi-bin/zoo_loader.cgi Buffer "GetCapabilities DescribeProcess Execute" + +EOF +) + +if [ -z "$1" ] || [ -z "$2" ]; then + echo "$Usage" + exit +fi + +WPSInstance=$1 +ServiceName=$2 +NBRequests=1000 +NBConcurrents=50 +pstat=0 + +iter=0 + +function testPostRequests { +# +# Tests for Execute using POST requests +# + for i in $1; + do + cat requests/${i}.xml | sed "s:ServiceName:${ServiceName}:g;s:InputName:$(cat tmp/inputName.txt):g" > tmp/${i}1.xml + if [ -z "$(echo $i | grep async)" ]; then + postRequest "${WPSInstance}" "tmp/outputE${i}.xml" "Execute" "tmp/${i}1.xml" + else + postRequest "${WPSInstance}" "tmp/outputE${i}.xml" "Execute" "tmp/${i}1.xml" "async" + fi + echo "" + done + +} + +function plotStat { + echo " **" + echo " * Plot statistics ..." + echo " **" + cp run.tsv tmp/run$1.tsv + sed "s:\[image\]:$2:g;s:\[file\]:$3:g" -i tmp/run$1.tsv + gnuplot tmp/run$1.tsv + cp run1.tsv tmp/run1$1.tsv + sed "s:\[image\]:$(echo $2 | sed "s:.jpg:1.jpg:g"):g;s:\[file\]:$3:g" -i tmp/run1$1.tsv + gnuplot tmp/run1$1.tsv +} + + +function kvpRequest { + echo " **" + echo " <h1> Simple KVP request start on $(date) </h1>" + echo " <a href='$1'>$1</a>" + + RESP=$(curl -v -o "$2" "$1" 2> tmp/temp.log; grep "< HTTP" tmp/temp.log | cut -d' ' -f3) + if [ "${3}" == "owsExceptionReport" ]; then + echo " *********************************" + if [ "$RESP" == "200" ]; then + echo " ! Invalid response code ($RESP)" + else + echo " * Valid response code ($RESP)" + fi + echo " *********************************" + echo " * Checking for ${3} response XML validity..." + echo " * Schema: [http://schemas.opengis.net/ows/1.1.0/${3}.xsd]" + echo " *********************************" + xmllint --noout --schema http://schemas.opengis.net/ows/1.1.0/${3}.xsd "$2" 2> tmp/res${iter}.txt + echo " *********************************" + echo "Verifying that the missing / wrong argument was referenced in locator and the exceptionCode take the corresponding value ..." + echo -n " *********************************" + xsltproc ./extractExceptionInfo.xsl "$2" + echo " *********************************" + else + if [ "$RESP" == "200" ]; then + echo " * Valid response code ($RESP)" + else + echo " ! Invalid response code ($RESP)" + fi + echo " * Checking for ${3} response XML validity..." + echo " * Schema: [http://schemas.opengis.net/wps/1.0.0/wps${3}_response.xsd]" + xmllint --noout --schema http://schemas.opengis.net/wps/1.0.0/wps${3}_response.xsd "$2" 2> tmp/res${iter}.txt + v="$(cat tmp/res${iter}.txt | grep validates)" + echo "" + fi + echo " **" + echo " * Sending $NBRequests ${3} requests starting on $(date) ..." + echo " **" + ab -g tmp/stat${3}${iter}.plot -e tmp/stat${3}${iter}.txt -n "$NBRequests" -c "$NBConcurrents" "$1" + if [ "$pstat" -eq 1 ]; then + plotStat ${iter} tmp/stat${3}${iter}.jpg tmp/stat${3}${iter}.plot + fi + iter=$(expr $iter + 1) + echo " ** Ending on $(date)" +} + +function postRequest { + echo " **" + echo " * Simple POST request started on $(date)" + echo " **" + echo " * Checking for ${3} request XML validity..." + echo " * Schema: http://schemas.opengis.net/wps/1.0.0/wps${3}_request.xsd" + echo " *********************************" + xmllint --noout --schema http://schemas.opengis.net/wps/1.0.0/wps${3}_request.xsd "$4" + echo " *********************************" + curl -H "Content-type: text/xml" -d@"$4" -o "$2" "$1" + echo " * Checking for ${3} response XML validity on $(date) ..." + echo " * Schema: http://schemas.opengis.net/wps/1.0.0/wps${3}_response.xsd" + echo " *********************************" + xmllint --noout --schema http://schemas.opengis.net/wps/1.0.0/wps${3}_response.xsd "$2" + echo " *********************************" + if [ -z "$5" ]; then + echo "" + else + echo " * Schema: http://schemas.opengis.net/wps/1.0.0/wps${3}_response.xsd" + echo " *********************************" + xmllint --noout --schema http://schemas.opengis.net/wps/1.0.0/wps${3}_response.xsd "$(xsltproc ./extractStatusLocation.xsl $2)" + echo " *********************************" + fi + echo " * Sending $NBRequests ${3} XML requests on $(date) ..." + ab -g tmp/stat${3}${iter}.plot -e tmp/stat${3}${iter}.txt -T "text/xml" -p "$4" -n "$NBRequests" -c "$NBConcurrents" "$1" + if [ "$pstat" -eq 1 ]; then + plotStat ${iter} tmp/stat${3}${iter}.jpg tmp/stat${3}${iter}.plot + fi + iter=$(expr $iter + 1) + echo " ** Ending on $(date)" +} + +function kvpRequestWrite { + suffix="" + cnt=0 + cnt0=0 + for i in $2; do + if [ ! $1 -eq $cnt0 ]; then + if [ $cnt -gt 0 ]; then + suffix="$suffix&$(echo $i | sed 's:\"::g')" + else + suffix="$(echo $i | sed 's:\"::g')" + fi + cnt=$(expr $cnt + 1) + fi + cnt0=$(expr $cnt0 + 1) + done + echo $suffix +} + +function kvpWrongRequestWrite { + suffix="" + cnt=0 + cnt0=0 + for i in $2; do + if [ ! $1 -eq $cnt0 ]; then + if [ $cnt -gt 0 ]; then + suffix="$suffix&$(echo $i | sed 's:\"::g')" + else + suffix="$(echo $i | sed 's:\"::g')" + fi + cnt=$(expr $cnt + 1) + else + cnt1=0 + for j in $3; do + if [ $cnt1 -eq $1 ]; then + suffix="$suffix&$(echo $j | sed 's:\"::g')" + fi + cnt1=$(expr $cnt1 + 1) + done + fi + cnt0=$(expr $cnt0 + 1) + done + echo $suffix +} + +for i in $3; do + if [ "$i" == "GetCapabilities" ]; then +# +# Tests for GetCapabilities using KVP (including wrong requests) and POST requests +# + kvpRequest "${WPSInstance}?REQUEST=GetCapabilities&SERVICE=WPS" "tmp/outputGC1.xml" "GetCapabilities" + + params='"request=GetCapabilities" "service=WPS"' + + suffix=$(kvpRequestWrite -1 "$params") + kvpRequest "${WPSInstance}?$suffix" "tmp/outputGC2.xml" "GetCapabilities" + + for j in 0 1; do + suffix=$(kvpRequestWrite $j "$params") + kvpRequest "${WPSInstance}?$suffix" "tmp/outputGC$(expr $j + 3).xml" "owsExceptionReport" + done + + paramsw='"request=GetCapabilitie" "service=WXS"' + for j in 0 1; do + suffix=$(kvpWrongRequestWrite $j "$params" "$paramsw") + kvpRequest "${WPSInstance}?$suffix" "tmp/outputGC$(expr $j + 5).xml" "owsExceptionReport" + done + + echo "Check if differences between upper case and lower case parameter names" + diff -ru tmp/outputGC1.xml tmp/outputGC2.xml + + echo "" + + curl -o tmp/10_wpsGetCapabilities_request.xml http://schemas.opengis.net/wps/1.0.0/examples/10_wpsGetCapabilities_request.xml + postRequest "${WPSInstance}" "tmp/outputGCp.xml" "GetCapabilities" "tmp/10_wpsGetCapabilities_request.xml" + echo "" + fi + if [ "$i" == "DescribeProcess" ]; then +# +# Tests for DescribeProcess using KVP and POST requests +# + kvpRequest "${WPSInstance}?request=DescribeProcess&service=WPS&version=1.0.0&Identifier=ALL" "tmp/outputDPall.xml" "DescribeProcess" + + params='"request=DescribeProcess" "service=WPS" "version=1.0.0" "Identifier='${ServiceName}'"' + + suffix=$(kvpRequestWrite -1 "$params") + kvpRequest "${WPSInstance}?$suffix" "tmp/outputDPb1.xml" "DescribeProcess" + + for j in 0 1 2 3; do + suffix=$(kvpRequestWrite $j "$params") + kvpRequest "${WPSInstance}?$suffix" "tmp/outputDPb$(expr $j + 2).xml" "owsExceptionReport" + done + + paramsw='"request=DescribeProces" "service=WXS" "version=1.2.0" "Identifier=Undefined"' + + for j in 0 1 2 3; do + suffix=$(kvpWrongRequestWrite $j "$params") + kvpRequest "${WPSInstance}?$suffix" "tmp/outputDPb$(expr $j + 6).xml" "owsExceptionReport" + done + + + cat requests/dp.xml | sed "s:ServiceName:${ServiceName}:g" > tmp/dp1.xml + postRequest "${WPSInstance}" "tmp/outputDPp.xml" "DescribeProcess" "tmp/dp1.xml" + xsltproc extractInputs.xsl tmp/outputDPp.xml > tmp/inputName.txt + echo "" + fi + if [ "$i" == "ExecuteSync" ]; then + testPostRequests "ijson_o igml_o ir_o ir_or irb_o irb_or" + echo "" + fi + if [ "$i" == "ExecuteAsync" ]; then + testPostRequests "ir_o_async ir_or_async irb_o_async irb_or_async" + echo "" + fi +done diff --git a/zoo-project/zoo-kernel/configure b/zoo-project/zoo-kernel/configure index 1226413..c3115ef 100755 --- a/zoo-project/zoo-kernel/configure +++ b/zoo-project/zoo-kernel/configure @@ -7312,13 +7312,20 @@ else ITKVERS="4.5" fi OTB_ENABLED="-DUSE_OTB" + IVERS="$(echo -e '4.10\n$ITKVERS' | sort -r | head -n1)" + if test "$IVERS" == "$ITKVERS"; then + ITK_LDFLAGS="-lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKVERS -litksys-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ [...] + else + ITK_LDFLAGS="-lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKVERS -litksys-$ITKVERS -litkv3p_lsqr-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvc [...] + fi + if test -a "${OTBPATH}/include/OTB-${OTBVERS}" ; then OTB_RPATH="$OTBPATH/include/OTB-${OTBVERS}/" OTB_CPPFLAGS="-I${OTB_RPATH}ApplicationEngine -I$OTB_RPATH/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTB_RPATH/Utilities/ITK -I$OTB_RPATH/ -I$OTB_RPATH/IO -I$OTB_RPATH/UtilitiesAdapters/OssimAdapters -I$OTB_RPATH/UtilitiesAdapters/CurlAdapters -I$OTB_RPATH/Utilities/BGL -I$OTB_RPATH/UtilitiesAdapters/ITKPendingPatches -I$OTB_RPATH/Utilities/otbconfigfile $GDAL_CFLAGS" - OTB_LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -lOTBImageIO-$OTBVERS -lOTBCommon-$OTBVERS -lOTBApplicationEngine-$OTBVERS -L$ITKPATH/lib -lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKW [...] + OTB_LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -lOTBImageIO-$OTBVERS -lOTBCommon-$OTBVERS -lOTBApplicationEngine-$OTBVERS -L$ITKPATH/lib $ITK_LDFLAGS" else OTB_CPPFLAGS="-I$OTBPATH/include/otb/ApplicationEngine -I$OTBPATH/include/otb/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTBPATH/include/otb/Utilities/ITK -I$OTBPATH/include/otb/ -I$OTBPATH/include/otb/IO -I$OTBPATH/include/otb/UtilitiesAdapters/OssimAdapters -I$OTBPATH/include/otb/UtilitiesAdapters/CurlAdapters -I$OTBPATH/include/otb/Utilities/BGL -I$OTBPATH/include/otb/UtilitiesAdapters/ITKPendingPatches -I$OTBPATH/include/otb/Utilities/otbconfigfile $GDAL_CFLAGS" - OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -L$ITKPATH/lib -lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKV [...] + OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -L$ITKPATH/lib $ITK_LDFLAGS" fi OTB_FILE="otbZooWatcher.o service_internal_otb.o" @@ -7334,31 +7341,51 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CPPFLAGS="$OTB_CPPFLAGS" LDFLAGS_SAVE="$LDFLAGS" LIBS="$LIBS_SAVE $OTB_LDFLAGS" - echo $OTB_CPPFLAGS - #AC_CHECK_HEADERS([otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h], - # [], [AC_MSG_ERROR([could not find header file $i related to OTB])]) + #echo $OTB_CPPFLAGS + for ac_header in otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + as_fn_error $? "could not find header file $i related to OTB" "$LINENO" 5 +fi + +done + LDFLAGS_SAVE="$LDFLAGS" LDFLAGS="$OTB_LDFLAGS" - echo $OTB_LDFLAGS + #echo $OTB_LDFLAGS + #UVERS="$(echo -e '5.8\n$OTBVERS' | sort -r | head -n1)" + #if test "$OTBVERS" == "$UVERS" ; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include "otbWrapperApplication.h",std::vector<std::string> list = otb::Wrapwper::ApplicationRegistry::GetAvailableApplication(); +#include "otbWrapperApplicationRegistry.h" int main () { - +std::vector<std::string> list = otb::Wrapper::ApplicationRegistry::GetAvailableApplications(); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for GetAvailableApplication... yes" >&5 -$as_echo "checking for GetAvailableApplication... yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for GetAvailableApplications... yes" >&5 +$as_echo "checking for GetAvailableApplications... yes" >&6; } else - as_fn_error $? "checking for GetAvailableApplication... failed" "$LINENO" 5 + as_fn_error $? "checking for GetAvailableApplications... failed" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + #else + # AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "otbWrapperApplication.h"]],[[std::vector<std::string> list = otb::Wrapper::ApplicationRegistry::GetAvailableApplication();]])], + # [AC_MSG_RESULT([checking for GetAvailableApplication... yes])],[AC_MSG_ERROR([checking for GetAvailableApplication... failed])]) + #fi + LDFLAGS="$LDFLAGS_SAVE" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' diff --git a/zoo-project/zoo-kernel/configure.ac b/zoo-project/zoo-kernel/configure.ac index 91911e5..6174d99 100644 --- a/zoo-project/zoo-kernel/configure.ac +++ b/zoo-project/zoo-kernel/configure.ac @@ -813,13 +813,20 @@ else ITKVERS="4.5" fi OTB_ENABLED="-DUSE_OTB" + IVERS="$(echo -e '4.10\n$ITKVERS' | sort -r | head -n1)" + if test "$IVERS" == "$ITKVERS"; then + ITK_LDFLAGS="-lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKVERS -litksys-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ [...] + else + ITK_LDFLAGS="-lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKVERS -litksys-$ITKVERS -litkv3p_lsqr-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvc [...] + fi + if test -a "${OTBPATH}/include/OTB-${OTBVERS}" ; then OTB_RPATH="$OTBPATH/include/OTB-${OTBVERS}/" OTB_CPPFLAGS="-I${OTB_RPATH}ApplicationEngine -I$OTB_RPATH/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTB_RPATH/Utilities/ITK -I$OTB_RPATH/ -I$OTB_RPATH/IO -I$OTB_RPATH/UtilitiesAdapters/OssimAdapters -I$OTB_RPATH/UtilitiesAdapters/CurlAdapters -I$OTB_RPATH/Utilities/BGL -I$OTB_RPATH/UtilitiesAdapters/ITKPendingPatches -I$OTB_RPATH/Utilities/otbconfigfile $GDAL_CFLAGS" - OTB_LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -lOTBImageIO-$OTBVERS -lOTBCommon-$OTBVERS -lOTBApplicationEngine-$OTBVERS -L$ITKPATH/lib -lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKW [...] + OTB_LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -lOTBImageIO-$OTBVERS -lOTBCommon-$OTBVERS -lOTBApplicationEngine-$OTBVERS -L$ITKPATH/lib $ITK_LDFLAGS" else OTB_CPPFLAGS="-I$OTBPATH/include/otb/ApplicationEngine -I$OTBPATH/include/otb/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTBPATH/include/otb/Utilities/ITK -I$OTBPATH/include/otb/ -I$OTBPATH/include/otb/IO -I$OTBPATH/include/otb/UtilitiesAdapters/OssimAdapters -I$OTBPATH/include/otb/UtilitiesAdapters/CurlAdapters -I$OTBPATH/include/otb/Utilities/BGL -I$OTBPATH/include/otb/UtilitiesAdapters/ITKPendingPatches -I$OTBPATH/include/otb/Utilities/otbconfigfile $GDAL_CFLAGS" - OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -L$ITKPATH/lib -lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKV [...] + OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -L$ITKPATH/lib $ITK_LDFLAGS" fi OTB_FILE="otbZooWatcher.o service_internal_otb.o" @@ -830,14 +837,21 @@ else CPPFLAGS="$OTB_CPPFLAGS" LDFLAGS_SAVE="$LDFLAGS" LIBS="$LIBS_SAVE $OTB_LDFLAGS" - echo $OTB_CPPFLAGS - #AC_CHECK_HEADERS([otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h], - # [], [AC_MSG_ERROR([could not find header file $i related to OTB])]) + #echo $OTB_CPPFLAGS + AC_CHECK_HEADERS([otbWrapperApplication.h otbWrapperInputImageListParameter.h otbWrapperApplicationRegistry.h], + [], [AC_MSG_ERROR([could not find header file $i related to OTB])]) LDFLAGS_SAVE="$LDFLAGS" LDFLAGS="$OTB_LDFLAGS" - echo $OTB_LDFLAGS - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "otbWrapperApplication.h"],[std::vector<std::string> list = otb::Wrapwper::ApplicationRegistry::GetAvailableApplication();]])], - [AC_MSG_RESULT([checking for GetAvailableApplication... yes])],[AC_MSG_ERROR([checking for GetAvailableApplication... failed])]) + #echo $OTB_LDFLAGS + #UVERS="$(echo -e '5.8\n$OTBVERS' | sort -r | head -n1)" + #if test "$OTBVERS" == "$UVERS" ; then + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "otbWrapperApplicationRegistry.h"]],[[std::vector<std::string> list = otb::Wrapper::ApplicationRegistry::GetAvailableApplications();]])], + [AC_MSG_RESULT([checking for GetAvailableApplications... yes])],[AC_MSG_ERROR([checking for GetAvailableApplications... failed])]) + #else + # AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "otbWrapperApplication.h"]],[[std::vector<std::string> list = otb::Wrapper::ApplicationRegistry::GetAvailableApplication();]])], + # [AC_MSG_RESULT([checking for GetAvailableApplication... yes])],[AC_MSG_ERROR([checking for GetAvailableApplication... failed])]) + #fi + LDFLAGS="$LDFLAGS_SAVE" AC_LANG_POP([C++]) AC_LANG(C++) diff --git a/zoo-project/zoo-kernel/request_parser.c b/zoo-project/zoo-kernel/request_parser.c index 1c60f3f..8c2b0b9 100644 --- a/zoo-project/zoo-kernel/request_parser.c +++ b/zoo-project/zoo-kernel/request_parser.c @@ -860,10 +860,28 @@ int xmlParseInputs(maps** main_conf,service* s,maps** request_output,xmlDocPtr d while (cur4 != NULL){ while(cur4 != NULL && cur4->type != XML_CDATA_SECTION_NODE && - cur4->type != XML_TEXT_NODE) + cur4->type != XML_TEXT_NODE && + cur4->type != XML_ELEMENT_NODE) cur4=cur4->next; if(cur4!=NULL){ - if(cur4->content!=NULL){ + if (cur4->type == XML_ELEMENT_NODE) + { + xmlChar *mv; + int buffersize; + xmlDocPtr doc1 = xmlNewDoc (BAD_CAST "1.0"); + xmlDocSetRootElement (doc1, cur4); + xmlDocDumpFormatMemoryEnc (doc1, &mv, + &buffersize, + "utf-8", 0); + if (tmpmaps->content != NULL) + addToMap (tmpmaps->content, "value", + (char *) mv); + else + tmpmaps->content = + createMap ("value", (char *) mv); + free(mv); + } + else{ if (tmpmaps->content != NULL) addToMap (tmpmaps->content, "value", (char *) cur4->content); diff --git a/zoo-project/zoo-kernel/server_internal.c b/zoo-project/zoo-kernel/server_internal.c index 9098c1d..c769948 100644 --- a/zoo-project/zoo-kernel/server_internal.c +++ b/zoo-project/zoo-kernel/server_internal.c @@ -790,24 +790,26 @@ char* addDefaultValues(maps** out,elements* in,maps* m,int type,map** err){ /** * check for useMapServer presence */ - map* tmpCheck=getMap(tmpIoType->content,"useMapServer"); - if(tmpCheck!=NULL){ - // Get the default value - tmpIoType=getIoTypeFromElement(tmpInputs,tmpInputs->name,NULL); - tmpCheck=getMap(tmpMaps->content,"mimeType"); - addToMap(tmpMaps->content,"requestedMimeType",tmpCheck->value); - map* cursor=tmpIoType->content; - while(cursor!=NULL){ - addToMap(tmpMaps->content,cursor->name,cursor->value); - cursor=cursor->next; - } - - cursor=tmpInputs->content; - while(cursor!=NULL){ - if(strcasecmp(cursor->name,"Title")==0 || - strcasecmp(cursor->name,"Abstract")==0) + if(tmpIoType!=NULL){ + map* tmpCheck=getMap(tmpIoType->content,"useMapServer"); + if(tmpCheck!=NULL){ + // Get the default value + tmpIoType=getIoTypeFromElement(tmpInputs,tmpInputs->name,NULL); + tmpCheck=getMap(tmpMaps->content,"mimeType"); + addToMap(tmpMaps->content,"requestedMimeType",tmpCheck->value); + map* cursor=tmpIoType->content; + while(cursor!=NULL){ addToMap(tmpMaps->content,cursor->name,cursor->value); - cursor=cursor->next; + cursor=cursor->next; + } + + cursor=tmpInputs->content; + while(cursor!=NULL){ + if(strcasecmp(cursor->name,"Title")==0 || + strcasecmp(cursor->name,"Abstract")==0) + addToMap(tmpMaps->content,cursor->name,cursor->value); + cursor=cursor->next; + } } } #endif diff --git a/zoo-project/zoo-kernel/service.c b/zoo-project/zoo-kernel/service.c index e6eaed0..8fc7f1d 100644 --- a/zoo-project/zoo-kernel/service.c +++ b/zoo-project/zoo-kernel/service.c @@ -634,7 +634,7 @@ bool contains(map* m,map* i){ */ iotype* getIoTypeFromElement(elements* e,char *name, map* values){ elements* cursor=e; - if(values!=NULL) + if(values!=NULL){ while(cursor!=NULL){ if(strcasecmp(cursor->name,name)==0 && (cursor->defaults!=NULL || cursor->supported!=NULL)){ if(contains(cursor->defaults->content,values)==true) @@ -650,6 +650,14 @@ iotype* getIoTypeFromElement(elements* e,char *name, map* values){ } cursor=cursor->next; } + }else{ + while(cursor!=NULL){ + if(strcasecmp(cursor->name,name)==0 && cursor->defaults!=NULL){ + return cursor->defaults; + } + cursor=cursor->next; + } + } return NULL; } -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/zoo-project.git _______________________________________________ Pkg-grass-devel mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel

