diff options
| author | Robert Gemmell <robbie@apache.org> | 2013-02-05 14:22:56 +0000 |
|---|---|---|
| committer | Robert Gemmell <robbie@apache.org> | 2013-02-05 14:22:56 +0000 |
| commit | ef99cf5da8833eb4a8a456741566b7a55f7ef64b (patch) | |
| tree | 9a45cac5dd6ebae99c2919fe08b3e7ff88aed43e /java/systests | |
| parent | cffa3637701472511da91eeee1e9c989bfc02f7a (diff) | |
| download | qpid-python-ef99cf5da8833eb4a8a456741566b7a55f7ef64b.tar.gz | |
QPID-4312: reduce visibility and narrow argument type for new check methods, add some unit testing of config and cleanup IDT systest a little
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1442602 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/systests')
| -rw-r--r-- | java/systests/src/main/java/org/apache/qpid/test/unit/basic/InvalidDestinationTest.java | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/test/unit/basic/InvalidDestinationTest.java b/java/systests/src/main/java/org/apache/qpid/test/unit/basic/InvalidDestinationTest.java index 05b19c3391..8961574d1e 100644 --- a/java/systests/src/main/java/org/apache/qpid/test/unit/basic/InvalidDestinationTest.java +++ b/java/systests/src/main/java/org/apache/qpid/test/unit/basic/InvalidDestinationTest.java @@ -55,11 +55,8 @@ public class InvalidDestinationTest extends QpidBrokerTestCase super.tearDown(); } - - public void testInvalidDestination() throws Exception { - QueueSession queueSession = _connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); Queue invalidDestination = queueSession.createQueue("unknownQ"); @@ -98,37 +95,39 @@ public class InvalidDestinationTest extends QpidBrokerTestCase sender.close(); sender = queueSession.createSender(validDestination); sender.send(msg); - - - - } - - + /** + * Tests that specifying the {@value ClientProperties#VERIFY_QUEUE_ON_SEND} system property + * results in an exception when sending to an invalid queue destination. + */ public void testInvalidDestinationOnMessageProducer() throws Exception { setTestSystemProperty(ClientProperties.VERIFY_QUEUE_ON_SEND, "true"); final AMQConnection connection = (AMQConnection) getConnection(); doInvalidDestinationOnMessageProducer(connection); - } - + /** + * Tests that specifying the {@value ConnectionURL.OPTIONS_VERIFY_QUEUE_ON_SEND} + * connection URL option property results in an exception when sending to an + * invalid queue destination. + */ public void testInvalidDestinationOnMessageProducerURL() throws Exception { Map<String, String> options = Collections.singletonMap(ConnectionURL.OPTIONS_VERIFY_QUEUE_ON_SEND, "true"); doInvalidDestinationOnMessageProducer(getConnectionWithOptions(options)); - } private void doInvalidDestinationOnMessageProducer(Connection connection) throws JMSException { Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - Queue invalidDestination = session.createQueue("unknownQ"); + String invalidQueueName = getTestQueueName() + "UnknownQ"; + Queue invalidDestination = session.createQueue(invalidQueueName); - Queue validDestination = session.createQueue("knownQ"); + String validQueueName = getTestQueueName() + "KnownQ"; + Queue validDestination = session.createQueue(validQueueName); // This is the only easy way to create and bind a queue from the API :-( session.createConsumer(validDestination); @@ -146,9 +145,8 @@ public class InvalidDestinationTest extends QpidBrokerTestCase // pass } - sender = session.createProducer(null); - invalidDestination = new AMQQueue("amq.direct","unknownQ"); + invalidDestination = new AMQQueue("amq.direct",invalidQueueName); try { @@ -164,15 +162,10 @@ public class InvalidDestinationTest extends QpidBrokerTestCase sender = session.createProducer(validDestination); sender.send(msg); - Topic topic = session.createTopic("randomTopic"); + //Verify sending to an 'invalid' Topic doesn't throw an exception + String invalidTopic = getTestQueueName() + "UnknownT"; + Topic topic = session.createTopic(invalidTopic); sender = session.createProducer(topic); sender.send(msg); } - - - public static junit.framework.Test suite() - { - - return new junit.framework.TestSuite(InvalidDestinationTest.class); - } } |
