Code example for Document

Methods: getDocumentElement

0
    /** 
     * Test whether GetCapabilities returns wfs:WFS_Capabilities. 
     */ 
    public void testGetCapabilities() { 
        Document doc = getAsDOM("wfs?request=GetCapabilities");
        LOGGER.info("WFS GetCapabilities response:\n" + prettyString(doc));
        assertEquals("wfs:WFS_Capabilities", doc.getDocumentElement().getNodeName());
        // make sure non-feature types don't appear in FeatureTypeList 
        assertXpathCount(1, "//wfs:FeatureType", doc);
        ArrayList<String> featureTypeNames = new ArrayList<String>(1);
        featureTypeNames.add(evaluate("//wfs:FeatureType[1]/wfs:Name", doc));
        // ERM 
        assertTrue(featureTypeNames.contains("ex:ERM"));
    } 
 
    /** 
     * Test whether GetFeature returns wfs:FeatureCollection. 
     */ 
    public void testGetFeature() { 
        Document doc = getAsDOM("wfs?request=GetFeature&typename=ex:ERM");
        LOGGER.info("WFS GetFeature&typename=ex:ERM response:\n" + prettyString(doc));