Package org.dom4j

Examples of org.dom4j.Node.selectNodes()


    @Test
    @Ignore("JBPAPP-9405 JACC 1.1 implementation must use exception list instead of missing method list for HTTP methods in the unchecked permissions")
    public void testHTTPMethodSubtraction(@ArquillianResource URL webAppURL) throws Exception {
        final Node node = getContextPolicyNode(webAppURL, WEBAPP_NAME);
        assertTrue("HTTP Method exception list must be used instead of method subtraction from 'big 7'.",
                node.selectNodes("UncheckedPermissions/Permission[@actions='GET,HEAD,OPTIONS,POST,TRACE']").isEmpty());
    }

    /**
     * Test handling of HTTP Method Exception list.
     */
 
View Full Code Here


    @Test
    @Ignore("JBPAPP-9400 - JACC permissions with HTTP method exception list are not correctly implemented")
    public void testHTTPMethodExceptionList(@ArquillianResource URL webAppURL) throws Exception {
        final Node node = getContextPolicyNode(webAppURL, WEBAPP_NAME);
        assertFalse("Can't find permissions with a HTTP Method exception list",
                node.selectNodes("UncheckedPermissions/Permission[@actions='!DELETE,GET,PUT']").isEmpty());
        assertFalse("Can't find permissions with a HTTP Method exception list",
                node.selectNodes("UncheckedPermissions/Permission[@actions='!DELETE,GET,POST,PUT']").isEmpty());
        assertFalse("Can't find permissions with a HTTP Method exception list",
                node.selectNodes("UncheckedPermissions/Permission[@actions='!DELETE,PUT']").isEmpty());
View Full Code Here

    public void testHTTPMethodExceptionList(@ArquillianResource URL webAppURL) throws Exception {
        final Node node = getContextPolicyNode(webAppURL, WEBAPP_NAME);
        assertFalse("Can't find permissions with a HTTP Method exception list",
                node.selectNodes("UncheckedPermissions/Permission[@actions='!DELETE,GET,PUT']").isEmpty());
        assertFalse("Can't find permissions with a HTTP Method exception list",
                node.selectNodes("UncheckedPermissions/Permission[@actions='!DELETE,GET,POST,PUT']").isEmpty());
        assertFalse("Can't find permissions with a HTTP Method exception list",
                node.selectNodes("UncheckedPermissions/Permission[@actions='!DELETE,PUT']").isEmpty());

        assertTrue("HTTP Method exception list should be constructed by using exclamation mark",
                node.selectNodes("UncheckedPermissions/Permission[@actions='GET,HEAD,OPTIONS,POST,TRACE']").isEmpty());
View Full Code Here

        assertFalse("Can't find permissions with a HTTP Method exception list",
                node.selectNodes("UncheckedPermissions/Permission[@actions='!DELETE,GET,PUT']").isEmpty());
        assertFalse("Can't find permissions with a HTTP Method exception list",
                node.selectNodes("UncheckedPermissions/Permission[@actions='!DELETE,GET,POST,PUT']").isEmpty());
        assertFalse("Can't find permissions with a HTTP Method exception list",
                node.selectNodes("UncheckedPermissions/Permission[@actions='!DELETE,PUT']").isEmpty());

        assertTrue("HTTP Method exception list should be constructed by using exclamation mark",
                node.selectNodes("UncheckedPermissions/Permission[@actions='GET,HEAD,OPTIONS,POST,TRACE']").isEmpty());
    }
View Full Code Here

                node.selectNodes("UncheckedPermissions/Permission[@actions='!DELETE,GET,POST,PUT']").isEmpty());
        assertFalse("Can't find permissions with a HTTP Method exception list",
                node.selectNodes("UncheckedPermissions/Permission[@actions='!DELETE,PUT']").isEmpty());

        assertTrue("HTTP Method exception list should be constructed by using exclamation mark",
                node.selectNodes("UncheckedPermissions/Permission[@actions='GET,HEAD,OPTIONS,POST,TRACE']").isEmpty());
    }

    /**
     * Test usage of qualified patterns.
     */
 
