diff options
| author | Arnaud Simon <arnaudsimon@apache.org> | 2008-07-04 13:52:51 +0000 |
|---|---|---|
| committer | Arnaud Simon <arnaudsimon@apache.org> | 2008-07-04 13:52:51 +0000 |
| commit | f226a3025c8e6c7a50489710f2f9b7a15fbbdded (patch) | |
| tree | 446ae482028a17220f272e90d8c20ce7aad50bb1 /java | |
| parent | b30bd3079da06193dc3e4a8e53234c9bbca987bc (diff) | |
| download | qpid-python-f226a3025c8e6c7a50489710f2f9b7a15fbbdded.tar.gz | |
QPID-1079: Remove all classes that were no longer referenced + updated FlowControlTest for using QpidTestCase
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@674055 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
| -rw-r--r-- | java/010ExcludeList | 1 | ||||
| -rw-r--r-- | java/010ExcludeList-store | 1 | ||||
| -rw-r--r-- | java/systests/src/main/java/org/apache/qpid/test/VMBrokerSetup.java | 52 | ||||
| -rw-r--r-- | java/systests/src/main/java/org/apache/qpid/test/VMTestCase.java | 165 | ||||
| -rw-r--r-- | java/systests/src/main/java/org/apache/qpid/test/client/FlowControlTest.java | 26 |
5 files changed, 14 insertions, 231 deletions
diff --git a/java/010ExcludeList b/java/010ExcludeList index 442fac2ffe..545b759a5e 100644 --- a/java/010ExcludeList +++ b/java/010ExcludeList @@ -45,6 +45,7 @@ org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFails 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.FlowControlTest#* // the 0.10 c++ broker does not implement forget org.apache.qpid.test.unit.xa.FaultTest#testForget // the 0-10 c++ broker does not implement priority / this test depends on a Java broker extension for queue creation diff --git a/java/010ExcludeList-store b/java/010ExcludeList-store index 1c62003474..da39ea0cd5 100644 --- a/java/010ExcludeList-store +++ b/java/010ExcludeList-store @@ -40,6 +40,7 @@ org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFails 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.FlowControlTest#* // the 0.10 c++ broker does not implement forget org.apache.qpid.test.unit.xa.FaultTest#testForget // the 0-10 c++ broker does not implement priority / this test depends on a Java broker extension for queue creation diff --git a/java/systests/src/main/java/org/apache/qpid/test/VMBrokerSetup.java b/java/systests/src/main/java/org/apache/qpid/test/VMBrokerSetup.java deleted file mode 100644 index e859fac4af..0000000000 --- a/java/systests/src/main/java/org/apache/qpid/test/VMBrokerSetup.java +++ /dev/null @@ -1,52 +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; - -import junit.extensions.TestSetup; -import junit.framework.Test; - -import org.apache.qpid.client.transport.TransportConnection; - -public class VMBrokerSetup extends TestSetup -{ - public VMBrokerSetup(Test t) - { - super(t); - } - - protected void setUp() throws Exception - { - super.setUp(); - try - { - TransportConnection.createVMBroker(1); - } - catch (Exception e) - { - fail("Unable to create broker: " + e); - } - } - - protected void tearDown() throws Exception - { - TransportConnection.killVMBroker(1); - super.tearDown(); - } -} diff --git a/java/systests/src/main/java/org/apache/qpid/test/VMTestCase.java b/java/systests/src/main/java/org/apache/qpid/test/VMTestCase.java deleted file mode 100644 index dcdfb11618..0000000000 --- a/java/systests/src/main/java/org/apache/qpid/test/VMTestCase.java +++ /dev/null @@ -1,165 +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; - -import junit.framework.TestCase; -import org.apache.qpid.client.AMQDestination; -import org.apache.qpid.client.AMQSession; -import org.apache.qpid.client.transport.TransportConnection; -import org.apache.qpid.framing.AMQShortString; -import org.apache.qpid.jndi.PropertiesFileInitialContextFactory; -import org.apache.qpid.server.registry.ApplicationRegistry; -import org.apache.qpid.AMQException; - -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.JMSException; -import javax.jms.Queue; -import javax.jms.Session; -import javax.naming.Context; -import javax.naming.NamingException; -import javax.naming.spi.InitialContextFactory; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.LinkedList; -import java.util.Iterator; -import java.util.Map; -import java.util.HashMap; - -public class VMTestCase extends TestCase -{ - protected long RECEIVE_TIMEOUT = 1000l; // 1 sec - protected long CLOSE_TIMEOUT = 10000l; // 10 secs - - protected Context _context; - protected String _clientID; - protected String _virtualhost; - protected String _brokerlist; - - protected final Map<String, String> _connections = new HashMap<String, String>(); - protected final Map<String, String> _queues = new HashMap<String, String>(); - protected final Map<String, String> _topics = new HashMap<String, String>(); - - protected void setUp() throws Exception - { - super.setUp(); - try - { - TransportConnection.createVMBroker(1); - } - catch (Exception e) - { - fail("Unable to create broker: " + e); - } - - InitialContextFactory factory = new PropertiesFileInitialContextFactory(); - - Hashtable<String, String> env = new Hashtable<String, String>(); - - if (_clientID == null) - { - _clientID = this.getClass().getName(); - } - - if (_virtualhost == null) - { - _virtualhost = "/test"; - } - - if (_brokerlist == null) - { - _brokerlist = "vm://:1"; - } - - env.put("connectionfactory.connection", "amqp://guest:guest@" + _clientID + _virtualhost + "?brokerlist='" - + _brokerlist + "'"); - - for (Map.Entry<String, String> c : _connections.entrySet()) - { - env.put("connectionfactory." + c.getKey(), c.getValue()); - } - - _queues.put("queue", "queue"); - - for (Map.Entry<String, String> q : _queues.entrySet()) - { - env.put("queue." + q.getKey(), q.getValue()); - } - - _topics.put("topic", "topic"); - - for (Map.Entry<String, String> t : _topics.entrySet()) - { - env.put("topic." + t.getKey(), t.getValue()); - } - - _context = factory.getInitialContext(env); - } - - protected void tearDown() throws Exception - { - //Disabled -// checkQueuesClean(); - - TransportConnection.killVMBroker(1); - ApplicationRegistry.remove(1); - - super.tearDown(); - } - - private void checkQueuesClean() throws NamingException, JMSException - { - Connection connection = ((ConnectionFactory) _context.lookup("connection")).createConnection(); - - Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - connection.start(); - - Iterator<String> queueNames = new HashSet<String>(_queues.values()).iterator(); - - assertTrue("QueueNames doesn't have next", queueNames.hasNext()); - - while (queueNames.hasNext()) - { - Queue queue = session.createQueue(queueNames.next()); - - //Validate that the queue are reporting empty. - long queueDepth = 0; - try - { - queueDepth = ((AMQSession) session).getQueueDepth((AMQDestination) queue); - } - catch (AMQException e) - { - //ignore - } - - assertEquals("Session reports Queue depth not as expected", 0, queueDepth); - } - - connection.close(); - } - - public int getMessageCount(String queueName) - { - return ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost(_virtualhost.substring(1)) - .getQueueRegistry().getQueue(new AMQShortString(queueName)).getMessageCount(); - } -} diff --git a/java/systests/src/main/java/org/apache/qpid/test/client/FlowControlTest.java b/java/systests/src/main/java/org/apache/qpid/test/client/FlowControlTest.java index da4f3ad0d1..b5a9bd2236 100644 --- a/java/systests/src/main/java/org/apache/qpid/test/client/FlowControlTest.java +++ b/java/systests/src/main/java/org/apache/qpid/test/client/FlowControlTest.java @@ -20,18 +20,16 @@ */ package org.apache.qpid.test.client; -import org.apache.qpid.test.VMTestCase; -import org.apache.qpid.client.AMQSession; import org.apache.qpid.client.AMQSession_0_8; import org.apache.qpid.client.AMQQueue; -import org.apache.qpid.AMQException; +import org.apache.qpid.test.FailoverBaseCase; import org.apache.log4j.Logger; import javax.jms.*; -import javax.naming.NamingException; -import java.util.Enumeration; -public class FlowControlTest extends VMTestCase + + +public class FlowControlTest extends FailoverBaseCase { private static final Logger _logger = Logger.getLogger(FlowControlTest.class); @@ -50,12 +48,12 @@ public class FlowControlTest extends VMTestCase /** * Simply */ - public void testBasicBytesFlowControl() throws JMSException, NamingException, AMQException + public void testBasicBytesFlowControl() throws Exception { _queue = new AMQQueue("amq.direct","testqueue");//(Queue) _context.lookup("queue"); //Create Client - _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection(); + _clientConnection = getConnection(); _clientConnection.start(); @@ -64,7 +62,7 @@ public class FlowControlTest extends VMTestCase //Ensure _queue is created _clientSession.createConsumer(_queue).close(); - Connection producerConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection(); + Connection producerConnection = getConnection(); producerConnection.start(); @@ -89,7 +87,7 @@ public class FlowControlTest extends VMTestCase producerConnection.close(); - Connection consumerConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection(); + Connection consumerConnection = getConnection(); Session consumerSession = consumerConnection.createSession(false, Session.CLIENT_ACKNOWLEDGE); ((AMQSession_0_8)consumerSession).setPrefecthLimits(0,256); MessageConsumer recv = consumerSession.createConsumer(_queue); @@ -125,12 +123,12 @@ public class FlowControlTest extends VMTestCase } - public void testTwoConsumersBytesFlowControl() throws JMSException, NamingException, AMQException + public void testTwoConsumersBytesFlowControl() throws Exception { _queue = new AMQQueue("amq.direct","testqueue1");//(Queue) _context.lookup("queue"); //Create Client - _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection(); + _clientConnection = getConnection(); _clientConnection.start(); @@ -139,7 +137,7 @@ public class FlowControlTest extends VMTestCase //Ensure _queue is created _clientSession.createConsumer(_queue).close(); - Connection producerConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection(); + Connection producerConnection = getConnection(); producerConnection.start(); @@ -164,7 +162,7 @@ public class FlowControlTest extends VMTestCase producerConnection.close(); - Connection consumerConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection(); + Connection consumerConnection = getConnection(); Session consumerSession1 = consumerConnection.createSession(false, Session.CLIENT_ACKNOWLEDGE); ((AMQSession_0_8)consumerSession1).setPrefecthLimits(0,256); MessageConsumer recv1 = consumerSession1.createConsumer(_queue); |
