Package org.apache.qpid.server.security

Examples of org.apache.qpid.server.security.AccessControl


{
    public void testCreateInstanceWhenAclFileIsNotPresent()
    {
        DefaultAccessControlFactory factory = new DefaultAccessControlFactory();
        Map<String, Object> attributes = new HashMap<String, Object>();
        AccessControl acl = factory.createInstance(attributes, mock(EventLoggerProvider.class));
        assertNull("ACL was created without a configuration file", acl);
    }
View Full Code Here


        File aclFile = TestFileUtils.createTempFile(this, ".acl", "ACL ALLOW all all");
        DefaultAccessControlFactory factory = new DefaultAccessControlFactory();
        Map<String, Object> attributes = new HashMap<String, Object>();
        attributes.put(GroupProvider.TYPE, FileAccessControlProviderConstants.ACL_FILE_PROVIDER_TYPE);
        attributes.put(FileAccessControlProviderConstants.PATH, aclFile.getAbsolutePath());
        AccessControl acl = factory.createInstance(attributes, mock(EventLoggerProvider.class));
        acl.open();

        assertNotNull("ACL was not created from acl file: " + aclFile.getAbsolutePath(), acl);
    }
View Full Code Here

        Map<String, Object> attributes = new HashMap<String, Object>();
        attributes.put(GroupProvider.TYPE, FileAccessControlProviderConstants.ACL_FILE_PROVIDER_TYPE);
        attributes.put(FileAccessControlProviderConstants.PATH, aclFile.getAbsolutePath());
        try
        {
            AccessControl control = factory.createInstance(attributes, mock(EventLoggerProvider.class));
            control.open();
            fail("It should not be possible to create and initialise ACL with non existing file");
        }
        catch (IllegalConfigurationException e)
        {
            assertTrue("Unexpected exception message: " + e.getMessage(), Pattern.matches("ACL file '.*' is not found", e.getMessage()));
View Full Code Here

    private AccessControlProvider createAccessControlProvider(UUID id,
            Broker broker, Map<String, Object> attributes)
    {
        for (AccessControlFactory factory : _factories)
        {
            AccessControl accessControl = factory.createInstance(attributes);
            if (accessControl != null)
            {
                return new AccessControlProviderAdapter(id, broker,accessControl, attributes, factory.getAttributeNames());
            }
        }
View Full Code Here

{
    public void testCreateInstanceWhenAclFileIsNotPresent()
    {
        DefaultAccessControlFactory factory = new DefaultAccessControlFactory();
        Map<String, Object> attributes = new HashMap<String, Object>();
        AccessControl acl = factory.createInstance(attributes);
        assertNull("ACL was created without a configuration file", acl);
    }
View Full Code Here

        File aclFile = TestFileUtils.createTempFile(this, ".acl", "ACL ALLOW all all");
        DefaultAccessControlFactory factory = new DefaultAccessControlFactory();
        Map<String, Object> attributes = new HashMap<String, Object>();
        attributes.put(GroupProvider.TYPE, FileAccessControlProviderConstants.ACL_FILE_PROVIDER_TYPE);
        attributes.put(FileAccessControlProviderConstants.PATH, aclFile.getAbsolutePath());
        AccessControl acl = factory.createInstance(attributes);
        acl.open();

        assertNotNull("ACL was not created from acl file: " + aclFile.getAbsolutePath(), acl);
    }
View Full Code Here

        Map<String, Object> attributes = new HashMap<String, Object>();
        attributes.put(GroupProvider.TYPE, FileAccessControlProviderConstants.ACL_FILE_PROVIDER_TYPE);
        attributes.put(FileAccessControlProviderConstants.PATH, aclFile.getAbsolutePath());
        try
        {
            AccessControl control = factory.createInstance(attributes);
            control.open();
            fail("It should not be possible to create and initialise ACL with non existing file");
        }
        catch (IllegalConfigurationException e)
        {
            assertTrue("Unexpected exception message: " + e.getMessage(), Pattern.matches("ACL file '.*' is not found", e.getMessage()));
View Full Code Here

    private AccessControlProvider createAccessControlProvider(UUID id,
            Broker broker, Map<String, Object> attributes)
    {
        for (AccessControlFactory factory : _factories)
        {
            AccessControl accessControl = factory.createInstance(attributes, broker);
            if (accessControl != null)
            {
                return new AccessControlProviderAdapter(id, broker,accessControl, attributes, factory.getAttributeNames());
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.security.AccessControl

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.