diff options
| author | Robert Godfrey <rgodfrey@apache.org> | 2014-04-28 16:32:02 +0000 |
|---|---|---|
| committer | Robert Godfrey <rgodfrey@apache.org> | 2014-04-28 16:32:02 +0000 |
| commit | 6125de2e1aa8779d7fd1e59f378ce0a2225d453f (patch) | |
| tree | 76e38fbd0e88bc9a5813fda0527d8d2ca7d701b8 /qpid/java/systests/src | |
| parent | b5aa0bafee0acbf7684f2ae6918949b2b4ec791a (diff) | |
| download | qpid-python-6125de2e1aa8779d7fd1e59f378ce0a2225d453f.tar.gz | |
QPID-5578 : Address Review comment from Keith Wall re: r1589912
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1590699 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests/src')
| -rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java index 88f8142f94..14cadc2389 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java @@ -56,6 +56,7 @@ import org.apache.qpid.client.AMQSession_0_10; import org.apache.qpid.client.message.QpidMessageProperties; import org.apache.qpid.jndi.PropertiesFileInitialContextFactory; import org.apache.qpid.messaging.Address; +import org.apache.qpid.protocol.AMQConstant; import org.apache.qpid.test.utils.QpidBrokerTestCase; import org.apache.qpid.transport.ExecutionErrorCode; @@ -270,7 +271,7 @@ public class AddressBasedDestinationTest extends QpidBrokerTestCase public void testCreateExchange() throws Exception { - createExchangeImpl(false, false); + createExchangeImpl(false, false, false); } /** @@ -279,7 +280,7 @@ public class AddressBasedDestinationTest extends QpidBrokerTestCase */ public void testCreateExchangeWithArgs() throws Exception { - createExchangeImpl(true, false); + createExchangeImpl(true, false, false); } /** @@ -289,11 +290,12 @@ public class AddressBasedDestinationTest extends QpidBrokerTestCase */ public void testCreateExchangeWithNonsenseArgs() throws Exception { - createExchangeImpl(true, true); + createExchangeImpl(true, true, false); } private void createExchangeImpl(final boolean withExchangeArgs, - final boolean useNonsenseArguments) throws Exception + final boolean useNonsenseArguments, + final boolean useNonsenseExchangeType) throws Exception { Session jmsSession = _connection.createSession(false,Session.AUTO_ACKNOWLEDGE); @@ -305,7 +307,9 @@ public class AddressBasedDestinationTest extends QpidBrokerTestCase "type: topic, " + "x-declare: " + "{ " + - "type:direct, " + + "type:" + + (useNonsenseExchangeType ? "nonsense" : "direct") + + ", " + "auto-delete: true" + createExchangeArgsString(withExchangeArgs, useNonsenseArguments) + "}" + @@ -318,7 +322,7 @@ public class AddressBasedDestinationTest extends QpidBrokerTestCase try { cons = jmsSession.createConsumer(dest); - if(useNonsenseArguments) + if(useNonsenseArguments || useNonsenseExchangeType) { fail("Expected execution exception during exchange declare did not occur"); } @@ -331,6 +335,10 @@ public class AddressBasedDestinationTest extends QpidBrokerTestCase //for. We can't do the rest of the test as a result of the exception, just stop. return; } + else if(useNonsenseExchangeType && (e.getErrorCode().equals(String.valueOf(AMQConstant.NOT_FOUND.getCode())))) + { + return; + } else { fail("Unexpected exception whilst creating consumer: " + e); @@ -1239,8 +1247,11 @@ public class AddressBasedDestinationTest extends QpidBrokerTestCase { assertEquals("Failure code is not as expected", "404", e.getErrorCode()); } + } - + public void testUnknownExchangeType() throws Exception + { + createExchangeImpl(false, false, true); } public void testQueueBrowserWithSelectorAutoAcknowledgement() throws Exception |
