Package org.geotools.data.wfs.v1_1_0

Examples of org.geotools.data.wfs.v1_1_0.AxisOrderTest


    }
   
    @Test
    public void tesGetFeatureReader() throws IOException {
        final InputStream dataStream = TestData.openStream(this, CUBEWERX_GOVUNITCE.DATA);
        TestHttpResponse httpResponse = new TestHttpResponse("text/xml; subtype=gml/3.1.1",
                "UTF-8", dataStream);
        TestHttpProtocol mockHttp = new TestHttpProtocol(httpResponse);
        createTestProtocol(CUBEWERX_GOVUNITCE.CAPABILITIES, mockHttp);

        // override the describe feature type url so it loads from the test resource
View Full Code Here


            fail("Expected IAE");
        } catch (IllegalArgumentException e) {
            assertTrue(true);
        }

        HTTPResponse httpResponse = new TestHttpResponse("text/xml; subtype=gml/3.1.1", null,
                "mock-content");
        TestHttpProtocol mockHttp = new TestHttpProtocol(httpResponse);

        createTestProtocol(GEOS_ARCHSITES.CAPABILITIES, mockHttp);
View Full Code Here

     */
    @Test
    public void testIssueGetFeature_GET() throws IOException {
        final InputStream responseContent = TestData.openStream(this, GEOS_ARCHSITES.DATA);

        final TestHttpResponse httpResponse;
        final String defaultWfs11OutputFormat = "text/xml; subtype=gml/3.1.1";
        httpResponse = new TestHttpResponse(defaultWfs11OutputFormat, "UTF-16", responseContent);

        TestHttpProtocol mockHttp = new TestHttpProtocol(httpResponse);

        createTestProtocol(GEOS_ARCHSITES.CAPABILITIES, mockHttp, new GeoServerStrategy());

View Full Code Here

     */
    @Test
    public void testIssueGetFeature_GET_HITS() throws IOException {
        final InputStream responseContent = TestData.openStream(this, GEOS_ARCHSITES.DATA);

        final TestHttpResponse httpResponse;
        final String defaultWfs11OutputFormat = "text/xml; subtype=gml/3.1.1";
        httpResponse = new TestHttpResponse(defaultWfs11OutputFormat, "UTF-16", responseContent);

        TestHttpProtocol mockHttp = new TestHttpProtocol(httpResponse);

        createTestProtocol(GEOS_ARCHSITES.CAPABILITIES, mockHttp, new GeoServerStrategy());

View Full Code Here

    @Test
    public void testIssueGetFeature_GET_OptionalParameters() throws Exception {

        final InputStream responseContent = TestData.openStream(this, GEOS_ARCHSITES.DATA);

        final TestHttpResponse httpResponse;
        final String defaultWfs11OutputFormat = "text/xml; subtype=gml/3.1.1";
        httpResponse = new TestHttpResponse(defaultWfs11OutputFormat, "UTF-16", responseContent);

        TestHttpProtocol mockHttp = new TestHttpProtocol(httpResponse);
        createTestProtocol(GEOS_ARCHSITES.CAPABILITIES, mockHttp, new GeoServerStrategy());

        Query query = new Query(GEOS_ARCHSITES.FEATURETYPENAME);
View Full Code Here

    @Test
    public void testIssueGetFeature_POST() throws IOException, ParserConfigurationException,
            SAXException {
        final InputStream responseContent = TestData.openStream(this, GEOS_ARCHSITES.DATA);

        final TestHttpResponse httpResponse;
        final String defaultWfs11OutputFormat = "text/xml; subtype=gml/3.1.1";
        httpResponse = new TestHttpResponse(defaultWfs11OutputFormat, "UTF-16", responseContent);

        TestHttpProtocol mockHttp = new TestHttpProtocol(httpResponse);
        createTestProtocol(GEOS_ARCHSITES.CAPABILITIES, mockHttp, new GeoServerStrategy());

        Query query = new Query(GEOS_ARCHSITES.FEATURETYPENAME);
View Full Code Here

            }
        }

        if (strategy == null) {
            // use fallback strategy
            strategy = new DefaultWFSStrategy();
        }
        logger.info("Using WFS Strategy: " + strategy.getClass().getName());
        return strategy;
    }
View Full Code Here

    static WFSStrategy determineCorrectStrategy(URL getCapabilitiesRequest, Document capabilitiesDoc, String override) {
        WFSStrategy strategy = null;
        // override
        if( override != null ){
            if( override.equalsIgnoreCase("geoserver")){
                strategy = new GeoServerStrategy();
            }
            else if( override.equalsIgnoreCase("mapserver")){
                strategy = new MapServerStrategy();
            }
            else if( override.equalsIgnoreCase("arcgis")){
                strategy = new ArcGISServerStrategy();
            }
            else if( override.equalsIgnoreCase("cubewerx")){
                strategy = new CubeWerxStrategy();
            }
            else if( override.equalsIgnoreCase("ionic")){
                strategy = new IonicStrategy();
            }
            else {
                logger.warning("Could not handle wfs strategy override "+override+" proceeding with autodetection");
            }
        }
        // auto detection
        if( strategy == null ){
            // look in comments for indication of CubeWerx server       
            NodeList childNodes = capabilitiesDoc.getChildNodes();
            for (int i = 0; i < childNodes.getLength(); i++) {
                Node child = childNodes.item(i);
                if (child.getNodeType() == Node.COMMENT_NODE) {
                    String nodeValue = child.getNodeValue();
                    nodeValue = nodeValue.toLowerCase();
                    if (nodeValue.contains("cubewerx")) {
                        strategy = new CubeWerxStrategy();
                        break;
                    }
                }
            }
        }

        if (strategy == null) {
            // Ionic declares its own namespace so that's our hook
            Element root = capabilitiesDoc.getDocumentElement();
            String ionicNs = root.getAttribute("xmlns:ionic");
            if (ionicNs != null) {
                if (ionicNs.equals("http://www.ionicsoft.com/versions/4")) {
                    strategy = new IonicStrategy();
                } else if (ionicNs.startsWith("http://www.ionicsoft.com/versions")) {
                    logger
                            .warning("Found a Ionic server but the version may not match the strategy "
                                    + "we have (v.4). Ionic namespace url: " + ionicNs);
                    strategy = new IonicStrategy();
                }
            }
        }

        if (strategy == null) {
            // guess server implementation from capabilities URI
            String uri = getCapabilitiesRequest.toExternalForm();
            if (uri.contains("geoserver")) {
                strategy = new GeoServerStrategy();
            }else if (uri.contains("/ArcGIS/services/")){
                strategy = new ArcGISServerStrategy();
            }
        }
View Full Code Here

            }
            else if( override.equalsIgnoreCase("cubewerx")){
                strategy = new CubeWerxStrategy();
            }
            else if( override.equalsIgnoreCase("ionic")){
                strategy = new IonicStrategy();
            }
            else {
                logger.warning("Could not handle wfs strategy override "+override+" proceeding with autodetection");
            }
        }
        // auto detection
        if( strategy == null ){
            // look in comments for indication of CubeWerx server       
            NodeList childNodes = capabilitiesDoc.getChildNodes();
            for (int i = 0; i < childNodes.getLength(); i++) {
                Node child = childNodes.item(i);
                if (child.getNodeType() == Node.COMMENT_NODE) {
                    String nodeValue = child.getNodeValue();
                    nodeValue = nodeValue.toLowerCase();
                    if (nodeValue.contains("cubewerx")) {
                        strategy = new CubeWerxStrategy();
                        break;
                    }
                }
            }
        }

        if (strategy == null) {
            // Ionic declares its own namespace so that's our hook
            Element root = capabilitiesDoc.getDocumentElement();
            String ionicNs = root.getAttribute("xmlns:ionic");
            if (ionicNs != null) {
                if (ionicNs.equals("http://www.ionicsoft.com/versions/4")) {
                    strategy = new IonicStrategy();
                } else if (ionicNs.startsWith("http://www.ionicsoft.com/versions")) {
                    logger
                            .warning("Found a Ionic server but the version may not match the strategy "
                                    + "we have (v.4). Ionic namespace url: " + ionicNs);
                    strategy = new IonicStrategy();
                }
            }
        }

        if (strategy == null) {
View Full Code Here

        if( override != null ){
            if( override.equalsIgnoreCase("geoserver")){
                strategy = new GeoServerStrategy();
            }
            else if( override.equalsIgnoreCase("mapserver")){
                strategy = new MapServerStrategy();
            }
            else if( override.equalsIgnoreCase("arcgis")){
                strategy = new ArcGISServerStrategy();
            }
            else if( override.equalsIgnoreCase("cubewerx")){
View Full Code Here

TOP

Related Classes of org.geotools.data.wfs.v1_1_0.AxisOrderTest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.