<html>
<head>
    <script src="../OLLoader.js"></script>
    <script type="text/javascript">

    function test_read_WPSExecuteResponse(t) {
        //t.plan(1);

        var parser = new OpenLayers.Format.WPSExecute();
        var text =
'<wps:ExecuteResponse 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_response.xsd" service="WPS" version="1.0.0" xml:lang="en-CA" serviceInstance="http://foo.bar/foo" statusLocation="http://foo.bar/execute_response_url.xml">'+
        '<wps:Process wps:processVersion="1">'+
                '<ows:Identifier>Buffer</ows:Identifier>'+
                '<ows:Title>Create a buffer around a polygon.</ows:Title>'+
                '<ows:Abstract>String</ows:Abstract>'+
                '<wps:Profile>OGC:WPS:Buffer</wps:Profile>'+
                '<wps:WSDL xlink:href="http://foo.bar/foo"/>'+
        '</wps:Process>'+
        '<wps:Status creationTime="2007-04-18T12:13:14Z">'+
                '<wps:ProcessSucceeded/>'+
        '</wps:Status>'+
        '<wps:ProcessOutputs>'+
                '<wps:Output>'+
                        '<ows:Identifier>BufferedPolygon</ows:Identifier>'+
                        '<ows:Title>Area serviced by playground.</ows:Title>'+
                        '<ows:Abstract>Area within which most users of this playground will live.</ows:Abstract>'+
                        '<wps:Reference href="http://foo.bar/buffered_polygon.xml" mimeType="text/xml" encoding="UTF-8" schema="http://foo.bar/gml_polygon_schema.xsd"/>'+
                '</wps:Output>'+
                '<wps:Output>'+
                        '<ows:Identifier>Distance</ows:Identifier>'+
                        '<ows:Title>Area serviced by playground.</ows:Title>'+
                        '<ows:Abstract>Area within which most users of this playground will live.</ows:Abstract>'+
                        '<wps:Data>'+
                            '<wps:LiteralData dataType="float" uom="m">400.3</wps:LiteralData>'+
                        '</wps:Data>'+
                '</wps:Output>'+
                '<wps:Output>'+
                        '<ows:Identifier>AnotherDistance</ows:Identifier>'+
                        '<ows:Title>Area serviced by playground.</ows:Title>'+
                        '<ows:Abstract>Area within which most users of this playground will live.</ows:Abstract>'+
                        '<wps:ComplexData mimeType="text/xml" schema="http://schemas.opengeospatial.org/gml/" encoding="utf-8">'+
                            '<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs">'+
                                '<gml:featureMember xmlns:gml="http://www.opengis.net/gml">'+
                                    '<feature:features xmlns:feature="http://mapserver.gis.umn.edu/mapserver" fid="OpenLayers.Feature.Vector_607">'+
                                        '<feature:geometry>'+
                                            '<gml:LineString>'+
                                                '<gml:coordinates decimal="." cs="," ts=" ">3092116.8565466,3142415.7949081 3109755.7359104,2269291.2663954 3109755.7359104,2269291.2663954</gml:coordinates>'+
                                            '</gml:LineString>'+
                                        '</feature:geometry>'+
                                    '</feature:features>'+
                                '</gml:featureMember>'+
                                '</wfs:FeatureCollection>'+
                        '</wps:ComplexData>'+
                '</wps:Output>'+
                '<wps:Output>'+
                        '<ows:Identifier>Raster</ows:Identifier>'+
                        '<ows:Title>Some BIG raster</ows:Title>'+
                        '<wps:ComplexData mimeType="image/gif" encoding="base64">'+
                        '<![CDATA[R0lGODlhAgACAIABAAAAAP///yH+EUNyZWF0ZWQgd2l0aCBHSU1QACwAAAAAAgACAAACA0QCBQA7]]>'+
                        '</wps:ComplexData>'+
                '</wps:Output>'+
                '<wps:Output>'+
                        '<ows:Identifier>BBox</ows:Identifier>'+
                        '<ows:Title>Bounds of buffer</ows:Title>'+
                        '<ows:Abstract>Bounds of buffer</ows:Abstract>'+
                        '<wps:BoundingBoxData crs="epsg:4326" dimensions="2">'+
                            '<ows:LowerCorner>0 0</ows:LowerCorner>'+
                            '<ows:UpperCorner>2 2</ows:UpperCorner>'+
                        '</wps:BoundingBoxData>'+
                '</wps:Output>'+
        '</wps:ProcessOutputs>'+
'</wps:ExecuteResponse>'
;

        var res = parser.read(text);

        console.log(res);
    }

    </script>
</head>
<body onload="test_read_WPSExecuteResponse()">
</body>
</html>