Package org.dom4j

Examples of org.dom4j.Document.selectNodes()


            }
            logger.info( Messages.getInstance().getString(
                "VersionCheck.UPDATE_MESSAGE", title, version, type, downloadurl ) ); //$NON-NLS-1$
          }

          nodes = doc.selectNodes( "//error" ); //$NON-NLS-1$
          nodeIter = nodes.iterator();
          while ( nodeIter.hasNext() ) {
            Element errorElement = (Element) nodeIter.next();
            String message = errorElement.getText();
            logger.info( Messages.getInstance().getString( "VersionCheck.ERROR_MESSAGE", message ) ); //$NON-NLS-1$
View Full Code Here


      if(calculatedFieldsFile != null && calculatedFieldsFile.exists()) {
             
        document = guardedRead(calculatedFieldsFile);
        Assert.assertNotNull(document, "Document cannot be null");
         
        calculatedFieldNodes = document.selectNodes("//" + ROOT_TAG + "/" + FIELD_TAG + "");
        logger.debug("Found [" + calculatedFieldNodes.size() + "] calculated field/s");
       
        it = calculatedFieldNodes.iterator();       
        while (it.hasNext()) {
          calculatedFieldNode = (Node) it.next();
View Full Code Here

        String ct = reply.getInboundProperty(HttpConstants.HEADER_CONTENT_TYPE, StringUtils.EMPTY);
        assertEquals("text/xml; charset=UTF-8", ct);

        Document document = DocumentHelper.parseText(reply.getPayloadAsString());
        List<?> fault = document.selectNodes("//soap:Envelope/soap:Body/soap:Fault/faultcode");

        assertEquals(1, fault.size());
        Element faultCodeElement = (Element) fault.get(0);

        assertEquals("soap:Client", faultCodeElement.getStringValue());
View Full Code Here

        assertEquals(1, fault.size());
        Element faultCodeElement = (Element) fault.get(0);

        assertEquals("soap:Client", faultCodeElement.getStringValue());

        fault = document.selectNodes("//soap:Envelope/soap:Body/soap:Fault/faultstring");
        assertEquals(1, fault.size());
        Element faultStringElement = (Element) fault.get(0);
        assertEquals("Message part {http://www.muleumo.org}ssss was not recognized.  (Does it exist in service WSDL?)",
            faultStringElement.getStringValue());
    }
View Full Code Here

        String location = "http://localhost:" + jettyPort.getNumber() + "/services/mycomponent";

        Document document = new SAXReader().read(wsdlStream);

        List nodes = document.selectNodes("//wsdl:definitions/wsdl:service");
        assertEquals("Callable", ((Element) nodes.get(0)).attribute("name").getStringValue());
        nodes = document.selectNodes("//wsdl:definitions/wsdl:service/wsdl:port/soap:address");
        assertEquals(location, ((Element) nodes.get(0)).attribute("location").getStringValue());
    }
View Full Code Here

        Document document = new SAXReader().read(wsdlStream);

        List nodes = document.selectNodes("//wsdl:definitions/wsdl:service");
        assertEquals("Callable", ((Element) nodes.get(0)).attribute("name").getStringValue());
        nodes = document.selectNodes("//wsdl:definitions/wsdl:service/wsdl:port/soap:address");
        assertEquals(location, ((Element) nodes.get(0)).attribute("location").getStringValue());
    }

    @Test
    public void testRequestWsdlWithHttp() throws Exception
View Full Code Here

    {
        String location = "http://localhost:" + httpPort.getNumber() + "/cxfService";
        InputStream wsdlStream = new URL(location + "?wsdl").openStream();

        Document document = new SAXReader().read(wsdlStream);
        List nodes = document.selectNodes("//wsdl:definitions/wsdl:service");
        assertEquals(((Element) nodes.get(0)).attribute("name").getStringValue(), "Callable");

        nodes = document.selectNodes("//wsdl:definitions/wsdl:service/wsdl:port/soap:address");
        assertEquals(location, ((Element) nodes.get(0)).attribute("location").getStringValue());
    }
View Full Code Here

        Document document = new SAXReader().read(wsdlStream);
        List nodes = document.selectNodes("//wsdl:definitions/wsdl:service");
        assertEquals(((Element) nodes.get(0)).attribute("name").getStringValue(), "Callable");

        nodes = document.selectNodes("//wsdl:definitions/wsdl:service/wsdl:port/soap:address");
        assertEquals(location, ((Element) nodes.get(0)).attribute("location").getStringValue());
    }

}
View Full Code Here

        assertNotNull(reply);
        assertNotNull(reply.getPayload());

        Document document = DocumentHelper.parseText(reply.getPayloadAsString());

        List<?> nodes = document.selectNodes("//wsdl:definitions/wsdl:service");
        assertEquals("CxfService", ((Element) nodes.get(0)).attribute("name").getStringValue());
    }

    @Override
    protected String getConfigFile()
View Full Code Here

    ResourceLoader resourceLoader = new ResourceLoader("collection/test-collections.xml");
    Document document = resourceLoader.getDocument();
   
    //get collection list
    @SuppressWarnings("unchecked")
    List<Element> collectionList = document.selectNodes("//collection");
   
    System.out.println(collectionList);
   
    for(Element node : collectionList) {
      System.out.println(node.elementText("analyzer"));
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.