org.apache.qpid.server.security.acl
Class SimpleACLTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.qpid.test.utils.QpidTestCase
              extended by org.apache.qpid.test.utils.QpidBrokerTestCase
                  extended by org.apache.qpid.server.security.acl.AbstractACLTestCase
                      extended by org.apache.qpid.server.security.acl.SimpleACLTest
All Implemented Interfaces:
junit.framework.Test, org.apache.qpid.jms.ConnectionListener
Direct Known Subclasses:
ExternalACLTest

public class SimpleACLTest
extends AbstractACLTestCase

Basic access control list tests. These tests require an access control security plugin to be configured in the broker, and carry out various broker operations that will succeed or fail depending on the user and virtual host. See the config-systests-acl-setup.xml configuration file for the SimpleXML version of the ACLs used by the Java broker only, or the various .txt files in the system tests directory for the external version 3 ACL files used by both the Java and C++ brokers.

This class can be extended and the AbstractACLTestCase.getConfig() method overridden to run the same tests with a different type of access control mechanism. Extension classes should differ only in the configuration file used, but extra tests can be added that are specific to a particular configuration.

The tests perform basic AMQP operations like creating queues or excahnges and publishing and consuming messages, using JMS to contact the broker.

See Also:
ExternalACLTest

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase
QpidBrokerTestCase.MessageType
 
Field Summary
 
Fields inherited from class org.apache.qpid.server.security.acl.AbstractACLTestCase
_exceptionReceived
 
Fields inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase
_broker, _brokerLanguage, _brokerLogPrefix, _brokerOutputStream, _brokerPersistent, _brokers, _configFile, _connectionFactory, _connections, _initialContext, _interleaveBrokerLog, _logger, _output, _outputFile, _testName, BROKER_READY, CONTENT, CPP, DEFAULT_MANAGEMENT_PORT, DEFAULT_MESSAGE_SIZE, DEFAULT_PORT, DEFAULT_SSL_PORT, DEFAULT_VM_PORT, EXTERNAL, INDEX, JAVA, LOGMONITOR_TIMEOUT, QPID_HOME, QpidHome, QUEUE, RECEIVE_TIMEOUT, TOPIC, VM
 
Fields inherited from class org.apache.qpid.test.utils.QpidTestCase
MEMORY_STORE_CLASS_NAME, MS_CLASS_NAME_KEY
 
Constructor Summary
SimpleACLTest()
           
 
Method Summary
 void testAccessAuthorizedSuccess()
           
 void testAccessNoRightsFailure()
           
 void testAccessVhostAuthorisedGuestSuccess()
           
 void testClientConsumeFromNamedQueueFailure()
           
 void testClientConsumeFromTempQueueSuccess()
           
 void testClientCreateNamedQueueFailure()
           
 void testClientCreateTemporaryQueueSuccess()
           
 void testClientDeleteQueueSuccess()
           
 void testClientPublishInvalidQueueSuccess()
           
 void testClientPublishUsingTransactionSuccess()
           
 void testClientPublishValidQueueSuccess()
           
 void testServerConsumeFromNamedQueueInvalid()
           
 void testServerConsumeFromNamedQueueValid()
           
 void testServerConsumeFromTemporaryQueue()
           
 void testServerCreateAutoDeleteQueueInvalid()
           
 void testServerCreateNamedQueueInvalid()
           
 void testServerCreateNamedQueueValid()
           
 void testServerCreateTemporaryQueueInvalid()
           
 void testServerDeleteQueueFailure()
           
 void testServerPublishInvalidQueueSuccess()
           
 void testServerPublishUsingTransactionSuccess()
          This test uses both the cilent and sender to validate that the Server is able to publish to a temporary queue.
 
Methods inherited from class org.apache.qpid.server.security.acl.AbstractACLTestCase
bytesReceived, bytesSent, check403Exception, createConnectionURL, failoverComplete, getConfig, getConnection, getHostList, preFailover, preResubscribe, setUp, setUpACLFile, tearDown, writeACLFile
 
Methods inherited from class org.apache.qpid.test.utils.QpidBrokerTestCase
cleanBroker, createMessage, createNextMessage, drainQueue, getBroker, getBrokerCommand, getClientConnection, getConfigurationStringProperty, getConnection, getConnection, getConnection, getConnectionFactory, getConnectionFactory, getConnectionURL, getInitialContext, getLogger, getManagementPort, getMessageSize, getPort, getPort, getTestConfigFile, getTestQueue, getTestQueueName, getTestVirtualhostsFile, isBroker010, isBroker08, isBrokerStorePersistent, isCppBroker, isExternalBroker, isJavaBroker, makeVirtualHostPersistent, reloadBrokerSecurityConfig, restartBroker, restartBroker, revertLoggingLevels, revertSystemProperties, runBare, saveTestConfiguration, saveTestVirtualhosts, sendMessage, sendMessage, sendMessage, setBrokerEnvironment, setBrokerOnlySystemProperty, setConfigurationProperty, setLoggerLevel, setMessageSize, setSystemProperty, setSystemProperty, setTestClientSystemProperty, startBroker, startBroker, stopBroker, stopBroker
 
Methods inherited from class org.apache.qpid.test.utils.QpidTestCase
getTestProfileMessageStoreClassName, run
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleACLTest

public SimpleACLTest()
Method Detail

testAccessAuthorizedSuccess

public void testAccessAuthorizedSuccess()
                                 throws org.apache.qpid.AMQException,
                                        org.apache.qpid.url.URLSyntaxException,
                                        Exception