View Full Code Here

     * Test usage of qualified patterns.
     */
    @Test
    public void testQualifiedPatterns(@ArquillianResource URL webAppURL) throws Exception {
        final Node node = getContextPolicyNode(webAppURL, WEBAPP_NAME);
        assertTrue("Default pattern '/' must be qualified.", node.selectNodes("*/Permission[@name='/']").isEmpty());
        assertTrue("Qualified default pattern should not be present in ExcludedPermissions.",
                node.selectNodes("ExcludedPermissions/Permission[starts-with(@name,'/:')]").isEmpty());
        assertFalse("Qualified default pattern should be present in UncheckedPermissions.",
                node.selectNodes("UncheckedPermissions/Permission[starts-with(@name,'/:')]").isEmpty());
        assertTrue("Path prefix pattern must be qualified.", node.selectNodes("*/Permission[@name='/b/*']").isEmpty());
 
View Full Code Here

    @Test
    public void testQualifiedPatterns(@ArquillianResource URL webAppURL) throws Exception {
        final Node node = getContextPolicyNode(webAppURL, WEBAPP_NAME);
        assertTrue("Default pattern '/' must be qualified.", node.selectNodes("*/Permission[@name='/']").isEmpty());
        assertTrue("Qualified default pattern should not be present in ExcludedPermissions.",
                node.selectNodes("ExcludedPermissions/Permission[starts-with(@name,'/:')]").isEmpty());
        assertFalse("Qualified default pattern should be present in UncheckedPermissions.",
                node.selectNodes("UncheckedPermissions/Permission[starts-with(@name,'/:')]").isEmpty());
        assertTrue("Path prefix pattern must be qualified.", node.selectNodes("*/Permission[@name='/b/*']").isEmpty());
        assertTrue("Path prefix pattern must be qualified.", node.selectNodes("*/Permission[@name='/a/*']").isEmpty());
        assertTrue("Extension pattern must be qualified.", node.selectNodes("*/Permission[@name='*.asp']").isEmpty());
 
View Full Code Here

        final Node node = getContextPolicyNode(webAppURL, WEBAPP_NAME);
        assertTrue("Default pattern '/' must be qualified.", node.selectNodes("*/Permission[@name='/']").isEmpty());
        assertTrue("Qualified default pattern should not be present in ExcludedPermissions.",
                node.selectNodes("ExcludedPermissions/Permission[starts-with(@name,'/:')]").isEmpty());
        assertFalse("Qualified default pattern should be present in UncheckedPermissions.",
                node.selectNodes("UncheckedPermissions/Permission[starts-with(@name,'/:')]").isEmpty());
        assertTrue("Path prefix pattern must be qualified.", node.selectNodes("*/Permission[@name='/b/*']").isEmpty());
        assertTrue("Path prefix pattern must be qualified.", node.selectNodes("*/Permission[@name='/a/*']").isEmpty());
        assertTrue("Extension pattern must be qualified.", node.selectNodes("*/Permission[@name='*.asp']").isEmpty());
    }

View Full Code Here

        assertTrue("Default pattern '/' must be qualified.", node.selectNodes("*/Permission[@name='/']").isEmpty());
        assertTrue("Qualified default pattern should not be present in ExcludedPermissions.",
                node.selectNodes("ExcludedPermissions/Permission[starts-with(@name,'/:')]").isEmpty());
        assertFalse("Qualified default pattern should be present in UncheckedPermissions.",
                node.selectNodes("UncheckedPermissions/Permission[starts-with(@name,'/:')]").isEmpty());
        assertTrue("Path prefix pattern must be qualified.", node.selectNodes("*/Permission[@name='/b/*']").isEmpty());
        assertTrue("Path prefix pattern must be qualified.", node.selectNodes("*/Permission[@name='/a/*']").isEmpty());
        assertTrue("Extension pattern must be qualified.", node.selectNodes("*/Permission[@name='*.asp']").isEmpty());
    }

    // Private methods -------------------------------------------------------
View Full Code Here

        assertTrue("Qualified default pattern should not be present in ExcludedPermissions.",
                node.selectNodes("ExcludedPermissions/Permission[starts-with(@name,'/:')]").isEmpty());
        assertFalse("Qualified default pattern should be present in UncheckedPermissions.",
                node.selectNodes("UncheckedPermissions/Permission[starts-with(@name,'/:')]").isEmpty());
        assertTrue("Path prefix pattern must be qualified.", node.selectNodes("*/Permission[@name='/b/*']").isEmpty());
        assertTrue("Path prefix pattern must be qualified.", node.selectNodes("*/Permission[@name='/a/*']").isEmpty());
        assertTrue("Extension pattern must be qualified.", node.selectNodes("*/Permission[@name='*.asp']").isEmpty());
    }

    // Private methods -------------------------------------------------------

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.