Package org.dom4j

Examples of org.dom4j.Node.selectNodes()


                Node copyNode = (Node)copyNodes.get(i);
                String path = XmlUtils.getAttributeValue(copyNode, "path");
                if (!filesToDeploy.containsKey(path)) {
                    filesToDeploy.put(path, new ArrayList<String>());
                }
                final List targetPaths = copyNode.selectNodes("./target");
                if (null != targetPaths) {
                    for (int j = 0; j < targetPaths.size(); j++) {
                        Node targetPath = (Node)targetPaths.get(j);
                        filesToDeploy.get(path).add(targetPath.getText());
                    }
View Full Code Here


                Node projectNode = (Node)projectsNodes.get(i);
               
                project.path = XmlUtils.getAttributeValue(projectNode, "path");
                JavaUtils.checkDirectoryExists(project.path);
               
                List sources = projectNode.selectNodes("./sources");
                if (null != sources) {
                    for (int j = 0; j < sources.size(); j++) {
                        DeployerSourcesInfo sourcesInfo = new DeployerSourcesInfo();
                        Node sourcesNode = (Node)sources.get(j);
                        sourcesInfo.path = XmlUtils.getAttributeValue(sourcesNode, "path")
View Full Code Here

    String xpath = getXpath();
    if (xpath != null && result.size() > 0) {
      Object firstResult = result.get(0);
      if (firstResult instanceof Node) {
        Node resultNode = (Node) firstResult;
        result = resultNode.selectNodes(xpath);
      }
      else if (firstResult instanceof String) {
        try {
          Document doc = DocumentHelper.parseText((String) firstResult);
          result = doc.selectNodes(xpath);
View Full Code Here

     * @see #testHTTPMethodExceptionList(URL) for some other tests
     */
    @Test
    public void testHTTPMethodCanonical(@ArquillianResource URL webAppURL) throws Exception {
        final Node node = getContextPolicyNode(webAppURL, WEBAPP_NAME);
        assertTrue("HTTP Method names should be sorted alphabetically", node.selectNodes("*/Permission[@actions='PUT,DELETE']")
                .isEmpty());
        assertFalse("HTTP Method names should be sorted alphabetically", node
                .selectNodes("*/Permission[@actions='DELETE,PUT']").isEmpty());

        assertFalse("HTTP Method names should be sorted alphabetically",
View Full Code Here

    @Test
    public void testHTTPMethodCanonical(@ArquillianResource URL webAppURL) throws Exception {
        final Node node = getContextPolicyNode(webAppURL, WEBAPP_NAME);
        assertTrue("HTTP Method names should be sorted alphabetically", node.selectNodes("*/Permission[@actions='PUT,DELETE']")
                .isEmpty());
        assertFalse("HTTP Method names should be sorted alphabetically", node
                .selectNodes("*/Permission[@actions='DELETE,PUT']").isEmpty());

        assertFalse("HTTP Method names should be sorted alphabetically",
                node.selectNodes("RolePermissions/Role/Permission[@actions='GET,POST']").isEmpty());
        assertTrue("HTTP Method names should be sorted alphabetically",
View Full Code Here

                .isEmpty());
        assertFalse("HTTP Method names should be sorted alphabetically", node
                .selectNodes("*/Permission[@actions='DELETE,PUT']").isEmpty());

        assertFalse("HTTP Method names should be sorted alphabetically",
                node.selectNodes("RolePermissions/Role/Permission[@actions='GET,POST']").isEmpty());
        assertTrue("HTTP Method names should be sorted alphabetically",
                node.selectNodes("RolePermissions/Role/Permission[@actions='POST,GET']").isEmpty());
        assertFalse("HTTP Method names should be sorted alphabetically, followed by colon-separated transport guarantee", node
                .selectNodes("UncheckedPermissions/Permission[@actions='GET,POST:CONFIDENTIAL']").isEmpty());
    }
View Full Code Here

                .selectNodes("*/Permission[@actions='DELETE,PUT']").isEmpty());

        assertFalse("HTTP Method names should be sorted alphabetically",
                node.selectNodes("RolePermissions/Role/Permission[@actions='GET,POST']").isEmpty());
        assertTrue("HTTP Method names should be sorted alphabetically",
                node.selectNodes("RolePermissions/Role/Permission[@actions='POST,GET']").isEmpty());
        assertFalse("HTTP Method names should be sorted alphabetically, followed by colon-separated transport guarantee", node
                .selectNodes("UncheckedPermissions/Permission[@actions='GET,POST:CONFIDENTIAL']").isEmpty());
    }

    /**
 
View Full Code Here

        assertFalse("HTTP Method names should be sorted alphabetically",
                node.selectNodes("RolePermissions/Role/Permission[@actions='GET,POST']").isEmpty());
        assertTrue("HTTP Method names should be sorted alphabetically",
                node.selectNodes("RolePermissions/Role/Permission[@actions='POST,GET']").isEmpty());
        assertFalse("HTTP Method names should be sorted alphabetically, followed by colon-separated transport guarantee", node
                .selectNodes("UncheckedPermissions/Permission[@actions='GET,POST:CONFIDENTIAL']").isEmpty());
    }

    /**
     * Test usage of transport guarantee constraints.
View Full Code Here

    @Test
    public void testConnectionType(@ArquillianResource URL webAppURL) throws Exception {
        final Node node = getContextPolicyNode(webAppURL, WEBAPP_NAME);
        assertFalse(
                "WebUserDataPermission with the connection type :CONFIDENTIAL should be present in unchecked permissions ",
                node.selectNodes(
                        "UncheckedPermissions/Permission[ends-with(@type,'WebUserDataPermission') and @actions='GET:CONFIDENTIAL']")
                        .isEmpty());
        assertFalse(
                "WebUserDataPermission with the connection type :CONFIDENTIAL should be present in unchecked permissions ",
                node.selectNodes(
View Full Code Here

                node.selectNodes(
                        "UncheckedPermissions/Permission[ends-with(@type,'WebUserDataPermission') and @actions='GET:CONFIDENTIAL']")
                        .isEmpty());
        assertFalse(
                "WebUserDataPermission with the connection type :CONFIDENTIAL should be present in unchecked permissions ",
                node.selectNodes(
                        "UncheckedPermissions/Permission[ends-with(@type,'WebUserDataPermission') and @actions='GET,POST:CONFIDENTIAL']")
                        .isEmpty());
    }

    /**
 
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.