diff options
author | Martin Ritchie <ritchiem@apache.org> | 2009-04-16 12:28:10 +0000 |
---|---|---|
committer | Martin Ritchie <ritchiem@apache.org> | 2009-04-16 12:28:10 +0000 |
commit | e15bd730236df53aeafe1c61a8beb5aa9814c5f9 (patch) | |
tree | 0a7a9c0df1f9d145510113a1b544a87cc7f50bf1 /java | |
parent | e2fc1a8470cf5c6714aa9270b847ce6488106d6c (diff) | |
download | qpid-python-e15bd730236df53aeafe1c61a8beb5aa9814c5f9.tar.gz |
QPID-1817 : Update QTC to provide the configuration file to an external broker
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@765605 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
3 files changed, 22 insertions, 23 deletions
diff --git a/java/java.testprofile b/java/java.testprofile index 95282b8ee1..4567db5f28 100644 --- a/java/java.testprofile +++ b/java/java.testprofile @@ -1,4 +1,5 @@ -broker=${project.root}/build/bin/qpid-server -p @PORT -m @MPORT +broker.language=java +broker=${project.root}/build/bin/qpid-server -p @PORT -m @MPORT -c @CONFIG_FILE broker.clean=${project.root}/clean-dir ${build.data} broker.ready=Qpid Broker Ready diff --git a/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java b/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java index ba7a4bb19c..61c1326ad5 100644 --- a/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java +++ b/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java @@ -40,26 +40,9 @@ public class MultipleJCAProviderRegistrationTest extends QpidTestCase public void setUp() throws Exception { - super.setUp(); - - stopBroker(); - _broker = VM; - final String QpidHome = System.getProperty("QPID_HOME"); - - assertNotNull("QPID_HOME not set",QpidHome); - - final File defaultaclConfigFile = new File(QpidHome, "etc/config.xml"); - - if (!defaultaclConfigFile.exists()) - { - System.err.println("Configuration file not found:" + defaultaclConfigFile); - fail("Configuration file not found:" + defaultaclConfigFile); - } - - ConfigurationFileApplicationRegistry config = new ConfigurationFileApplicationRegistry(defaultaclConfigFile); - startBroker(); + super.setUp(); } public void test() throws Exception diff --git a/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java b/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java index d75b6276ac..9fc5a54079 100644 --- a/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java +++ b/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java @@ -35,6 +35,7 @@ import java.util.Map; import java.util.HashMap; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; +import java.net.MalformedURLException; import org.apache.qpid.client.transport.TransportConnection; import org.apache.qpid.client.AMQConnection; @@ -127,6 +128,7 @@ public class QpidTestCase extends TestCase private static List<String> _exclusionList; // system properties + private static final String BROKER_LANGUAGE = "broker.language"; private static final String BROKER = "broker"; private static final String BROKER_CLEAN = "broker.clean"; private static final String BROKER_VERSION = "broker.version"; @@ -134,6 +136,8 @@ public class QpidTestCase extends TestCase private static final String TEST_OUTPUT = "test.output"; // values + protected static final String JAVA = "java"; + protected static final String CPP = "cpp"; protected static final String VM = "vm"; protected static final String EXTERNAL = "external"; private static final String VERSION_08 = "0-8"; @@ -144,6 +148,7 @@ public class QpidTestCase extends TestCase protected int DEFAULT_VM_PORT = 1; protected int DEFAULT_PORT = 5672; + protected String _brokerLanguage = System.getProperty(BROKER_LANGUAGE, JAVA); protected String _broker = System.getProperty(BROKER, VM); private String _brokerClean = System.getProperty(BROKER_CLEAN, null); private String _brokerVersion = System.getProperty(BROKER_VERSION, VERSION_08); @@ -331,11 +336,21 @@ public class QpidTestCase extends TestCase } } - private String getBrokerCommand(int port) + private String getBrokerCommand(int port) throws MalformedURLException { - return _broker - .replace("@PORT", "" + port) - .replace("@MPORT", "" + (port + (8999 - DEFAULT_PORT))); + if (_brokerLanguage.equals(JAVA)) + { + return _broker + .replace("@PORT", "" + port) + .replace("@MPORT", "" + (port + (8999 - DEFAULT_PORT))) + .replace("@CONFIG_FILE", _configFile.toString()); + } + else + { + return _broker + .replace("@PORT", "" + port) + .replace("@MPORT", "" + (port + (8999 - DEFAULT_PORT))); + } } public void startBroker(int port) throws Exception |