diff options
author | Robert Gemmell <robbie@apache.org> | 2012-01-26 10:13:17 +0000 |
---|---|---|
committer | Robert Gemmell <robbie@apache.org> | 2012-01-26 10:13:17 +0000 |
commit | d89e2aa23781d382b0e3ab9704e1058a011ebc3b (patch) | |
tree | 640ba2c7a5d5efe4f5d21e64fef950ee951a9703 | |
parent | e9721fa6f4f5a00483cab5c1391b0f27091d7a88 (diff) | |
download | qpid-python-d89e2aa23781d382b0e3ab9704e1058a011ebc3b.tar.gz |
QPID-3779: replace the old ImmediateMessageTest and MandatoryMessageTest with understandable versions and remove duplicate/obsolete tests FailoverTest and RollbackTest.
Applied patch from Andrew MacBean <andymacbean@gmail.com> and Oleksandr Rudyy<orudyy@gmail.com>.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1236127 13f79535-47bb-0310-9956-ffa450edef68
8 files changed, 213 insertions, 930 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/client/ImmediateAndMandatoryPublishingTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/ImmediateAndMandatoryPublishingTest.java new file mode 100644 index 0000000000..a708c1df49 --- /dev/null +++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/ImmediateAndMandatoryPublishingTest.java @@ -0,0 +1,211 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.qpid.test.client; + +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.TimeUnit; + +import javax.jms.Connection; +import javax.jms.Destination; +import javax.jms.ExceptionListener; +import javax.jms.JMSException; +import javax.jms.Message; +import javax.jms.MessageConsumer; +import javax.jms.MessageProducer; +import javax.jms.Session; +import javax.jms.Topic; + +import org.apache.qpid.client.AMQNoConsumersException; +import org.apache.qpid.client.AMQNoRouteException; +import org.apache.qpid.client.AMQSession; +import org.apache.qpid.test.utils.QpidBrokerTestCase; + +public class ImmediateAndMandatoryPublishingTest extends QpidBrokerTestCase implements ExceptionListener +{ + private Connection _connection; + private BlockingQueue<JMSException> _exceptions; + + public void setUp() throws Exception + { + super.setUp(); + _exceptions = new ArrayBlockingQueue<JMSException>(1); + _connection = getConnection(); + _connection.setExceptionListener(this); + } + + public void testPublishP2PWithNoConsumerAndImmediateOnAndAutoAck() throws Exception + { + publishIntoExistingDestinationWithNoConsumerAndImmediateOn(Session.AUTO_ACKNOWLEDGE, false); + } + + public void testPublishP2PWithNoConsumerAndImmediateOnAndTx() throws Exception + { + publishIntoExistingDestinationWithNoConsumerAndImmediateOn(Session.SESSION_TRANSACTED, false); + } + + public void testPublishPubSubWithDisconnectedDurableSubscriberAndImmediateOnAndAutoAck() throws Exception + { + publishIntoExistingDestinationWithNoConsumerAndImmediateOn(Session.AUTO_ACKNOWLEDGE, true); + } + + public void testPublishPubSubWithDisconnectedDurableSubscriberAndImmediateOnAndTx() throws Exception + { + publishIntoExistingDestinationWithNoConsumerAndImmediateOn(Session.SESSION_TRANSACTED, true); + } + + public void testPublishP2PIntoNonExistingDesitinationWithMandatoryOnAutoAck() throws Exception + { + publishWithMandatoryOnImmediateOff(Session.AUTO_ACKNOWLEDGE, false); + } + + public void testPublishP2PIntoNonExistingDesitinationWithMandatoryOnAndTx() throws Exception + { + publishWithMandatoryOnImmediateOff(Session.SESSION_TRANSACTED, false); + } + + public void testPubSubMandatoryAutoAck() throws Exception + { + publishWithMandatoryOnImmediateOff(Session.AUTO_ACKNOWLEDGE, true); + } + + public void testPubSubMandatoryTx() throws Exception + { + publishWithMandatoryOnImmediateOff(Session.SESSION_TRANSACTED, true); + } + + public void testP2PNoMandatoryAutoAck() throws Exception + { + publishWithMandatoryOffImmediateOff(Session.AUTO_ACKNOWLEDGE, false); + } + + public void testP2PNoMandatoryTx() throws Exception + { + publishWithMandatoryOffImmediateOff(Session.SESSION_TRANSACTED, false); + } + + public void testPubSubWithImmediateOnAndAutoAck() throws Exception + { + consumerCreateAndClose(true, false); + + Message message = produceMessage(Session.AUTO_ACKNOWLEDGE, true, false, true); + + JMSException exception = _exceptions.poll(10, TimeUnit.SECONDS); + assertNotNull("JMSException is expected", exception); + AMQNoRouteException noRouteException = (AMQNoRouteException) exception.getLinkedException(); + assertNotNull("AMQNoRouteException should be linked to JMSEXception", noRouteException); + Message bounceMessage = (Message) noRouteException.getUndeliveredMessage(); + assertNotNull("Bounced Message is expected", bounceMessage); + assertEquals("Unexpected message is bounced", message.getJMSMessageID(), bounceMessage.getJMSMessageID()); + } + + private void publishIntoExistingDestinationWithNoConsumerAndImmediateOn(int acknowledgeMode, boolean pubSub) + throws JMSException, InterruptedException + { + consumerCreateAndClose(pubSub, true); + + Message message = produceMessage(acknowledgeMode, pubSub, false, true); + + JMSException exception = _exceptions.poll(10, TimeUnit.SECONDS); + assertNotNull("JMSException is expected", exception); + AMQNoConsumersException noConsumerException = (AMQNoConsumersException) exception.getLinkedException(); + assertNotNull("AMQNoConsumersException should be linked to JMSEXception", noConsumerException); + Message bounceMessage = (Message) noConsumerException.getUndeliveredMessage(); + assertNotNull("Bounced Message is expected", bounceMessage); + assertEquals("Unexpected message is bounced", message.getJMSMessageID(), bounceMessage.getJMSMessageID()); + } + + private void publishWithMandatoryOnImmediateOff(int acknowledgeMode, boolean pubSub) throws JMSException, + InterruptedException + { + Message message = produceMessage(acknowledgeMode, pubSub, true, false); + + JMSException exception = _exceptions.poll(10, TimeUnit.SECONDS); + assertNotNull("JMSException is expected", exception); + AMQNoRouteException noRouteException = (AMQNoRouteException) exception.getLinkedException(); + assertNotNull("AMQNoRouteException should be linked to JMSEXception", noRouteException); + Message bounceMessage = (Message) noRouteException.getUndeliveredMessage(); + assertNotNull("Bounced Message is expected", bounceMessage); + assertEquals("Unexpected message is bounced", message.getJMSMessageID(), bounceMessage.getJMSMessageID()); + } + + private void publishWithMandatoryOffImmediateOff(int acknowledgeMode, boolean pubSub) throws JMSException, + InterruptedException + { + produceMessage(acknowledgeMode, pubSub, false, false); + + JMSException exception = _exceptions.poll(1, TimeUnit.SECONDS); + assertNull("Unexpected JMSException", exception); + } + + private void consumerCreateAndClose(boolean pubSub, boolean durable) throws JMSException + { + Session session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE); + Destination destination = null; + MessageConsumer consumer = null; + if (pubSub) + { + destination = session.createTopic(getTestQueueName()); + if (durable) + { + consumer = session.createDurableSubscriber((Topic) destination, getTestName()); + } + else + { + consumer = session.createConsumer(destination); + } + } + else + { + destination = session.createQueue(getTestQueueName()); + consumer = session.createConsumer(destination); + } + consumer.close(); + } + + private Message produceMessage(int acknowledgeMode, boolean pubSub, boolean mandatory, boolean immediate) + throws JMSException + { + Session session = _connection.createSession(acknowledgeMode == Session.SESSION_TRANSACTED, acknowledgeMode); + Destination destination = null; + if (pubSub) + { + destination = session.createTopic(getTestQueueName()); + } + else + { + destination = session.createQueue(getTestQueueName()); + } + + MessageProducer producer = ((AMQSession<?, ?>) session).createProducer(destination, mandatory, immediate); + Message message = session.createMessage(); + producer.send(message); + if (session.getTransacted()) + { + session.commit(); + } + return message; + } + + @Override + public void onException(JMSException exception) + { + _exceptions.add(exception); + } +} diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkClientBaseCase.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkClientBaseCase.java deleted file mode 100644 index 2322955253..0000000000 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkClientBaseCase.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.test.framework; - -/** - * <p/><table id="crc"><caption>CRC Card</caption> - * <tr><th> Responsibilities <th> Collaborations - * <tr><td> - * </table> - */ -public class FrameworkClientBaseCase -{ -} diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/FailoverTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/FailoverTest.java deleted file mode 100644 index a5a0d4e41f..0000000000 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/FailoverTest.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.test.testcases; - -import org.apache.qpid.test.framework.*; -import static org.apache.qpid.test.framework.MessagingTestConfigProperties.*; -import org.apache.qpid.test.framework.localcircuit.LocalCircuitImpl; -import org.apache.qpid.test.framework.sequencers.CircuitFactory; - -import javax.jms.JMSException; -import javax.jms.MessageProducer; -import javax.jms.Session; - -/** - * FailoverTest provides testing of fail-over over a local-circuit implementation. The circuit being tested may be - * against an in-vm broker or against an external broker, with the failure mechanism abstracted out of the test case. - * Automatic failures can be simulated against an in-vm broker. Currently the test must interact with the user to - * simulate failures on an external broker. - * - * Things to test: - * In tx, failure duing tx causes tx to error on subsequent sends/receives or commits/rollbacks. - * Outside of tx, reconnection allows msg flow to continue but there may be loss. - * - * <p/><table id="crc"><caption>CRC Card</caption> - * <tr><th> Responsibilities <th> Collaborations - * <tr><td> - * </table> - * - * @todo This test is designed to be run over a local circuit only. For in-vm using automatic failures, for external - * brokers by prompting the user (or maybe using a script). Enforce the local-circuit only nature of the tests as - * well as thinking about how other local-circuit tests might be implemented. For example, could add a method - * to the framework base case for local only tests to call, that allows them access to the local-circuit - * implementation and so on. - * - * @todo More. Need to really expand the set of fail-over tests. - */ -public class FailoverTest extends FrameworkBaseCase -{ - /* Used for debugging purposes. */ - // private static final Logger log = Logger.getLogger(FailoverTest.class); - - /** - * Creates a new test case with the specified name. - * - * @param name The test case name. - */ - public FailoverTest(String name) - { - super(name); - } - - /** - * Checks that all messages sent within a transaction are receieved despite a fail-over occuring outside of - * the transaction. - * - * @throws JMSException Allowed to fall through and fail test. - */ - public void testTxP2PFailover() throws Exception - { - // Set up the test properties to match the test cases requirements. - getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, true); - getTestProps().setProperty(ACK_MODE_PROPNAME, Session.AUTO_ACKNOWLEDGE); - getTestProps().setProperty(PUBSUB_PROPNAME, false); - - // MessagingTestConfigProperties props = this.getTestParameters(); - - // Create the test circuit from the test configuration parameters. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps()); - - // Create an assertion that all messages are received. - Assertion allMessagesReceived = testCircuit.getReceiver().allMessagesReceivedAssertion(getTestProps()); - - // This test case assumes it is using a local circuit. - LocalCircuitImpl localCircuit = (LocalCircuitImpl) testCircuit; - - Session producerSession = localCircuit.getLocalPublisherCircuitEnd().getSession(); - MessageProducer producer = localCircuit.getLocalPublisherCircuitEnd().getProducer(); - // MessageConsumer consumer = localCircuit.getLocalReceiverCircuitEnd().getConsumer(); - - // Send some test messages. - for (int i = 0; i < 100; i++) - { - producer.send(TestUtils.createTestMessageOfSize(producerSession, 10)); - producerSession.commit(); - - // Cause a failover. - if (i == 50) - { - getFailureMechanism().causeFailure(); - } - - // Wait for the reconnection to complete. - } - - // Check that trying to send within the original transaction fails. - - // Check that all messages sent were received. - assertTrue("All messages sent were not received back again.", allMessagesReceived.apply()); - } -} diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/ImmediateMessageTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/ImmediateMessageTest.java deleted file mode 100644 index 3001211eae..0000000000 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/ImmediateMessageTest.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.test.testcases; - -import org.apache.qpid.test.framework.AMQPPublisher; -import org.apache.qpid.test.framework.Circuit; -import org.apache.qpid.test.framework.FrameworkBaseCase; -import org.apache.qpid.test.framework.MessagingTestConfigProperties; -import static org.apache.qpid.test.framework.MessagingTestConfigProperties.*; -import org.apache.qpid.test.framework.sequencers.CircuitFactory; - -import org.apache.qpid.junit.extensions.util.TestContextProperties; - -/** - * ImmediateMessageTest tests for the desired behaviour of immediate messages. Immediate messages are a non-JMS - * feature. A message may be marked with an immediate delivery flag, which means that a consumer must be connected - * to receive the message, through a valid route, when it is sent, or when its transaction is committed in the case - * of transactional messaging. If this is not the case, the broker should return the message with a NO_CONSUMERS code. - * - * <p><table id="crc"><caption>CRC Card</caption> - * <tr><th> Responsibilities <th> Collaborations - * <tr><td> Check that an immediate message is sent succesfully not using transactions when a consumer is connected. - * <tr><td> Check that an immediate message is committed succesfully in a transaction when a consumer is connected. - * <tr><td> Check that an immediate message results in no consumers code, not using transactions, when a consumer is - * disconnected. - * <tr><td> Check that an immediate message results in no consumers code, in a transaction, when a consumer is - * disconnected. - * <tr><td> Check that an immediate message results in no route code, not using transactions, when no outgoing route is - * connected. - * <tr><td> Check that an immediate message results in no route code, upon transaction commit, when no outgoing route is - * connected. - * <tr><td> Check that an immediate message is sent succesfully not using transactions when a consumer is connected. - * <tr><td> Check that an immediate message is committed succesfully in a transaction when a consumer is connected. - * <tr><td> Check that an immediate message results in no consumers code, not using transactions, when a consumer is - * disconnected. - * <tr><td> Check that an immediate message results in no consumers code, in a transaction, when a consumer is - * disconnected. - * <tr><td> Check that an immediate message results in no route code, not using transactions, when no outgoing route is - * connected. - * <tr><td> Check that an immediate message results in no route code, upon transaction commit, when no outgoing route is - * connected. - * </table> - * - * @todo All of these test cases will be generated by a test generator that thoroughly tests all combinations of test - * circuits. - */ -public class ImmediateMessageTest extends FrameworkBaseCase -{ - /** - * Creates a new test case with the specified name. - * - * @param name The test case name. - */ - public ImmediateMessageTest(String name) - { - super(name); - } - - /** Check that an immediate message is sent succesfully not using transactions when a consumer is connected. */ - public void test_QPID_517_ImmediateOkNoTxP2P() throws Exception - { - // Ensure transactional sessions are off. - getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, false); - getTestProps().setProperty(PUBSUB_PROPNAME, false); - - // Run the default test sequence over the test circuit checking for no errors. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps()); - - assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion(getTestProps())))); - } - - /** Check that an immediate message is committed succesfully in a transaction when a consumer is connected. */ - public void test_QPID_517_ImmediateOkTxP2P() throws Exception - { - // Ensure transactional sessions are off. - getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, true); - getTestProps().setProperty(PUBSUB_PROPNAME, false); - - // Send one message with no errors. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps()); - - assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion(getTestProps())))); - } - - /** Check that an immediate message results in no consumers code, not using transactions, when a consumer is disconnected. */ - public void test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxP2P() throws Exception - { - // Ensure transactional sessions are off. - getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, false); - getTestProps().setProperty(PUBSUB_PROPNAME, false); - - // Disconnect the consumer. - getTestProps().setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false); - - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps()); - - // Send one message and get a linked no consumers exception. - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noConsumersAssertion(getTestProps())))); - } - - /** Check that an immediate message results in no consumers code, in a transaction, when a consumer is disconnected. */ - public void test_QPID_517_ImmediateFailsConsumerDisconnectedTxP2P() throws Exception - { - // Ensure transactional sessions are on. - getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, true); - getTestProps().setProperty(PUBSUB_PROPNAME, false); - - // Disconnect the consumer. - getTestProps().setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false); - - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps()); - - // Send one message and get a linked no consumers exception. - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noConsumersAssertion(getTestProps())))); - } - - /** Check that an immediate message results in no route code, not using transactions, when no outgoing route is connected. */ - public void test_QPID_517_ImmediateFailsNoRouteNoTxP2P() throws Exception - { - // Ensure transactional sessions are off. - getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, false); - getTestProps().setProperty(PUBSUB_PROPNAME, false); - - // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to - // collect its messages). - getTestProps().setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false); - - // Send one message and get a linked no route exception. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps()); - - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(getTestProps())))); - } - - /** Check that an immediate message results in no route code, upon transaction commit, when no outgoing route is connected. */ - public void test_QPID_517_ImmediateFailsNoRouteTxP2P() throws Exception - { - // Ensure transactional sessions are on. - getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, true); - getTestProps().setProperty(PUBSUB_PROPNAME, false); - - // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to - // collect its messages). - getTestProps().setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false); - - // Send one message and get a linked no route exception. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps()); - - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(getTestProps())))); - } - - /** Check that an immediate message is sent succesfully not using transactions when a consumer is connected. */ - public void test_QPID_517_ImmediateOkNoTxPubSub() throws Exception - { - // Ensure transactional sessions are off. - getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, false); - getTestProps().setProperty(PUBSUB_PROPNAME, true); - - // Send one message with no errors. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps()); - - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(getTestProps())))); - } - - /** Check that an immediate message is committed succesfully in a transaction when a consumer is connected. */ - public void test_QPID_517_ImmediateOkTxPubSub() throws Exception - { - // Ensure transactional sessions are off. - getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, true); - getTestProps().setProperty(PUBSUB_PROPNAME, true); - - // Send one message with no errors. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps()); - - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(getTestProps())))); - } - - /** Check that an immediate message results in no consumers code, not using transactions, when a consumer is disconnected. */ - public void test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxPubSub() throws Exception - { - // Ensure transactional sessions are off. - getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, false); - getTestProps().setProperty(PUBSUB_PROPNAME, true); - - // Use durable subscriptions, so that the route remains open with no subscribers. - getTestProps().setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true); - - // Disconnect the consumer. - getTestProps().setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false); - - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps()); - - // Send one message and get a linked no consumers exception. - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noConsumersAssertion(getTestProps())))); - } - - /** Check that an immediate message results in no consumers code, in a transaction, when a consumer is disconnected. */ - public void test_QPID_517_ImmediateFailsConsumerDisconnectedTxPubSub() throws Exception - { - // Ensure transactional sessions are on. - getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, true); - getTestProps().setProperty(PUBSUB_PROPNAME, true); - - // Use durable subscriptions, so that the route remains open with no subscribers. - getTestProps().setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true); - - // Disconnect the consumer. - getTestProps().setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false); - - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps()); - - // Send one message and get a linked no consumers exception. - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noConsumersAssertion(getTestProps())))); - } - - /** Check that an immediate message results in no route code, not using transactions, when no outgoing route is connected. */ - public void test_QPID_517_ImmediateFailsNoRouteNoTxPubSub() throws Exception - { - // Ensure transactional sessions are off. - getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, false); - getTestProps().setProperty(PUBSUB_PROPNAME, true); - - // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to - // collect its messages). - getTestProps().setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false); - - // Send one message and get a linked no route exception. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps()); - - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(getTestProps())))); - } - - /** Check that an immediate message results in no route code, upon transaction commit, when no outgoing route is connected. */ - public void test_QPID_517_ImmediateFailsNoRouteTxPubSub() throws Exception - { - // Ensure transactional sessions are on. - getTestProps().setProperty(TRANSACTED_PUBLISHER_PROPNAME, true); - getTestProps().setProperty(PUBSUB_PROPNAME, true); - - // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to - // collect its messages). - getTestProps().setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false); - - // Send one message and get a linked no route exception. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), getTestProps()); - - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(getTestProps())))); - } - - protected void setUp() throws Exception - { - super.setUp(); - - setTestProps(TestContextProperties.getInstance(MessagingTestConfigProperties.defaults)); - - /** All these tests should have the immediate flag on. */ - getTestProps().setProperty(IMMEDIATE_PROPNAME, true); - getTestProps().setProperty(MANDATORY_PROPNAME, false); - - /** Bind the receivers consumer by default. */ - getTestProps().setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, true); - getTestProps().setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, true); - } -} diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/MandatoryMessageTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/MandatoryMessageTest.java deleted file mode 100644 index b4c4eb91b4..0000000000 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/MandatoryMessageTest.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.test.testcases; - -import org.apache.qpid.test.framework.AMQPPublisher; -import org.apache.qpid.test.framework.Circuit; -import org.apache.qpid.test.framework.FrameworkBaseCase; -import org.apache.qpid.test.framework.MessagingTestConfigProperties; -import static org.apache.qpid.test.framework.MessagingTestConfigProperties.*; -import org.apache.qpid.test.framework.sequencers.CircuitFactory; - -import org.apache.qpid.junit.extensions.util.ParsedProperties; -import org.apache.qpid.junit.extensions.util.TestContextProperties; - -/** - * MandatoryMessageTest tests for the desired behaviour of mandatory messages. Mandatory messages are a non-JMS - * feature. A message may be marked with a mandatory delivery flag, which means that a valid route for the message - * must exist, when it is sent, or when its transaction is committed in the case of transactional messaging. If this - * is not the case, the broker should return the message with a NO_CONSUMERS code. - * - * <p><table id="crc"><caption>CRC Card</caption> - * <tr><th> Responsibilities <th> Collaborations - * <tr><td> Check that an mandatory message is sent succesfully not using transactions when a consumer is connected. - * <tr><td> Check that an mandatory message is committed succesfully in a transaction when a consumer is connected. - * <tr><td> Check that a mandatory message is sent succesfully, not using transactions, when a consumer is disconnected - * but the route exists. - * <tr><td> Check that a mandatory message is sent succesfully, in a transaction, when a consumer is disconnected but - * the route exists. - * <tr><td> Check that an mandatory message results in no route code, not using transactions, when no consumer is - * connected. - * <tr><td> Check that an mandatory message results in no route code, upon transaction commit, when a consumer is - * connected. - * <tr><td> Check that an mandatory message is sent succesfully not using transactions when a consumer is connected. - * <tr><td> Check that an mandatory message is committed succesfully in a transaction when a consumer is connected. - * <tr><td> Check that a mandatory message is sent succesfully, not using transactions, when a consumer is disconnected - * but the route exists. - * <tr><td> Check that a mandatory message is sent succesfully, in a transaction, when a consumer is disconnected but - * the route exists. - * <tr><td> Check that an mandatory message results in no route code, not using transactions, when no consumer is - * connected. - * <tr><td> Check that an mandatory message results in no route code, upon transaction commit, when a consumer is - * connected. - * </table> - * - * @todo All of these test cases will be generated by a test generator that thoroughly tests all combinations of test - * circuits. - */ -public class MandatoryMessageTest extends FrameworkBaseCase -{ - /** Used to read the tests configurable properties through. */ - ParsedProperties testProps; - - /** - * Creates a new test case with the specified name. - * - * @param name The test case name. - */ - public MandatoryMessageTest(String name) - { - super(name); - } - - /** Check that an mandatory message is sent succesfully not using transactions when a consumer is connected. */ - public void test_QPID_508_MandatoryOkNoTxP2P() throws Exception - { - // Ensure transactional sessions are off. - testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false); - testProps.setProperty(PUBSUB_PROPNAME, false); - - // Run the default test sequence over the test circuit checking for no errors. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps); - - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps)))); - } - - /** Check that an mandatory message is committed succesfully in a transaction when a consumer is connected. */ - public void test_QPID_508_MandatoryOkTxP2P() throws Exception - { - // Ensure transactional sessions are off. - testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true); - testProps.setProperty(PUBSUB_PROPNAME, false); - - // Run the default test sequence over the test circuit checking for no errors. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps); - - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps)))); - } - - /** - * Check that a mandatory message is sent succesfully, not using transactions, when a consumer is disconnected but - * the route exists. - */ - public void test_QPID_517_MandatoryOkConsumerDisconnectedNoTxP2P() throws Exception - { - // Ensure transactional sessions are off. - testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false); - testProps.setProperty(PUBSUB_PROPNAME, false); - - // Disconnect the consumer. - testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false); - - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps); - - // Send one message with no errors. - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps)))); - } - - /** - * Check that a mandatory message is sent succesfully, in a transaction, when a consumer is disconnected but - * the route exists. - */ - public void test_QPID_517_MandatoryOkConsumerDisconnectedTxP2P() throws Exception - { - // Ensure transactional sessions are on. - testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true); - testProps.setProperty(PUBSUB_PROPNAME, false); - - // Disconnect the consumer. - testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false); - - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps); - - // Send one message with no errors. - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps)))); - } - - /** Check that an mandatory message results in no route code, not using transactions, when no consumer is connected. */ - public void test_QPID_508_MandatoryFailsNoRouteNoTxP2P() throws Exception - { - // Ensure transactional sessions are off. - testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false); - testProps.setProperty(PUBSUB_PROPNAME, false); - - // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to - // collect its messages). - testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false); - - // Send one message and get a linked no route exception. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps); - - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps)))); - } - - /** Check that an mandatory message results in no route code, upon transaction commit, when a consumer is connected. */ - public void test_QPID_508_MandatoryFailsNoRouteTxP2P() throws Exception - { - // Ensure transactional sessions are on. - testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true); - testProps.setProperty(PUBSUB_PROPNAME, false); - - // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to - // collect its messages). - testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false); - - // Send one message and get a linked no route exception. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps); - - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps)))); - } - - /** Check that an mandatory message is sent succesfully not using transactions when a consumer is connected. */ - public void test_QPID_508_MandatoryOkNoTxPubSub() throws Exception - { - // Ensure transactional sessions are off. - testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false); - testProps.setProperty(PUBSUB_PROPNAME, true); - - // Run the default test sequence over the test circuit checking for no errors. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps); - - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps)))); - } - - /** Check that an mandatory message is committed succesfully in a transaction when a consumer is connected. */ - public void test_QPID_508_MandatoryOkTxPubSub() throws Exception - { - // Ensure transactional sessions are on. - testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true); - testProps.setProperty(PUBSUB_PROPNAME, true); - - // Run the default test sequence over the test circuit checking for no errors. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps); - - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps)))); - } - - /** - * Check that a mandatory message is sent succesfully, not using transactions, when a consumer is disconnected but - * the route exists. - */ - public void test_QPID_517_MandatoryOkConsumerDisconnectedNoTxPubSub() throws Exception - { - // Ensure transactional sessions are off. - testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false); - testProps.setProperty(PUBSUB_PROPNAME, true); - - // Use durable subscriptions, so that the route remains open with no subscribers. - testProps.setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true); - - // Disconnect the consumer. - testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false); - - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps); - - // Send one message with no errors. - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps)))); - } - - /** - * Check that a mandatory message is sent succesfully, in a transaction, when a consumer is disconnected but - * the route exists. - */ - public void test_QPID_517_MandatoryOkConsumerDisconnectedTxPubSub() throws Exception - { - // Ensure transactional sessions are on. - testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true); - testProps.setProperty(PUBSUB_PROPNAME, true); - - // Use durable subscriptions, so that the route remains open with no subscribers. - testProps.setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true); - - // Disconnect the consumer. - testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false); - - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps); - - // Send one message with no errors. - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps)))); - } - - /** Check that an mandatory message results in no route code, not using transactions, when no consumer is connected. */ - public void test_QPID_508_MandatoryFailsNoRouteNoTxPubSub() throws Exception - { - // Ensure transactional sessions are off. - testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false); - testProps.setProperty(PUBSUB_PROPNAME, true); - - // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to - // collect its messages). - testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false); - - // Send one message and get a linked no route exception. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps); - - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps)))); - } - - /** Check that an mandatory message results in no route code, upon transaction commit, when a consumer is connected. */ - public void test_QPID_508_MandatoryFailsNoRouteTxPubSub() throws Exception - { - // Ensure transactional sessions are on. - testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true); - testProps.setProperty(PUBSUB_PROPNAME, true); - - // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to - // collect its messages). - testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false); - - // Send one message and get a linked no route exception. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps); - - assertNoFailures(testCircuit.test(1, - assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps)))); - } - - protected void setUp() throws Exception - { - super.setUp(); - - testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults); - - /** All these tests should have the mandatory flag on. */ - testProps.setProperty(IMMEDIATE_PROPNAME, false); - testProps.setProperty(MANDATORY_PROPNAME, true); - - /** Bind the receivers consumer by default. */ - testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, true); - testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, true); - } -} diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/RollbackTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/RollbackTest.java deleted file mode 100644 index edcde796a8..0000000000 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/RollbackTest.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -package org.apache.qpid.test.testcases; - -import org.apache.qpid.test.framework.Circuit; -import org.apache.qpid.test.framework.FrameworkBaseCase; -import org.apache.qpid.test.framework.MessagingTestConfigProperties; -import static org.apache.qpid.test.framework.MessagingTestConfigProperties.*; -import org.apache.qpid.test.framework.sequencers.CircuitFactory; - -import org.apache.qpid.junit.extensions.util.ParsedProperties; -import org.apache.qpid.junit.extensions.util.TestContextProperties; - -/** - * RollbackTest tests the rollback ability of transactional messaging. - * - * <p/><table id="crc"><caption>CRC Card</caption> - * <tr><th> Responsibilities <th> Collaborations - * <tr><td> Check messages sent but rolled back are never received. - * <tr><td> Check messages received but rolled back are redelivered on subsequent receives. - * <tr><td> Attempting to rollback outside of a transaction results in an IllegalStateException. - * </table> - */ -public class RollbackTest extends FrameworkBaseCase -{ - /** Used to read the tests configurable properties through. */ - private ParsedProperties testProps; - - /** - * Creates a new test case with the specified name. - * - * @param name The test case name. - */ - public RollbackTest(String name) - { - super(name); - } - - /** Check messages sent but rolled back are never received. */ - public void testRolledbackMessageNotDelivered() throws Exception - { - // Ensure transactional sessions are on. - testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true); - testProps.setProperty(ROLLBACK_PUBLISHER_PROPNAME, true); - - // Run the default test sequence over the test circuit checking for no errors. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps); - - assertNoFailures(testCircuit.test(1, - assertionList(testCircuit.getPublisher().noExceptionsAssertion(testProps), - testCircuit.getReceiver().noMessagesReceivedAssertion(testProps)))); - } - - /** Check messages received but rolled back are redelivered on subsequent receives. */ - public void testRolledbackMessagesSubsequentlyReceived() throws Exception - { - // Ensure transactional sessions are on. - testProps.setProperty(TRANSACTED_RECEIVER_PROPNAME, true); - testProps.setProperty(ROLLBACK_RECEIVER_PROPNAME, true); - - // Run the default test sequence over the test circuit checking for no errors. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps); - - assertNoFailures(testCircuit.test(1, - assertionList(testCircuit.getPublisher().noExceptionsAssertion(testProps), - testCircuit.getReceiver().allMessagesReceivedAssertion(testProps)))); - } - - /** Attempting to rollback outside of a transaction results in an IllegalStateException. */ - public void testRollbackUnavailableOutsideTransactionPublisher() throws Exception - { - // Ensure transactional sessions are on. - testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false); - testProps.setProperty(ROLLBACK_PUBLISHER_PROPNAME, true); - - // Run the default test sequence over the test circuit checking for no errors. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps); - - assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().channelClosedAssertion(testProps)))); - } - - /** Attempting to rollback outside of a transaction results in an IllegalStateException. */ - public void testRollbackUnavailableOutsideTransactionReceiver() throws Exception - { - // Ensure transactional sessions are on. - testProps.setProperty(TRANSACTED_RECEIVER_PROPNAME, false); - testProps.setProperty(ROLLBACK_RECEIVER_PROPNAME, true); - - // Run the default test sequence over the test circuit checking for no errors. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps); - - assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getReceiver().channelClosedAssertion(testProps)))); - } - - /** - * Sets up all tests to have an active outward route and consumer by default. - * - * @throws Exception Any exceptions are allowed to fall through and fail the test. - */ - protected void setUp() throws Exception - { - super.setUp(); - - testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults); - - /** Bind the receivers consumer by default. */ - testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, true); - testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, true); - } -} diff --git a/qpid/java/test-profiles/CPPExcludes b/qpid/java/test-profiles/CPPExcludes index 015aa19a8e..582a201044 100755 --- a/qpid/java/test-profiles/CPPExcludes +++ b/qpid/java/test-profiles/CPPExcludes @@ -27,18 +27,7 @@ org.apache.qpid.test.unit.client.channelclose.ChannelCloseTest#* org.apache.qpid.client.ResetMessageListenerTest#* // Those tests are testing 0.8 specific semantics -org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxP2P -org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedTxP2P -org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteNoTxP2P -org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteTxP2P -org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxPubSub -org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedTxPubSub -org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteNoTxPubSub -org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteTxPubSub -org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteNoTxP2P -org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteTxP2P -org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteNoTxPubSub -org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteTxPubSub +org.apache.qpid.test.client.ImmediateAndMandatoryPublishingTest#* // the 0.10 c++ broker does not implement forget org.apache.qpid.test.unit.xa.FaultTest#testForget diff --git a/qpid/java/test-profiles/Java010Excludes b/qpid/java/test-profiles/Java010Excludes index 0de4c6bae5..ac6ac8ae1c 100755 --- a/qpid/java/test-profiles/Java010Excludes +++ b/qpid/java/test-profiles/Java010Excludes @@ -18,18 +18,7 @@ // // Those tests are testing 0.8 specific semantics -org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxP2P -org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedTxP2P -org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteNoTxP2P -org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteTxP2P -org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxPubSub -org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedTxPubSub -org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteNoTxPubSub -org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteTxPubSub -org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteNoTxP2P -org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteTxP2P -org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteNoTxPubSub -org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteTxPubSub +org.apache.qpid.test.client.ImmediateAndMandatoryPublishingTest#* //this test checks explicitly for 0-8 flow control semantics org.apache.qpid.test.client.FlowControlTest#* |