You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ri...@apache.org on 2009/04/16 14:28:10 UTC
svn commit: r765605 - in /qpid/trunk/qpid/java: java.testprofile
systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java
systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
Author: ritchiem
Date: Thu Apr 16 12:28:10 2009
New Revision: 765605
URL: http://svn.apache.org/viewvc?rev=765605&view=rev
Log:
QPID-1817 : Update QTC to provide the configuration file to an external broker
Modified:
qpid/trunk/qpid/java/java.testprofile
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
Modified: qpid/trunk/qpid/java/java.testprofile
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/java.testprofile?rev=765605&r1=765604&r2=765605&view=diff
==============================================================================
--- qpid/trunk/qpid/java/java.testprofile (original)
+++ qpid/trunk/qpid/java/java.testprofile Thu Apr 16 12:28:10 2009
@@ -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
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java?rev=765605&r1=765604&r2=765605&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java Thu Apr 16 12:28:10 2009
@@ -40,26 +40,9 @@
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
Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java?rev=765605&r1=765604&r2=765605&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java Thu Apr 16 12:28:10 2009
@@ -35,6 +35,7 @@
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 @@
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 @@
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 @@
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 @@
}
}
- 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
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org