diff options
author | Andrew Donald Kennedy <grkvlt@apache.org> | 2011-03-04 15:07:04 +0000 |
---|---|---|
committer | Andrew Donald Kennedy <grkvlt@apache.org> | 2011-03-04 15:07:04 +0000 |
commit | 50bc243ed39f0b4befec2c3c98a6a62d6df8e064 (patch) | |
tree | c7ca508649516153a25ec5d6035bd840cc5ce770 | |
parent | 708dc69c064ca977e0d1e1d5802d45e94b207e18 (diff) | |
download | qpid-python-50bc243ed39f0b4befec2c3c98a6a62d6df8e064.tar.gz |
QPID-3113: Exclude ChannelCloseTest from 0-10 profiles only
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1077988 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java | 104 | ||||
-rwxr-xr-x | qpid/java/test-profiles/Java010Excludes | 3 |
2 files changed, 49 insertions, 58 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java index f0794c9dab..b6232b1734 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java @@ -29,7 +29,6 @@ import org.apache.qpid.client.transport.TransportConnection; import org.apache.qpid.framing.*; import org.apache.qpid.jms.ConnectionListener; import org.apache.qpid.protocol.AMQConstant; -import org.apache.qpid.url.URLSyntaxException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,70 +48,67 @@ public class ChannelCloseTest extends QpidBrokerTestCase implements ExceptionLis private static final Logger _logger = LoggerFactory.getLogger(ChannelCloseTest.class); Connection _connection; - private String _brokerlist = "vm://:1"; private Session _session; private static final long SYNC_TIMEOUT = 500; private int TEST = 0; - /* - close channel, use chanel with same id ensure error. + /** + * Close channel, use chanel with same id ensure error. + * + * This test is only valid for non 0-10 connection . */ public void testReusingChannelAfterFullClosure() throws Exception { - // this is testing an inVM Connetion conneciton - if (isJavaBroker() && !isExternalBroker()) + _connection=newConnection(); + + // Create Producer + try { - _connection=newConnection(); + _connection.start(); + + createChannelAndTest(1); - // Create Producer + // Cause it to close try { - _connection.start(); - - createChannelAndTest(1); - - // Cause it to close - try - { - _logger.info("Testing invalid exchange"); - declareExchange(1, "", "name_that_will_lookup_to_null", false); - fail("Exchange name is empty so this should fail "); - } - catch (AMQException e) - { - assertEquals("Exchange should not be found", AMQConstant.NOT_FOUND, e.getErrorCode()); - } + _logger.info("Testing invalid exchange"); + declareExchange(1, "", "name_that_will_lookup_to_null", false); + fail("Exchange name is empty so this should fail "); + } + catch (AMQException e) + { + assertEquals("Exchange should not be found", AMQConstant.NOT_FOUND, e.getErrorCode()); + } - // Check that - try + // Check that + try + { + _logger.info("Testing valid exchange should fail"); + declareExchange(1, "topic", "amq.topic", false); + fail("This should not succeed as the channel should be closed "); + } + catch (AMQException e) + { + if (_logger.isInfoEnabled()) { - _logger.info("Testing valid exchange should fail"); - declareExchange(1, "topic", "amq.topic", false); - fail("This should not succeed as the channel should be closed "); + _logger.info("Exception occured was:" + e.getErrorCode()); } - catch (AMQException e) - { - if (_logger.isInfoEnabled()) - { - _logger.info("Exception occured was:" + e.getErrorCode()); - } - assertEquals("Connection should be closed", AMQConstant.CHANNEL_ERROR, e.getErrorCode()); + assertEquals("Connection should be closed", AMQConstant.CHANNEL_ERROR, e.getErrorCode()); - _connection=newConnection(); - } + _connection=newConnection(); + } - checkSendingMessage(); + checkSendingMessage(); - _session.close(); - _connection.close(); + _session.close(); + _connection.close(); - } - catch (JMSException e) - { - e.printStackTrace(); - fail(e.getMessage()); - } + } + catch (JMSException e) + { + e.printStackTrace(); + fail(e.getMessage()); } } @@ -306,27 +302,19 @@ public class ChannelCloseTest extends QpidBrokerTestCase implements ExceptionLis private Connection newConnection() { - AMQConnection connection = null; + Connection connection = null; try { - connection = new AMQConnection("amqp://guest:guest@CCTTest/test?brokerlist='" + _brokerlist + "'"); + connection = getConnection(); - connection.setConnectionListener(this); + ((AMQConnection) connection).setConnectionListener(this); _session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE); connection.start(); } - catch (JMSException e) - { - fail("Creating new connection when:" + e.getMessage()); - } - catch (AMQException e) - { - fail("Creating new connection when:" + e.getMessage()); - } - catch (URLSyntaxException e) + catch (Exception e) { fail("Creating new connection when:" + e.getMessage()); } diff --git a/qpid/java/test-profiles/Java010Excludes b/qpid/java/test-profiles/Java010Excludes index 3486d5c70c..ed316efd42 100755 --- a/qpid/java/test-profiles/Java010Excludes +++ b/qpid/java/test-profiles/Java010Excludes @@ -74,6 +74,9 @@ org.apache.qpid.test.unit.publish.DirtyTransactedPublishTest#* org.apache.qpid.test.client.RollbackOrderTest#testOrderingAfterRollbackOnMessage org.apache.qpid.test.unit.ack.RecoverTest#testRecoverInAutoAckListener +// This test uses 0-8 channel frames +org.apache.qpid.test.unit.client.channelclose.ChannelCloseTest#* + //Temporarily adding the following until the issues are sorted out. //Should probably raise JIRAs for them. org.apache.qpid.transport.network.mina.MINANetworkDriverTest#* |