Package org.geoserver.wfs

Examples of org.geoserver.wfs.WFSInfo


   
    @Override
    protected void setUpInternal(SystemTestData dataDirectory) throws Exception {
     
      //temp hack until feature bounding for 3D is fixed.
      WFSInfo wfs = getWFS();
      wfs.setFeatureBounding(false);
      getGeoServer().save(wfs);
     
        // add extra types
        dataDirectory.addVectorLayer(
                new QName( SystemTestData.SF_URI, "With3D", SystemTestData.SF_PREFIX ),                
View Full Code Here


        testData.addVectorLayer(STREAMS, new HashMap<LayerProperty,Object>(), "Streams.properties", MockData.class, getCatalog());
    }
   
    @Before
    public void oneTimeSetUp() throws Exception {
        WFSInfo wfs = getGeoServer().getService( WFSInfo.class );
        wfs.setFeatureBounding(true);
        getGeoServer().save(wfs);
        // workaround for GEOS-5650
        getGeoServer().save(getGeoServer().getService(WPSInfo.class));
    }
View Full Code Here

public class GetFeatureBboxTest extends WFSTestSupport {
   
    @Test
    public void testFeatureBoudingOn() throws Exception {
        WFSInfo wfs = getWFS();
        wfs.setFeatureBounding( true );
        getGeoServer().save( wfs );

        Document doc = getAsDOM("wfs?request=GetFeature&typeName=" + getLayerId(SystemTestData.BUILDINGS) + "&version=1.1.0&service=wfs&propertyName=ADDRESS");
        // print(doc);
       
View Full Code Here

       
    }
   
    @Test
    public void testFeatureBoudingOff() throws Exception {
        WFSInfo wfs = getWFS();
        wfs.setFeatureBounding( false );
        getGeoServer().save( wfs );
       
        Document doc = getAsDOM("wfs?request=GetFeature&typeName=" + getLayerId(SystemTestData.BUILDINGS) + "&version=1.1.0&service=wfs&propertyName=ADDRESS");
//        print(doc);
       
View Full Code Here

public class RestconfigWfsTest extends CatalogRESTTestSupport {

    @Override
    protected void onSetUp(org.geoserver.data.test.SystemTestData testData) throws Exception {
        super.onSetUp(testData);
        WFSInfo wfs = getGeoServer().getService(WFSInfo.class);
        wfs.setCanonicalSchemaLocation(true);
        wfs.setEncodeFeatureMember(true);
        getGeoServer().save(wfs);
        // disable schema caching in tests, as schemas are expected to provided on the classpath
        SchemaCache.disableAutomaticConfiguration();
    }
View Full Code Here

        assertEquals("0", doc.getDocumentElement().getAttribute("numberReturned"));
    }

    @Test
    public void testResultTypeHitsNumberMatched() throws Exception {
        WFSInfo wfs = getWFS();
        int oldMaxFeatures = wfs.getMaxFeatures();
        boolean hitsIgnoreMaxFeatures = wfs.isHitsIgnoreMaxFeatures();
       
        try {
            // we ignore max features for number matched, regardless of the hits ingore max features setting
            wfs.setMaxFeatures(1);
            wfs.setHitsIgnoreMaxFeatures(true);
            getGeoServer().save( wfs );

            Document doc = getAsDOM("wfs?request=GetFeature&typename=cdf:Seven&version=2.0.0&resultType=hits&service=wfs");
            assertGML32(doc);
            print(doc);
            assertEquals("7", doc.getDocumentElement().getAttribute("numberMatched"));
            assertEquals("0", doc.getDocumentElement().getAttribute("numberReturned"));
           
            // and we are consistent in the results mode too
            doc = getAsDOM("wfs?request=GetFeature&typename=cdf:Seven&version=2.0.0&resultType=results&service=wfs");
            assertGML32(doc);
            assertEquals("7", doc.getDocumentElement().getAttribute("numberMatched"));
            assertEquals("1", doc.getDocumentElement().getAttribute("numberReturned"));

            // try hits ignores max features the other way
            doc = getAsDOM("wfs?request=GetFeature&typename=cdf:Seven&version=2.0.0&resultType=hits&service=wfs");
            wfs.setHitsIgnoreMaxFeatures(false);
            getGeoServer().save( wfs );
            assertEquals("7", doc.getDocumentElement().getAttribute("numberMatched"));
            assertEquals("0", doc.getDocumentElement().getAttribute("numberReturned"));
           
            // and we are consistent in the results mode too
            doc = getAsDOM("wfs?request=GetFeature&typename=cdf:Seven&version=2.0.0&resultType=results&service=wfs");
            assertGML32(doc);
            assertEquals("7", doc.getDocumentElement().getAttribute("numberMatched"));
            assertEquals("1", doc.getDocumentElement().getAttribute("numberReturned"));
        } finally {
            wfs.setMaxFeatures(oldMaxFeatures);
            wfs.setHitsIgnoreMaxFeatures(hitsIgnoreMaxFeatures);
            getGeoServer().save( wfs );
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testNumReturnedMatchedWithMaxFeatures() throws Exception {
        WFSInfo wfs = getWFS();
        int oldMaxFeatures = wfs.getMaxFeatures();
        boolean oldHitsIgnoreMaxFeatures = wfs.isHitsIgnoreMaxFeatures();
       
        try {
           
            wfs.setMaxFeatures(1);
            wfs.setHitsIgnoreMaxFeatures(true);
            getGeoServer().save( wfs );

            Document doc = getAsDOM("wfs?request=GetFeature&typename=cdf:Seven&version=2.0.0&resultType=results&service=wfs");
            assertGML32(doc);

            assertEquals("7", doc.getDocumentElement().getAttribute("numberMatched"));
            assertEquals("1", doc.getDocumentElement().getAttribute("numberReturned"));

        } finally {
            wfs.setMaxFeatures(oldMaxFeatures);
            wfs.setHitsIgnoreMaxFeatures(oldHitsIgnoreMaxFeatures);
            getGeoServer().save( wfs );
        }
    }
View Full Code Here

//    }
//   
    @Test
    public void testPostWithBoundsEnabled() throws Exception {
        // enable feature bounds computation
        WFSInfo wfs = getWFS();
        boolean oldFeatureBounding = wfs.isFeatureBounding();
        wfs.setFeatureBounding(true);
        getGeoServer().save( wfs );
       
        try {
            String xml = "<wfs:GetFeature service='WFS' version='2.0.0' "
                + "xmlns:cdf='http://www.opengis.net/cite/data' "
                + "xmlns:fes='" + FES.NAMESPACE + "' "
                + "xmlns:wfs='" + WFS.NAMESPACE + "'> "
                + "<wfs:Query typeNames='cdf:Other'> "
                + "</wfs:Query> " + "</wfs:GetFeature>";
   
            Document doc = postAsDOM("wfs", xml);
            assertGML32(doc);
            NodeList aggregatedBoundList = doc.getElementsByTagName("wfs:boundedBy");
            assertFalse(aggregatedBoundList.getLength() == 0);
            NodeList features = doc.getElementsByTagName("cdf:Other");
            assertFalse(features.getLength() == 0);
   
            for (int i = 0; i < features.getLength(); i++) {
                Element feature = (Element) features.item(i);
                assertTrue(feature.hasAttribute("gml:id"));
                NodeList boundList = feature.getElementsByTagName("gml:boundedBy");
                assertEquals(1, boundList.getLength());
                Element boundedBy = (Element) boundList.item(0);
                NodeList boxList = boundedBy.getElementsByTagName("gml:Envelope");
                assertEquals(1, boxList.getLength());
                Element box = (Element) boxList.item(0);
                assertTrue(box.hasAttribute("srsName"));
            }
        } finally {
            wfs.setFeatureBounding(oldFeatureBounding);
            getGeoServer().save( wfs );
        }
    }
View Full Code Here

    }

    @Test
    public void testPostWithBoundsDisabled() throws Exception {
        // enable feature bounds computation
        WFSInfo wfs = getWFS();
        boolean oldFeatureBounding = wfs.isFeatureBounding();
        wfs.setFeatureBounding(false);
        getGeoServer().save( wfs );

        try {
            String xml = "<wfs:GetFeature service='WFS' version='2.0.0' "
                + "xmlns:cdf='http://www.opengis.net/cite/data' "
                + "xmlns:fes='" + FES.NAMESPACE + "' "
                + "xmlns:wfs='" + WFS.NAMESPACE + "'> "
                + "<wfs:Query typeNames='cdf:Other'> "
                + "</wfs:Query> " + "</wfs:GetFeature>";

            Document doc = postAsDOM("wfs", xml);
            assertGML32(doc);
            NodeList aggregatedBoundList = doc.getElementsByTagName("wfs:boundedBy");
            assertTrue(aggregatedBoundList.getLength() == 0);
            NodeList features = doc.getElementsByTagName("cdf:Other");
            assertFalse(features.getLength() == 0);

            for (int i = 0; i < features.getLength(); i++) {
                Element feature = (Element) features.item(i);
                assertTrue(feature.hasAttribute("gml:id"));
                NodeList boundList = feature.getElementsByTagName("gml:boundedBy");
                assertEquals(0, boundList.getLength());
            }
        } finally {
            wfs.setFeatureBounding(oldFeatureBounding);
            getGeoServer().save( wfs );
        }
    }
View Full Code Here

                "wfs?request=getfeature&typename=cdf:Fifteen&version=2.0.0&service=wfs&outputFormat=application/gml%2Bxml; version%3D3.2");
    }

    @Test
    public void testGMLAttributeMapping() throws Exception {
        WFSInfo wfs = getWFS();
        GMLInfo gml = wfs.getGML().get(WFSInfo.Version.V_11);
        gml.setOverrideGMLAttributes(false);
        getGeoServer().save(wfs);
       
        Document dom = getAsDOM("ows?service=WFS&version=2.0.0&request=GetFeature" +
                "&typename=" + getLayerId(MockData.PRIMITIVEGEOFEATURE));
View Full Code Here

TOP

Related Classes of org.geoserver.wfs.WFSInfo

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.