Throws:
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
Exception

testAccessVhostAuthorisedGuestSuccess

public void testAccessVhostAuthorisedGuestSuccess()
                                           throws IOException,
                                                  Exception
Throws:
IOException
Exception

testAccessNoRightsFailure

public void testAccessNoRightsFailure()
                               throws Exception
Throws:
Exception

testClientDeleteQueueSuccess

public void testClientDeleteQueueSuccess()
                                  throws Exception
Throws:
Exception

testServerDeleteQueueFailure

public void testServerDeleteQueueFailure()
                                  throws Exception
Throws:
Exception

testClientConsumeFromTempQueueSuccess

public void testClientConsumeFromTempQueueSuccess()
                                           throws org.apache.qpid.AMQException,
                                                  org.apache.qpid.url.URLSyntaxException,
                                                  Exception
Throws:
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
Exception

testClientConsumeFromNamedQueueFailure

public void testClientConsumeFromNamedQueueFailure()
                                            throws NamingException,
                                                   Exception
Throws:
NamingException
Exception

testClientCreateTemporaryQueueSuccess

public void testClientCreateTemporaryQueueSuccess()
                                           throws JMSException,
                                                  org.apache.qpid.url.URLSyntaxException,
                                                  Exception
Throws:
JMSException
org.apache.qpid.url.URLSyntaxException
Exception

testClientCreateNamedQueueFailure

public void testClientCreateNamedQueueFailure()
                                       throws NamingException,
                                              JMSException,
                                              org.apache.qpid.AMQException,
                                              Exception
Throws:
NamingException
JMSException
org.apache.qpid.AMQException
Exception

testClientPublishUsingTransactionSuccess

public void testClientPublishUsingTransactionSuccess()
                                              throws org.apache.qpid.AMQException,
                                                     org.apache.qpid.url.URLSyntaxException,
                                                     Exception
Throws:
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
Exception

testClientPublishValidQueueSuccess

public void testClientPublishValidQueueSuccess()
                                        throws org.apache.qpid.AMQException,
                                               org.apache.qpid.url.URLSyntaxException,
                                               Exception
Throws:
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
Exception

testClientPublishInvalidQueueSuccess

public void testClientPublishInvalidQueueSuccess()
                                          throws org.apache.qpid.AMQException,
                                                 org.apache.qpid.url.URLSyntaxException,
                                                 JMSException,
                                                 NamingException,
                                                 Exception
Throws:
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
JMSException
NamingException
Exception

testServerConsumeFromNamedQueueValid

public void testServerConsumeFromNamedQueueValid()
                                          throws org.apache.qpid.AMQException,
                                                 org.apache.qpid.url.URLSyntaxException,
                                                 Exception
Throws:
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
Exception

testServerConsumeFromNamedQueueInvalid

public void testServerConsumeFromNamedQueueInvalid()
                                            throws org.apache.qpid.AMQException,
                                                   org.apache.qpid.url.URLSyntaxException,
                                                   NamingException,
                                                   Exception
Throws:
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
NamingException
Exception

testServerConsumeFromTemporaryQueue

public void testServerConsumeFromTemporaryQueue()
                                         throws org.apache.qpid.AMQException,
                                                org.apache.qpid.url.URLSyntaxException,
                                                NamingException,
                                                Exception
Throws:
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
NamingException
Exception

testServerCreateNamedQueueValid

public void testServerCreateNamedQueueValid()
                                     throws JMSException,
                                            org.apache.qpid.url.URLSyntaxException,
                                            Exception
Throws:
JMSException
org.apache.qpid.url.URLSyntaxException
Exception

testServerCreateNamedQueueInvalid

public void testServerCreateNamedQueueInvalid()
                                       throws JMSException,
                                              org.apache.qpid.url.URLSyntaxException,
                                              org.apache.qpid.AMQException,
                                              NamingException,
                                              Exception
Throws:
JMSException
org.apache.qpid.url.URLSyntaxException
org.apache.qpid.AMQException
NamingException
Exception

testServerCreateTemporaryQueueInvalid

public void testServerCreateTemporaryQueueInvalid()
                                           throws NamingException,
                                                  Exception
Throws:
NamingException
Exception

testServerCreateAutoDeleteQueueInvalid

public void testServerCreateAutoDeleteQueueInvalid()
                                            throws NamingException,
                                                   JMSException,
                                                   org.apache.qpid.AMQException,
                                                   Exception
Throws:
NamingException
JMSException
org.apache.qpid.AMQException
Exception

testServerPublishUsingTransactionSuccess

public void testServerPublishUsingTransactionSuccess()
                                              throws org.apache.qpid.AMQException,
                                                     org.apache.qpid.url.URLSyntaxException,
                                                     JMSException,
                                                     NamingException,
                                                     Exception
This test uses both the cilent and sender to validate that the Server is able to publish to a temporary queue. The reason the client must be involved is that the Server is unable to create its own Temporary Queues.

Throws:
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
JMSException
NamingException
Exception

testServerPublishInvalidQueueSuccess

public void testServerPublishInvalidQueueSuccess()
                                          throws org.apache.qpid.AMQException,
                                                 org.apache.qpid.url.URLSyntaxException,
                                                 JMSException,
                                                 NamingException,
                                                 Exception
Throws:
org.apache.qpid.AMQException
org.apache.qpid.url.URLSyntaxException
JMSException
NamingException
Exception


Licensed to the Apache Software Foundation