From 6d30196fb80357e4db8487db7bf6971cce73966d Mon Sep 17 00:00:00 2001 From: Andrew Donald Kennedy Date: Thu, 17 Feb 2011 15:28:52 +0000 Subject: QPID-3066: Correct conditions for running UTF8Test git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1071642 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/qpid/test/unit/message/UTF8Test.java | 35 ++++++++-------------- 1 file changed, 12 insertions(+), 23 deletions(-) (limited to 'qpid/java/systests/src') diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java index 81089a4dfc..fe929b4965 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java @@ -34,9 +34,8 @@ import java.io.*; /** - * @author Apache Software Foundation - * This test makes sure that utf8 characters can be used for - * specifying exchange, queue name and routing key. + * This test makes sure that utf8 characters can be used for + * specifying exchange, queue name and routing key. * * those tests are related to qpid-1384 */ @@ -44,7 +43,6 @@ public class UTF8Test extends QpidBrokerTestCase { private static final Logger _logger = LoggerFactory.getLogger(UTF8Test.class); - public void testPlainEn() throws Exception { invoke("UTF8En"); @@ -56,7 +54,6 @@ public class UTF8Test extends QpidBrokerTestCase invoke("UTF8Jp"); } - private void invoke(String name) throws Exception { String path = System.getProperties().getProperty("QPID_HOME"); @@ -65,6 +62,7 @@ public class UTF8Test extends QpidBrokerTestCase runTest(in.readLine(), in.readLine(), in.readLine(), in.readLine()); in.close(); } + private void runTest(String exchangeName, String queueName, String routingKey, String data) throws Exception { _logger.info("Running test for exchange: " + exchangeName @@ -89,26 +87,17 @@ public class UTF8Test extends QpidBrokerTestCase private void declareQueue(String exch, String routkey, String qname) throws Exception { - Connection conn = new Connection(); - if (!_broker.equals(QpidBrokerTestCase.EXTERNAL) && !isBroker08()) - { - conn.connect("localhost", QpidBrokerTestCase.DEFAULT_PORT, "test", "guest", "guest",false); - } - else - { - throw new Exception("unsupported test " + - "configuration. broker: " + _broker + " version > 0.10 "+ !isBroker08() + " This test must be run on a local broker using protocol 0.10 or higher."); - } - Session sess = conn.createSession(0); - sess.exchangeDeclare(exch, "direct", null, null); - sess.queueDeclare(qname, null, null); - sess.exchangeBind(qname, exch, routkey, null); - sess.sync(); - conn.close(); + Connection conn = new Connection(); + conn.connect("localhost", QpidBrokerTestCase.DEFAULT_PORT, "test", "guest", "guest",false); + Session sess = conn.createSession(0); + sess.exchangeDeclare(exch, "direct", null, null); + sess.queueDeclare(qname, null, null); + sess.exchangeBind(qname, exch, routkey, null); + sess.sync(); + conn.close(); } - private Destination getDestination(String exch, String routkey, String qname) - throws Exception + private Destination getDestination(String exch, String routkey, String qname) throws Exception { Properties props = new Properties(); props.setProperty("destination.directUTF8Queue", -- cgit v1.2.1