Package org.apache.qpid.server.security.access.firewall

Examples of org.apache.qpid.server.security.access.firewall.FirewallRule


                && addressOfClientMatches(ruleAction, addressOfClient);
    }

    private boolean addressOfClientMatches(AclAction ruleAction, InetAddress addressOfClient)
    {
        FirewallRule firewallRule = ruleAction.getFirewallRule();
        if(firewallRule == null || addressOfClient == null)
        {
            return true;
        }
        else
        {
            return firewallRule.matches(addressOfClient);
        }
    }
View Full Code Here


        assertTrue(_clientAction.matches(_ruleAction, _addressOfClient));
    }

    public void testMatches_returnsFalseWhenActionsDontMatch()
    {
        FirewallRule firewallRule = mock(FirewallRule.class);
        when(firewallRule.matches(_addressOfClient)).thenReturn(true);

        when(_action.matches(any(Action.class))).thenReturn(false);
        when(_ruleAction.getFirewallRule()).thenReturn(firewallRule);

        assertFalse(_clientAction.matches(_ruleAction, _addressOfClient));
View Full Code Here

        assertFalse(_clientAction.matches(_ruleAction, _addressOfClient));
    }

    public void testMatches_returnsTrueWhenActionsAndFirewallRuleMatch()
    {
        FirewallRule firewallRule = mock(FirewallRule.class);
        when(firewallRule.matches(_addressOfClient)).thenReturn(true);

        when(_action.matches(any(Action.class))).thenReturn(true);
        when(_ruleAction.getFirewallRule()).thenReturn(firewallRule);

        assertTrue(_clientAction.matches(_ruleAction, _addressOfClient));
View Full Code Here

        assertTrue(_clientAction.matches(_ruleAction, _addressOfClient));
    }

    public void testMatches_ignoresFirewallRuleIfClientAddressIsNull()
    {
        FirewallRule firewallRule = mock(FirewallRule.class);

        when(_action.matches(any(Action.class))).thenReturn(true);
        when(_ruleAction.getFirewallRule()).thenReturn(firewallRule);

        assertTrue(_clientAction.matches(_ruleAction, null));
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.security.access.firewall.FirewallRule

Copyright © 2018 www.massapicom. 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.