diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2009-04-10 22:12:13 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2009-04-10 22:12:13 +0000 |
| commit | b08a5b7882ec5539ed2df6bab1ebeeebe3e95378 (patch) | |
| tree | c0f1693d17ccf34e1ec96d4483a520c5932fea12 /java | |
| parent | 83b13778de83ca781ac42828d64af01de3d12841 (diff) | |
| download | qpid-python-b08a5b7882ec5539ed2df6bab1ebeeebe3e95378.tar.gz | |
QPID-1804 : Provide testing for Flow to Disk when using ack modes Client, Transacted and No-Ack
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@764080 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
| -rw-r--r-- | java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeTest.java | 7 | ||||
| -rw-r--r-- | java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeWithFlowtoDiskTest.java | 56 |
2 files changed, 60 insertions, 3 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeTest.java b/java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeTest.java index b63f990791..a05e5bb042 100644 --- a/java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeTest.java +++ b/java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeTest.java @@ -31,14 +31,15 @@ import javax.jms.Session; import org.apache.qpid.client.AMQDestination; import org.apache.qpid.client.AMQSession; +import org.apache.qpid.client.AMQConnection; import org.apache.qpid.client.message.AbstractJMSMessage; import org.apache.qpid.test.utils.QpidTestCase; public class AcknowledgeTest extends QpidTestCase { - private static final int NUM_MESSAGES = 50; - private Connection _con; - private Queue _queue; + protected static int NUM_MESSAGES = 100; + protected Connection _con; + protected Queue _queue; private MessageProducer _producer; private Session _producerSession; private Session _consumerSession; diff --git a/java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeWithFlowtoDiskTest.java b/java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeWithFlowtoDiskTest.java new file mode 100644 index 0000000000..15c65162f4 --- /dev/null +++ b/java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeWithFlowtoDiskTest.java @@ -0,0 +1,56 @@ +/* + * + * 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.unit.ack; + +import org.apache.qpid.client.AMQSession; +import org.apache.qpid.framing.AMQShortString; +import org.apache.qpid.server.queue.AMQQueueFactory; + +import javax.jms.Session; +import java.util.HashMap; +import java.util.Map; + +public class AcknowledgeWithFlowtoDiskTest extends AcknowledgeTest +{ + @Override + public void setUp() throws Exception + { + super.setUp(); + + //Incresae the number of messages to send + NUM_MESSAGES = 100; + + Map<String, Object> arguments = new HashMap<String, Object>(); + + //Ensure we can call createQueue with a priority int value + arguments.put(AMQQueueFactory.QPID_POLICY_TYPE.toString(), AMQQueueFactory.QPID_FLOW_TO_DISK); + // each message in the AckTest is 98 bytes each so only give space for half + arguments.put(AMQQueueFactory.QPID_MAX_SIZE.toString(), 49 * NUM_MESSAGES); + + //Create the FlowToDisk Queue + AMQSession session = ((AMQSession) _con.createSession(false, Session.AUTO_ACKNOWLEDGE)); + session.createQueue(new AMQShortString(getName()), false, false, false, arguments); + + // Get a JMS reference to the new queue + _queue = session.createQueue(getName()); + } + +} |
