diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2009-04-14 15:46:39 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2009-04-14 15:46:39 +0000 |
| commit | 1b2b4b309e9392e0523cd62accb8704fd089eef8 (patch) | |
| tree | 81800138f1c90a88d004b7fad90a69a902ab44dd /java/systests/src | |
| parent | 86f2fa80575d0db1fe1395172f6dccf23c7d5018 (diff) | |
| download | qpid-python-1b2b4b309e9392e0523cd62accb8704fd089eef8.tar.gz | |
QPID-1807 : Remove old broker and FlowToDisk related tests
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@764838 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/systests/src')
6 files changed, 0 insertions, 630 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/server/failure/Create32kQueueWithoutFailure.java b/java/systests/src/main/java/org/apache/qpid/server/failure/Create32kQueueWithoutFailure.java deleted file mode 100644 index 92f209d2d9..0000000000 --- a/java/systests/src/main/java/org/apache/qpid/server/failure/Create32kQueueWithoutFailure.java +++ /dev/null @@ -1,143 +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.server.failure; - -import org.apache.qpid.client.AMQConnection; -import org.apache.qpid.client.AMQSession; -import org.apache.qpid.framing.AMQShortString; -import org.apache.qpid.jms.ConnectionListener; -import org.apache.qpid.server.queue.AMQQueueFactory; -import org.apache.qpid.server.queue.FileQueueBackingStoreFactory; -import org.apache.qpid.test.utils.QpidTestCase; - -import javax.jms.Session; -import java.util.HashMap; -import java.util.Map; -import java.io.File; - -import junit.framework.TestCase; - -/** - * The idea behind this is to test how a broker with flow to disk copes when - * over 31998 queues are created in a single directory. - * - * As the Java broker uses a directory per queue as the queueBacking for FtD - * this test will fail until we do some sort of bin allocation for the queues. - */ -public class Create32kQueueWithoutFailure extends TestCase implements ConnectionListener -{ - - static final int QUEUE_COUNT = 32000; - - public void test() throws Exception - { - AMQConnection connection = new AMQConnection("amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'");//(AMQConnection) getConnectionFactory("default").createConnection("guest", "guest"); - - connection.setConnectionListener(this); - - AMQSession session = (AMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - - 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); - // Make a small limit just for show - arguments.put(AMQQueueFactory.QPID_MAX_SIZE.toString(), 1); - - for (int index = 0; index < QUEUE_COUNT; index++) - { //getName() + - System.out.println("Creating:"+index); - session.createQueue(new AMQShortString( "TempQueue-" + index), false, false, false, arguments); - } - - connection.close(); - } - - public void bytesSent(long count) - { - //To change body of implemented methods use File | Settings | File Templates. - } - - public void bytesReceived(long count) - { - //To change body of implemented methods use File | Settings | File Templates. - } - - public boolean preFailover(boolean redirect) - { - return false; //Veto Failover - //If we cause a connection failure creating lots of queues - // then we don't want to attempt to resetup the session on a new - // connection. - } - - public boolean preResubscribe() - { - return false; //To change body of implemented methods use File | Settings | File Templates. - } - - public void failoverComplete() - { - //To change body of implemented methods use File | Settings | File Templates. - } - - /** - * Simple test app that shows the distribution of 32000 'queues' callled - * 'TempQueue-<ID>' where ID is 0-32000 - * - * Using straight Object.hashCode() we get quite an uneven distribution - * but using the hash function from Harmony's ConcurrentHashMap we smooth - * things out. - * - * @param args - */ - public static void main(String[] args) - { - - int[] hit = new int[256]; - String name = "TempQueue-"; - for (int index = 0; index < QUEUE_COUNT; index++) - { - int hash = FileQueueBackingStoreFactory.hash(name + index); - - long bin = hash & 0xFFL; - - File dir = new File(System.getProperty("java.io.tmpdir")+File.separator+bin); - - if (dir.exists()) - { - hit[(int)bin]++; - } - else - { - dir.mkdirs(); - dir.deleteOnExit(); - } - } - - for (int index = 0; index < hit.length; index++) - { - System.out.println("Bin:" + index + " Hit:" + hit[index]); - } - - } - -} diff --git a/java/systests/src/main/java/org/apache/qpid/server/queue/QueueCreateTest.java b/java/systests/src/main/java/org/apache/qpid/server/queue/QueueCreateTest.java deleted file mode 100644 index dd9b35c475..0000000000 --- a/java/systests/src/main/java/org/apache/qpid/server/queue/QueueCreateTest.java +++ /dev/null @@ -1,179 +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.server.queue; - -import org.apache.qpid.AMQException; -import org.apache.qpid.client.AMQSession; -import org.apache.qpid.client.failover.FailoverException; -import org.apache.qpid.framing.AMQShortString; -import org.apache.qpid.test.utils.QpidTestCase; - -import javax.jms.Connection; -import javax.jms.JMSException; -import javax.jms.Session; -import javax.naming.NamingException; -import java.util.HashMap; -import java.util.Map; - -/** The purpose of this set of tests is to ensure */ -public class QueueCreateTest extends QpidTestCase -{ - private Connection _connection; - private AMQSession _session; - private int _queueCount = 0; - - public void setUp() throws Exception - { - _connection = getConnection(); - - _session = (AMQSession) _connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - - } - - private void testQueueWithArguments(Map<String, Object> arguments) throws AMQException - { - _session.createQueue(new AMQShortString(this.getName() + (_queueCount++)), false, false, false, arguments); - } - - public void testCreateNoArguments() throws AMQException, FailoverException - { - Map<String, Object> arguments = null; - testQueueWithArguments(arguments); - } - - public void testCreatePriorityInt() throws AMQException, FailoverException - { - Map<String, Object> arguments = new HashMap<String, Object>(); - - //Ensure we can call createQueue with a priority int value - arguments.put(AMQQueueFactory.X_QPID_PRIORITIES.toString(), 7); - testQueueWithArguments(arguments); - } - - /** - * @link https://issues.apache.org/jira/browse/QPID-1715, QPID-1716 - * - * @throws AMQException - * @throws FailoverException - */ - public void testCreatePriorityString() throws AMQException, FailoverException - { - Map<String, Object> arguments = new HashMap<String, Object>(); - - //Ensure we can call createQueue with a priority value that is not an int - arguments.put(AMQQueueFactory.X_QPID_PRIORITIES.toString(), "seven"); - try - { - - testQueueWithArguments(arguments); - fail("Invalid Property value still succeeds."); - } - catch (Exception e) - { - assertTrue("Incorrect error message thrown:" + e.getMessage(), - e.getMessage().startsWith("Queue create request with non integer value for :x-qpid-priorities=seven")); - } - } - - public void testCreateFlowToDiskValid() throws AMQException, FailoverException - { - 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); - arguments.put(AMQQueueFactory.QPID_MAX_SIZE.toString(), 100); - testQueueWithArguments(arguments); - } - - /** - * @link https://issues.apache.org/jira/browse/QPID-1715, QPID-1716 - * @throws AMQException - * @throws FailoverException - */ - public void testCreateFlowToDiskValidNoSize() throws AMQException, FailoverException - { - 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); - try - { - testQueueWithArguments(arguments); - } - catch (AMQException e) - { - assertTrue("Incorrect Error throw:" + e.getMessage() + - ":expecting:Queue create request with no qpid.max_size value", - e.getMessage().contains("Queue create request with no qpid.max_size value")); - } - } - - /** - * @link https://issues.apache.org/jira/browse/QPID-1715, QPID-1716 - * @throws AMQException - * @throws FailoverException - */ - public void testCreateFlowToDiskInvalid() throws AMQException, FailoverException - { - Map<String, Object> arguments = new HashMap<String, Object>(); - - arguments.put(AMQQueueFactory.QPID_POLICY_TYPE.toString(), "infinite"); - try - { - testQueueWithArguments(arguments); - fail("Invalid Property value still succeeds."); - } - catch (Exception e) - { - //Check error is correct - assertTrue("Incorrect error message thrown:" + e.getMessage(), - e.getMessage().startsWith("Queue create request with unknown Policy Type:infinite")); - } - - } - - /** - * @link https://issues.apache.org/jira/browse/QPID-1715, QPID-1716 - * @throws AMQException - * @throws FailoverException - */ - public void testCreateFlowToDiskInvalidSize() throws AMQException, FailoverException - { - Map<String, Object> arguments = new HashMap<String, Object>(); - - arguments.put(AMQQueueFactory.QPID_POLICY_TYPE.toString(), AMQQueueFactory.QPID_FLOW_TO_DISK); - arguments.put(AMQQueueFactory.QPID_MAX_SIZE.toString(), -1); - try - { - testQueueWithArguments(arguments); - fail("Invalid Property value still succeeds."); - } - catch (Exception e) - { - //Check error is correct - assertTrue("Incorrect error message thrown:" + e.getMessage(), - e.getMessage().startsWith("Queue create request with negative size:-1")); - } - - } - - -} diff --git a/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorUsingFlowToDiskTest.java b/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorUsingFlowToDiskTest.java deleted file mode 100644 index 67b127eeb8..0000000000 --- a/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorUsingFlowToDiskTest.java +++ /dev/null @@ -1,105 +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.server.queue; - -import org.apache.qpid.client.AMQSession; -import org.apache.qpid.framing.AMQShortString; -import org.apache.qpid.AMQException; - -import javax.jms.Session; -import javax.jms.Message; -import javax.jms.ConnectionFactory; -import javax.jms.Connection; -import javax.jms.JMSException; -import javax.naming.NamingException; -import java.util.HashMap; -import java.util.Map; - -public class QueueDepthWithSelectorUsingFlowToDiskTest extends QueueDepthWithSelectorTest -{ - - @Override - public void init() throws NamingException, JMSException, AMQException - { - //Incresae the number of messages to send - MSG_COUNT = 100; - - //Resize the array - _messages = new Message[MSG_COUNT]; - - - 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 QueueDepthWithSelectorTest is 17 bytes each so only give space for half - arguments.put(AMQQueueFactory.QPID_MAX_SIZE.toString(), 8 * MSG_COUNT); - - //Create the FlowToDisk Queue - Connection connection = ((ConnectionFactory) _context.lookup("connection")).createConnection(); - - AMQSession session = ((AMQSession)connection.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()); - connection.close(); - - super.init(); - } - - public void testOnlyGettingHalf() throws Exception - { - //Send messages - _logger.info("Starting to send messages"); - for (int msg = 0; msg < MSG_COUNT; msg++) - { - //Send a message that matches the selector - _producer.send(nextMessage(msg)); - - //Send one that doesn't - _producer.send(_producerSession.createTextMessage("MessageReturnTest")); - } - - - _logger.info("Closing connection"); - //Close the connection.. .giving the broker time to clean up its state. - _producerConnection.close(); - - //Verify we get all the messages. - _logger.info("Verifying messages"); - // Expecting there to be MSG_COUNT on the queue as we have sent - // MSG_COUNT * (one that matches selector and one that doesn't) - verifyAllMessagesRecevied(MSG_COUNT); - - //Close the connection.. .giving the broker time to clean up its state. - _clientConnection.close(); - - //Verify Broker state - _logger.info("Verifying broker state"); - verifyBrokerState(MSG_COUNT); - } - - - - - -} diff --git a/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowsingFlowToDiskTest.java b/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowsingFlowToDiskTest.java deleted file mode 100644 index 02965b5ab7..0000000000 --- a/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowsingFlowToDiskTest.java +++ /dev/null @@ -1,69 +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.client; - -import org.apache.qpid.AMQException; -import org.apache.qpid.framing.AMQShortString; -import org.apache.qpid.client.AMQSession; -import org.apache.qpid.server.queue.AMQQueueFactory; - -import javax.jms.JMSException; -import javax.jms.Connection; -import javax.jms.Session; -import java.util.Map; -import java.util.HashMap; - -public class QueueBrowsingFlowToDiskTest extends QueueBrowserAutoAckTest -{ - @Override - protected void sendMessages(Connection producerConnection, int messageSendCount) throws JMSException - { - try - { - setupFlowToDisk(producerConnection, messageSendCount , this.getName()); - } - catch (AMQException e) - { - fail("Unable to setup Flow to disk:"+e.getMessage()); - } - - super.sendMessages(producerConnection,messageSendCount); - } - - private void setupFlowToDisk(Connection producerConnection, int messages, String name) - throws AMQException, JMSException - { - 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 QBAAT is around 9-10 bytes each so only give space for half - arguments.put(AMQQueueFactory.QPID_MAX_SIZE.toString(), 5 * messages); - - //Create the FlowToDisk Queue - ((AMQSession) producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE)). - createQueue(new AMQShortString(name), false, false, false, arguments); - - // Get a JMS reference to the new queue - _queue = _clientSession.createQueue(name); - } - -} 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 deleted file mode 100644 index 15c65162f4..0000000000 --- a/java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeWithFlowtoDiskTest.java +++ /dev/null @@ -1,56 +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.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()); - } - -} diff --git a/java/systests/src/main/java/org/apache/qpid/test/unit/close/FlowToDiskBackingQueueDeleteTest.java b/java/systests/src/main/java/org/apache/qpid/test/unit/close/FlowToDiskBackingQueueDeleteTest.java deleted file mode 100644 index 3403d95f7a..0000000000 --- a/java/systests/src/main/java/org/apache/qpid/test/unit/close/FlowToDiskBackingQueueDeleteTest.java +++ /dev/null @@ -1,78 +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.unit.close; - -import org.apache.qpid.client.AMQSession; -import org.apache.qpid.framing.AMQShortString; -import org.apache.qpid.server.queue.AMQQueueFactory; -import org.apache.qpid.server.queue.FileQueueBackingStoreFactory; -import org.apache.qpid.test.utils.QpidTestCase; - -import javax.jms.Connection; -import javax.jms.Session; -import java.io.File; -import java.util.HashMap; -import java.util.Map; - -public class FlowToDiskBackingQueueDeleteTest extends QpidTestCase -{ - - public void test() throws Exception - { - - //Incresae the number of messages to send - - 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(), 1); - - Connection connection = getConnection(); - //Create the FlowToDisk Queue - AMQSession session = ((AMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE)); - - //Make the queue Autodelete and exclusive so we can check it is gone. - session.createQueue(new AMQShortString(getName()), true, false, true, arguments); - - //Check the backing store exists. - String workDir = System.getProperty("QPID_WORK", System.getProperty("java.io.tmpdir")); - - long binDir = FileQueueBackingStoreFactory.hash(getName()) & 0xFFL; - - //This is a little bit of an ugly method to find the backing store location - File backing = new File(workDir + File.separator - + FileQueueBackingStoreFactory.QUEUE_BACKING_DIR - + File.separator + "test" + File.separator - + binDir + File.separator + getName()); - - System.err.println(backing.toString()); - - assertTrue("QueueBacking Store not created.", backing.exists()); - - connection.close(); - - assertFalse("QueueBacking Store not deleted.", backing.exists()); - - } - -} |
