diff options
author | Robert Gemmell <robbie@apache.org> | 2011-08-25 11:20:24 +0000 |
---|---|---|
committer | Robert Gemmell <robbie@apache.org> | 2011-08-25 11:20:24 +0000 |
commit | bd0b19adf1a8f529d68213bfd2f4c9a5f12e66b6 (patch) | |
tree | 572e3d411141796f48672e919c092ccc2966dfaf | |
parent | 1dc1ece5aec7ba37654a19cbf1d860ec809cced9 (diff) | |
download | qpid-python-bd0b19adf1a8f529d68213bfd2f4c9a5f12e66b6.tar.gz |
QPID-1004: delete dead test (as recommended on the JIRA) since it was excluded from all test profiles over 3 years and TTL functionality is covered by other tests
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1161507 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/java/systests/build.xml | 2 | ||||
-rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/TTLTest.java | 154 | ||||
-rwxr-xr-x | qpid/java/test-profiles/CPPExcludes | 1 | ||||
-rw-r--r-- | qpid/java/test-profiles/JavaExcludes | 3 |
4 files changed, 1 insertions, 159 deletions
diff --git a/qpid/java/systests/build.xml b/qpid/java/systests/build.xml index 1da0a6d355..33ad2227bb 100644 --- a/qpid/java/systests/build.xml +++ b/qpid/java/systests/build.xml @@ -22,7 +22,7 @@ nn - or more contributor license agreements. See the NOTICE file <property name="module.depends" value="client management/tools/qpid-cli management/common broker broker/test common common/test junit-toolkit"/> <property name="module.test.src" location="src/main/java"/> <property name="module.test.excludes" - value="**/TTLTest.java,**/DropInTest.java,**/TestClientControlledTest.java"/> + value="**/DropInTest.java,**/TestClientControlledTest.java"/> <import file="../module.xml"/> diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/TTLTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/TTLTest.java deleted file mode 100644 index d4bab657d7..0000000000 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/TTLTest.java +++ /dev/null @@ -1,154 +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 static org.apache.qpid.test.framework.MessagingTestConfigProperties.ACK_MODE_PROPNAME; -import static org.apache.qpid.test.framework.MessagingTestConfigProperties.PUBSUB_PROPNAME; -import org.apache.qpid.test.framework.TestUtils; -import org.apache.qpid.test.framework.localcircuit.LocalCircuitImpl; -import org.apache.qpid.test.framework.sequencers.CircuitFactory; - -import javax.jms.*; - -import java.util.LinkedList; -import java.util.List; -import java.util.Random; - -/** - * TTLTest checks that time-to-live is applied to messages. The test sends messages with a variety of TTL stamps on them - * then after a pause attempts to receive those messages. Only messages with a large enough TTL to have survived the pause - * should be receiveable. This test case also applies an additional assertion against the broker, that the message store - * is empty at the end of the test. - * - * <p/>This test is designed to run over local circuits only, as it must control a timed pause between sending and receiving - * messages to that TTL can be applied to purge some of the messages. - * - * <p/><table id="crc"><caption>CRC Card</caption> - * <tr><th> Responsibilities <th> Collaborations - * <tr><td> - * </table> - * - * @todo Use an interface or other method to mark this test as local only. - * - * @todo Implement the message store assertion for in-vm broker. Could also be done for external broker, for example - * by using diagnostic exchange. - * - * @todo Implement and add a queue depth assertion too. This might already be in another test to copy from. - * - * @todo Create variations on test theme, for different ack mode and tx and message sizes etc. - * - * @todo Add an allowable margin of error to the test, as ttl may not be precise. - */ -public class TTLTest extends FrameworkBaseCase -{ - /** - * Creates a new test case with the specified name. - * - * @param name The test case name. - */ - public TTLTest(String name) - { - super(name); - } - - /** - * Checks that all messages sent with a TTL shorter than a pause between sending them and attempting to receive them - * will fail to arrive. Once all messages have been purged by TTL or received, check that they no longer exist on - * the broker. - * - * @throws javax.jms.JMSException Allowed to fall through and fail test. - */ - public void testTTLP2P() throws Exception - { - String errorMessages = ""; - Random r = new Random(); - - // Used to accumulate correctly received messages in. - List<Message> receivedMessages = new LinkedList<Message>(); - - // Set up the test properties to match the test case requirements. - getTestProps().setProperty(ACK_MODE_PROPNAME, Session.AUTO_ACKNOWLEDGE); - getTestProps().setProperty(PUBSUB_PROPNAME, false); - - // Create the test circuit from the test configuration parameters. - CircuitFactory circuitFactory = getCircuitFactory(); - Circuit testCircuit = circuitFactory.createCircuit(getConnection(), 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 tests messages, with random TTLs, some shorter and some longer than the pause time. - for (int i = 0; i < 100; i++) - { - Message testMessage = TestUtils.createTestMessageOfSize(producerSession, 10); - - // Set the TTL on the message and record its value in the message headers. - long ttl = 500 + r.nextInt(1500); - producer.setTimeToLive(ttl); - testMessage.setLongProperty("testTTL", ttl); - - producer.send(testMessage); - // producerSession.commit(); - } - - // Inject a pause to allow some messages to be purged by TTL. - TestUtils.pause(1000); - - // Attempt to receive back all of the messages, confirming by the message time stamps and TTLs that only - // those received should have avoided being purged by the TTL. - boolean timedOut = false; - - - Message testMessage = null; - - do - { - testMessage = consumer.receive(1000); - - long ttl = testMessage.getLongProperty("testTTL"); - long timeStamp = testMessage.getJMSTimestamp(); - long now = System.currentTimeMillis(); - - if ((timeStamp + ttl) < now) - { - errorMessages += - "Received message [sent: " + timeStamp + ", ttl: " + ttl + ", received: " + now - + "] which should have been purged by its TTL.\n"; - } - /*else - { - receivedMessages.add(testMessage); - }*/ - } while (!timedOut && testMessage != null); - - // Check that the queue and message store on the broker are empty. - // assertTrue("Message store is not empty.", messageStoreEmpty.apply()); - // assertTrue("Queue is not empty.", queueEmpty.apply()); - - assertTrue(errorMessages, "".equals(errorMessages)); - } -} diff --git a/qpid/java/test-profiles/CPPExcludes b/qpid/java/test-profiles/CPPExcludes index 8c05b28161..2e32754943 100755 --- a/qpid/java/test-profiles/CPPExcludes +++ b/qpid/java/test-profiles/CPPExcludes @@ -24,7 +24,6 @@ org.apache.qpid.test.unit.client.channelclose.ChannelCloseTest#* org.apache.qpid.client.ResetMessageListenerTest#* // This test is not finished -org.apache.qpid.test.testcases.TTLTest#* org.apache.qpid.test.client.failover.FailoverTest#test4MinuteFailover // Those tests are testing 0.8 specific semantics diff --git a/qpid/java/test-profiles/JavaExcludes b/qpid/java/test-profiles/JavaExcludes index 528735730f..dcccce7e2f 100644 --- a/qpid/java/test-profiles/JavaExcludes +++ b/qpid/java/test-profiles/JavaExcludes @@ -17,9 +17,6 @@ // under the License. // -// Those tests are not finished -org.apache.qpid.test.testcases.TTLTest#* - // QPID-1823: this takes ages to run org.apache.qpid.client.SessionCreateTest#* |