Package org.custommonkey.xmlunit

Examples of org.custommonkey.xmlunit.XpathEngine.evaluate()


        // the straight portion
        String basePath2 = "/gml:curveProperty/gml:Curve/gml:segments/gml:LineStringSegment";
        assertEquals(1, xpath.getMatchingNodes(basePath2 + "[@interpolation='linear']", dom)
                .getLength());
        assertEquals("7.0 3.0 10.0 15.0", xpath.evaluate(basePath2 + "/gml:posList", dom));

    }
}
View Full Code Here


        String basePath = "/gml:curveProperty/gml:Curve/gml:segments/gml:ArcString";
        assertEquals(1,
                xpath.getMatchingNodes(basePath + "[@interpolation='circularArc3Points']", dom)
                        .getLength());
        assertEquals("1.0 1.0 2.0 2.0 3.0 1.0 5.0 5.0 7.0 3.0",
                xpath.evaluate(basePath + "/gml:posList", dom));
    }

    public void testEncodeCompound() throws Exception {
        // create a compound curve
        CurvedGeometryFactory factory = new CurvedGeometryFactory(0.1);
View Full Code Here

        String basePath1 = "/gml:curveProperty/gml:Curve/gml:segments/gml:ArcString";
        assertEquals(1,
                xpath.getMatchingNodes(basePath1 + "[@interpolation='circularArc3Points']", dom)
                        .getLength());
        assertEquals("1.0 1.0 2.0 2.0 3.0 1.0 5.0 5.0 7.0 3.0",
                xpath.evaluate(basePath1 + "/gml:posList", dom));

        // the straight portion
        String basePath2 = "/gml:curveProperty/gml:Curve/gml:segments/gml:LineStringSegment";
        assertEquals(1, xpath.getMatchingNodes(basePath2 + "[@interpolation='linear']", dom)
                .getLength());
View Full Code Here

        // the straight portion
        String basePath2 = "/gml:curveProperty/gml:Curve/gml:segments/gml:LineStringSegment";
        assertEquals(1, xpath.getMatchingNodes(basePath2 + "[@interpolation='linear']", dom)
                .getLength());
        assertEquals("7.0 3.0 10.0 15.0", xpath.evaluate(basePath2 + "/gml:posList", dom));

    }
}
View Full Code Here

        String basePath = "/gml:geometryMember/gml:Curve/gml:segments/gml:ArcString";
        assertEquals(1,
                xpath.getMatchingNodes(basePath + "[@interpolation='circularArc3Points']", dom)
                        .getLength());
        assertEquals("1.0 1.0 2.0 2.0 3.0 1.0 5.0 5.0 7.0 3.0",
                xpath.evaluate(basePath + "/gml:posList", dom));
    }
}
View Full Code Here

        Document dom = postAsDOM("wfs", INSERT_RESTRICTED_STREET);
        // print(dom);
        assertXpathEvaluatesTo("1", "count(//wfs:WFS_TransactionResponse)", dom);
        assertXpathEvaluatesTo("1", "count(//wfs:Status/wfs:FAILED)", dom);
        XpathEngine xpath = XMLUnit.newXpathEngine();
        String message = xpath.evaluate("//wfs:Message", dom);
        assertTrue(message.matches(".*write restrictions.*"));
    }
   
    public void testInsertAttributeRestricted() throws Exception {
        authenticate("cite_writeatts", "cite");
View Full Code Here

        Document dom = postAsDOM("wfs", INSERT_RESTRICTED_STREET);
        // print(dom);
        assertXpathEvaluatesTo("1", "count(//wfs:WFS_TransactionResponse)", dom);
        assertXpathEvaluatesTo("1", "count(//wfs:Status/wfs:FAILED)", dom);
        XpathEngine xpath = XMLUnit.newXpathEngine();
        String message = xpath.evaluate("//wfs:Message", dom);
        assertTrue(message.matches(".*write protected.*ADDRESS.*"));
    }
   
    public void testUpdateNoLimits() throws Exception {
        authenticate("cite", "cite");
View Full Code Here

        // not sure why CITE tests make us throw an exception for this one instead of using
        // in transaction reporting...
        assertXpathEvaluatesTo("1", "count(//ows:ExceptionReport)", dom);
        XpathEngine xpath = XMLUnit.newXpathEngine();
        String message = xpath.evaluate("//ows:ExceptionText", dom);
        assertTrue(message.matches(".*write protected.*ADDRESS.*"));
    }
   
    public void testDeleteLimitWrite() throws Exception {
        authenticate("cite_writefilter", "cite");
View Full Code Here

        Document doc = getAsDOM("/wfs?request=GetFeature&typename=" + getLayerId(MockData.BASIC_POLYGONS)
                + "," + getLayerId(MockData.BRIDGES) + "&version=1.0.0&service=wfs");
        // print(doc);
       
        XpathEngine engine = XMLUnit.newXpathEngine();
        String schemaLocation = engine.evaluate("wfs:FeatureCollection/@xsi:schemaLocation", doc);
        assertNotNull(schemaLocation);
        String[] parsedLocations = schemaLocation.split("\\s+");
        // System.out.println(Arrays.toString(parsedLocations));
        int i = 0;
        for (; i < parsedLocations.length; i+=2) {
View Full Code Here

        assertXpathEvaluatesTo("128", "//kml/Folder/NetworkLink/Region/Lod/minLodPixels", dom);
        assertXpathEvaluatesTo("-1", "//kml/Folder/NetworkLink/Region/Lod/maxLodPixels", dom);

        final Map<String, String> expectedKvp = KMLReflectorTest.toKvp("http://geoserver.org:8181/geoserver/wms?format_options=relLinks%3Atrue%3B&service=wms&srs=EPSG%3A4326&width=512&styles=Default+Style&height=256&transparent=false&bbox=-1.0%2C-10.0%2C1.0%2C10.0&request=GetMap&layers=geos%3ATestPoints&format=image%2Fdummy&version=1.1.1");
        final Map<String, String> actualKvp = KMLReflectorTest.toKvp(xpath.evaluate(
        "//kml/Folder/NetworkLink/Link/href", dom));
        KMLReflectorTest.assertMapsEqual(expectedKvp, actualKvp);
        //GR: commenting out the bellow assertion, adding the viewRefreshMode element is commented out in KMLNetworkListTransformer
        //assertXpathEvaluatesTo("onRegion", "//kml/Folder/NetworkLink/Link/viewRefreshMode", dom);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.