diff options
Diffstat (limited to 'java/client/src/test')
4 files changed, 56 insertions, 20 deletions
diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java b/java/client/src/test/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java index 68bdc6ddf2..c4b60be1d1 100644 --- a/java/client/src/test/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java +++ b/java/client/src/test/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java @@ -24,7 +24,7 @@ import org.apache.qpid.client.AMQTopic; import org.apache.qpid.client.AMQConnection; import org.apache.qpid.client.AMQQueue; import org.apache.qpid.client.AMQSession; -import org.apache.qpid.testutil.VMBrokerSetup; +import org.apache.qpid.client.transport.TransportConnection; import javax.jms.*; @@ -41,6 +41,7 @@ public class AMQConnectionTest extends TestCase protected void setUp() throws Exception { super.setUp(); + TransportConnection.createVMBroker(1); _connection = new AMQConnection("vm://:1", "guest", "guest", "fred", "/test"); _topic = new AMQTopic("mytopic"); _queue = new AMQQueue("myqueue"); @@ -48,6 +49,7 @@ public class AMQConnectionTest extends TestCase protected void tearDown() throws Exception { + super.tearDown(); try { _connection.close(); @@ -55,8 +57,8 @@ public class AMQConnectionTest extends TestCase catch (JMSException e) { //ignore - } - super.tearDown(); + } + TransportConnection.killAllVMBrokers(); } /** @@ -195,6 +197,6 @@ public class AMQConnectionTest extends TestCase public static junit.framework.Test suite() { - return new VMBrokerSetup(new junit.framework.TestSuite(AMQConnectionTest.class)); + return new junit.framework.TestSuite(AMQConnectionTest.class); } } diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseOkTest.java b/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseOkTest.java index ac789eb915..d84d66e26d 100644 --- a/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseOkTest.java +++ b/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseOkTest.java @@ -20,17 +20,17 @@ */ package org.apache.qpid.test.unit.client.channelclose; +import junit.framework.TestCase; +import junit.textui.TestRunner; +import org.apache.log4j.Logger; import org.apache.qpid.client.AMQConnection; import org.apache.qpid.client.AMQQueue; -import org.apache.qpid.testutil.VMBrokerSetup; -import org.apache.log4j.Logger; +import org.apache.qpid.client.transport.TransportConnection; import javax.jms.*; import java.util.ArrayList; import java.util.List; -import junit.framework.TestCase; -import junit.textui.TestRunner; /** * Due to bizarre exception handling all sessions are closed if you get @@ -64,6 +64,7 @@ public class ChannelCloseOkTest extends TestCase { super.setUp(); + TransportConnection.createVMBroker(1); _connection = new AMQConnection(_connectionString, "guest", "guest", randomize("Client"), "/test_path"); _destination1 = new AMQQueue("q1", true); @@ -192,7 +193,15 @@ public class ChannelCloseOkTest extends TestCase { while (received.size() < count) { - received.wait(); + try + { + received.wait(); + } + catch (InterruptedException e) + { + _log.info("Interrupted: " + e); + throw e; + } } } } @@ -209,6 +218,6 @@ public class ChannelCloseOkTest extends TestCase public static junit.framework.Test suite() { - return new VMBrokerSetup(new junit.framework.TestSuite(ChannelCloseOkTest.class)); + return new junit.framework.TestSuite(ChannelCloseOkTest.class); } } diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/message/StreamMessageTest.java b/java/client/src/test/java/org/apache/qpid/test/unit/message/StreamMessageTest.java index 184d7cb015..4f0ca6d3aa 100644 --- a/java/client/src/test/java/org/apache/qpid/test/unit/message/StreamMessageTest.java +++ b/java/client/src/test/java/org/apache/qpid/test/unit/message/StreamMessageTest.java @@ -1,11 +1,23 @@ -/** - * User: Robert Greig - * Date: 12-Dec-2006 - ****************************************************************************** - * (c) Copyright JP Morgan Chase Ltd 2006. All rights reserved. No part of - * this program may be photocopied reproduced or translated to another - * program language without prior written consent of JP Morgan Chase Ltd - ******************************************************************************/ +/* + * + * 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.message; import junit.framework.TestCase; diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java b/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java index 5ded8aaeef..8263e7f126 100644 --- a/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java +++ b/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java @@ -25,7 +25,7 @@ import org.apache.qpid.url.URLSyntaxException; import org.apache.qpid.client.AMQConnection; import org.apache.qpid.client.AMQSession; import org.apache.qpid.client.AMQTopic; -import org.apache.qpid.testutil.VMBrokerSetup; +import org.apache.qpid.client.transport.TransportConnection; import javax.jms.JMSException; import javax.jms.Message; @@ -39,6 +39,19 @@ import junit.framework.TestCase; public class DurableSubscriptionTest extends TestCase { + + protected void setUp() throws Exception + { + super.setUp(); + TransportConnection.createVMBroker(1); + } + + protected void tearDown() throws Exception + { + super.tearDown(); + TransportConnection.killAllVMBrokers(); + } + public void testUnsubscribe() throws AMQException, JMSException, URLSyntaxException { AMQTopic topic = new AMQTopic("MyTopic"); @@ -128,6 +141,6 @@ public class DurableSubscriptionTest extends TestCase public static junit.framework.Test suite() { - return new VMBrokerSetup(new junit.framework.TestSuite(DurableSubscriptionTest.class)); + return new junit.framework.TestSuite(DurableSubscriptionTest.class); } } |
