summaryrefslogtreecommitdiff
path: root/qpid/java/systests
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org = rgodfrey = Robert Godfrey rgodfrey@apache.org@apache.org>2014-04-13 08:49:34 +0000
committerRobert Godfrey <rgodfrey@apache.org = rgodfrey = Robert Godfrey rgodfrey@apache.org@apache.org>2014-04-13 08:49:34 +0000
commit6fa7bd72f94ed7f71d5b0c58883dcac180ea67e5 (patch)
tree6bc3cb95ee88d2b64c7b7484b67f9528d7b4dc2a /qpid/java/systests
parent3490d98ad80b047819ac5e83e17f8dd2c5ef3b3c (diff)
downloadqpid-python-6fa7bd72f94ed7f71d5b0c58883dcac180ea67e5.tar.gz
QPID-5687 : [Java Broker] fix the initial config store to use "type" not "pluginType", add a test that checks the broker will startup with no config store. Change the handling of ${amqp.qpid_port} and friends to allow setting through system properties
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1586938 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests')
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/BrokerStartupTest.java41
-rwxr-xr-xqpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java2
2 files changed, 35 insertions, 8 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/BrokerStartupTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/BrokerStartupTest.java
index eba2a638c0..e3d0901942 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/BrokerStartupTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/BrokerStartupTest.java
@@ -20,6 +20,13 @@
*/
package org.apache.qpid.server;
+import java.io.File;
+import java.util.List;
+
+import javax.jms.Connection;
+import javax.jms.Queue;
+import javax.jms.Session;
+
import junit.framework.AssertionFailedError;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
@@ -27,12 +34,6 @@ import org.apache.log4j.Logger;
import org.apache.qpid.server.logging.AbstractTestLogging;
import org.apache.qpid.util.LogMonitor;
-import javax.jms.Connection;
-import javax.jms.Queue;
-import javax.jms.Session;
-import java.io.File;
-import java.util.List;
-
/**
* Series of tests to validate the external Java broker starts up as expected.
*/
@@ -47,7 +48,33 @@ public class BrokerStartupTest extends AbstractTestLogging
//part of the test case.
}
-
+ /**
+ * This test simply tests that the broker will startup even if there is no config file (i.e. that it can use the
+ * currently packaged initial config file (all system tests by default generate their own config file).
+ *
+ * It makes the assumption that setting the system property qpid.amqp_port
+ * to the value of getPort(0) will allow a connection to be established with getConnection()
+ *
+ * @throws Exception
+ */
+ public void testStartupWithNoConfig() throws Exception
+ {
+ if (isJavaBroker())
+ {
+ int port = getPort(0);
+ int managementPort = getManagementPort(port);
+ int connectorServerPort = managementPort + JMXPORT_CONNECTORSERVER_OFFSET;
+
+ setTestSystemProperty("qpid.amqp_port",String.valueOf(port));
+ setTestSystemProperty("qpid.jmx_port",String.valueOf(managementPort));
+ setTestSystemProperty("qpid.rmi_port",String.valueOf(connectorServerPort));
+ startBroker(port, null);
+
+ Connection conn = getConnection();
+ assertNotNull(conn);
+ conn.close();
+ }
+ }
/**
* Description:
* Test that providing an invalid broker logging configuration file does not
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
index 8dcf3b9010..c31f2eed3d 100755
--- a/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
@@ -689,7 +689,7 @@ public class QpidBrokerTestCase extends QpidTestCase
{
String testConfig = getTestConfigFile(port);
String relative = getPathRelativeToWorkingDirectory(testConfig);
- if (!testConfiguration.isSaved())
+ if (testConfiguration != null && !testConfiguration.isSaved())
{
_logger.info("Saving test broker configuration at: " + testConfig);
testConfiguration.save(new File(testConfig));