diff options
| author | Robert Gemmell <robbie@apache.org> | 2011-09-30 13:38:45 +0000 |
|---|---|---|
| committer | Robert Gemmell <robbie@apache.org> | 2011-09-30 13:38:45 +0000 |
| commit | 3ff831ffa2c03a9b600206af1946352750011dcc (patch) | |
| tree | 8dc46a78a57f623fc3d4d342350fec6887cbcb6a /qpid/java/systests | |
| parent | d63afde285bdfdf1c0ba6229f3d9ba424e16ea15 (diff) | |
| download | qpid-python-3ff831ffa2c03a9b600206af1946352750011dcc.tar.gz | |
QPID-3402: ensure the test JVMs execute with the working dir set to the qpid/java dir, use relative paths to the broker startup script and config files, update the QBTC configuration override functionality to operate relative to QPID_HOME to avoid setting properties with spaces/parentheses into QPID_OPTS
Enables the java test profiles to cope with spaces/parentheses in the parent directory structure of the checkout, as found in the matrix project workspaces on the ASF Jenkins instances
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1177658 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests')
14 files changed, 34 insertions, 37 deletions
diff --git a/qpid/java/systests/etc/config-systests-aclv2.xml b/qpid/java/systests/etc/config-systests-aclv2.xml index 33563e7891..e8b971a2a0 100644 --- a/qpid/java/systests/etc/config-systests-aclv2.xml +++ b/qpid/java/systests/etc/config-systests-aclv2.xml @@ -22,7 +22,7 @@ <configuration> <system/> <override> - <xml fileName="${test.config}" optional="true"/> + <xml fileName="${QPID_HOME}/${test.config}" optional="true"/> <xml fileName="${QPID_HOME}/etc/config-systests-aclv2-settings.xml"/> <xml fileName="${QPID_HOME}/etc/config-systests-settings.xml"/> <xml fileName="${QPID_HOME}/etc/config.xml"/> diff --git a/qpid/java/systests/etc/config-systests-bdb.xml b/qpid/java/systests/etc/config-systests-bdb.xml index 4b3849b95f..9364006fcc 100644 --- a/qpid/java/systests/etc/config-systests-bdb.xml +++ b/qpid/java/systests/etc/config-systests-bdb.xml @@ -22,7 +22,7 @@ <configuration> <system/> <override> - <xml fileName="${test.config}" optional="true"/> + <xml fileName="${QPID_HOME}/${test.config}" optional="true"/> <xml fileName="${QPID_HOME}/etc/config-systests-bdb-settings.xml"/> <xml fileName="${QPID_HOME}/etc/config-systests-settings.xml"/> <xml fileName="${QPID_HOME}/etc/config.xml"/> diff --git a/qpid/java/systests/etc/config-systests-derby.xml b/qpid/java/systests/etc/config-systests-derby.xml index ba27a0c020..303154d8f0 100644 --- a/qpid/java/systests/etc/config-systests-derby.xml +++ b/qpid/java/systests/etc/config-systests-derby.xml @@ -22,7 +22,7 @@ <configuration> <system/> <override> - <xml fileName="${test.config}" optional="true"/> + <xml fileName="${QPID_HOME}/${test.config}" optional="true"/> <xml fileName="${QPID_HOME}/etc/config-systests-derby-settings.xml"/> <xml fileName="${QPID_HOME}/etc/config-systests-settings.xml"/> <xml fileName="${QPID_HOME}/etc/config.xml"/> diff --git a/qpid/java/systests/etc/config-systests-firewall.xml b/qpid/java/systests/etc/config-systests-firewall.xml index c0ce71210f..c73ac6a687 100644 --- a/qpid/java/systests/etc/config-systests-firewall.xml +++ b/qpid/java/systests/etc/config-systests-firewall.xml @@ -22,7 +22,7 @@ <configuration> <system/> <override> - <xml fileName="${test.config}" optional="true"/> + <xml fileName="${QPID_HOME}/${test.config}" optional="true"/> <xml fileName="${QPID_FIREWALL_CONFIG_SETTINGS}" optional="true"/> <xml fileName="${QPID_HOME}/etc/config-systests-firewall-settings.xml"/> <xml fileName="${QPID_HOME}/etc/config-systests-settings.xml"/> diff --git a/qpid/java/systests/etc/config-systests.xml b/qpid/java/systests/etc/config-systests.xml index 5d7d878e76..0e8f2803e3 100644 --- a/qpid/java/systests/etc/config-systests.xml +++ b/qpid/java/systests/etc/config-systests.xml @@ -22,7 +22,7 @@ <configuration> <system/> <override> - <xml fileName="${test.config}" optional="true"/> + <xml fileName="${QPID_HOME}/${test.config}" optional="true"/> <xml fileName="${QPID_HOME}/etc/config-systests-settings.xml"/> <xml fileName="${QPID_HOME}/etc/config.xml"/> </override> diff --git a/qpid/java/systests/etc/virtualhosts-systests-aclv2.xml b/qpid/java/systests/etc/virtualhosts-systests-aclv2.xml index eb96577487..db396d7ab1 100644 --- a/qpid/java/systests/etc/virtualhosts-systests-aclv2.xml +++ b/qpid/java/systests/etc/virtualhosts-systests-aclv2.xml @@ -22,7 +22,7 @@ <configuration> <system/> <override> - <xml fileName="${test.virtualhosts}" optional="true"/> + <xml fileName="${QPID_HOME}/${test.virtualhosts}" optional="true"/> <xml fileName="${QPID_HOME}/etc/virtualhosts-systests-aclv2-settings.xml"/> <xml fileName="${QPID_HOME}/etc/virtualhosts.xml"/> </override> diff --git a/qpid/java/systests/etc/virtualhosts-systests-bdb.xml b/qpid/java/systests/etc/virtualhosts-systests-bdb.xml index ee0d75416c..367fee65ac 100644 --- a/qpid/java/systests/etc/virtualhosts-systests-bdb.xml +++ b/qpid/java/systests/etc/virtualhosts-systests-bdb.xml @@ -22,7 +22,7 @@ <configuration> <system/> <override> - <xml fileName="${test.virtualhosts}" optional="true"/> + <xml fileName="${QPID_HOME}/${test.virtualhosts}" optional="true"/> <xml fileName="${QPID_HOME}/etc/virtualhosts-systests-bdb-settings.xml"/> <xml fileName="${QPID_HOME}/etc/virtualhosts.xml"/> </override> diff --git a/qpid/java/systests/etc/virtualhosts-systests-derby.xml b/qpid/java/systests/etc/virtualhosts-systests-derby.xml index 171be37416..3745100e1f 100644 --- a/qpid/java/systests/etc/virtualhosts-systests-derby.xml +++ b/qpid/java/systests/etc/virtualhosts-systests-derby.xml @@ -22,7 +22,7 @@ <configuration> <system/> <override> - <xml fileName="${test.virtualhosts}" optional="true"/> + <xml fileName="${QPID_HOME}/${test.virtualhosts}" optional="true"/> <xml fileName="${QPID_HOME}/etc/virtualhosts-systests-derby-settings.xml"/> <xml fileName="${QPID_HOME}/etc/virtualhosts.xml"/> </override> diff --git a/qpid/java/systests/etc/virtualhosts-systests-firewall.xml b/qpid/java/systests/etc/virtualhosts-systests-firewall.xml index 51ab6739b3..c5c6a86d7c 100644 --- a/qpid/java/systests/etc/virtualhosts-systests-firewall.xml +++ b/qpid/java/systests/etc/virtualhosts-systests-firewall.xml @@ -22,7 +22,7 @@ <configuration> <system/> <override> - <xml fileName="${test.virtualhosts}" optional="true"/> + <xml fileName="${QPID_HOME}/${test.virtualhosts}" optional="true"/> <xml fileName="${QPID_FIREWALL_VIRTUALHOSTS_SETTINGS}" optional="true"/> <xml fileName="${QPID_HOME}/etc/virtualhosts.xml"/> </override> diff --git a/qpid/java/systests/etc/virtualhosts-systests.xml b/qpid/java/systests/etc/virtualhosts-systests.xml index 71f1cc9889..d6aeefac72 100644 --- a/qpid/java/systests/etc/virtualhosts-systests.xml +++ b/qpid/java/systests/etc/virtualhosts-systests.xml @@ -22,7 +22,7 @@ <configuration> <system/> <override> - <xml fileName="${test.virtualhosts}" optional="true"/> + <xml fileName="${QPID_HOME}/${test.virtualhosts}" optional="true"/> <xml fileName="${QPID_HOME}/etc/virtualhosts.xml"/> </override> </configuration> diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java index e901903eb4..7969ffc059 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/BrokerLoggingTest.java @@ -246,7 +246,7 @@ public class BrokerLoggingTest extends AbstractTestLogging if (isJavaBroker() && isExternalBroker()) { // Get custom -l value used during testing for the broker startup - String customLog4j = _brokerCommand.substring(_brokerCommand.indexOf("-l") + 2); + String customLog4j = _brokerCommand.substring(_brokerCommand.indexOf("-l") + 2).trim(); String TESTID = "BRK-1007"; diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java index 8aa5b6d9de..32b0185f88 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java @@ -83,14 +83,8 @@ public abstract class AbstractACLTestCase extends QpidBrokerTestCase implements @Override public void setUp() throws Exception { - if (QpidHome == null) - { - fail("QPID_HOME not set"); - } - // Initialise ACLs. - _configFile = new File(QpidHome, "etc" + File.separator + getConfig()); - + _configFile = new File("build" + File.separator + "etc" + File.separator + getConfig()); // Initialise ACL files for (String virtualHost : getHostList()) { @@ -156,7 +150,7 @@ public abstract class AbstractACLTestCase extends QpidBrokerTestCase implements */ public void setUpACLFile(String virtualHost) throws IOException, ConfigurationException { - String path = QpidHome + File.separator + "etc"; + String path = "build" + File.separator + "etc"; String className = StringUtils.substringBeforeLast(getClass().getSimpleName().toLowerCase(), "test"); String testName = StringUtils.substringAfter(getName(), "test").toLowerCase(); diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/security/firewall/FirewallConfigTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/security/firewall/FirewallConfigTest.java index 2d99a44532..044a0af335 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/server/security/firewall/FirewallConfigTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/security/firewall/FirewallConfigTest.java @@ -35,16 +35,8 @@ public class FirewallConfigTest extends QpidBrokerTestCase @Override protected void setUp() throws Exception { - // do setup - final String QPID_HOME = System.getProperty("QPID_HOME"); - - if (QPID_HOME == null) - { - fail("QPID_HOME not set"); - } - // Setup initial config file. - _configFile = new File(QPID_HOME, "etc/config-systests-firewall.xml"); + _configFile = new File("build/etc/config-systests-firewall.xml"); // Setup temporary config file _tmpConfig = File.createTempFile("config-systests-firewall", ".xml"); @@ -86,7 +78,7 @@ public class FirewallConfigTest extends QpidBrokerTestCase public void testVhostAllowBrokerDeny() throws Exception { - _configFile = new File(System.getProperty("QPID_HOME"), "etc/config-systests-firewall-2.xml"); + _configFile = new File("build/etc/config-systests-firewall-2.xml"); super.setUp(); @@ -119,7 +111,7 @@ public class FirewallConfigTest extends QpidBrokerTestCase public void testVhostDenyBrokerAllow() throws Exception { - _configFile = new File(System.getProperty("QPID_HOME"), "etc/config-systests-firewall-3.xml"); + _configFile = new File("build/etc/config-systests-firewall-3.xml"); super.setUp(); 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 160522c2bb..bb44aea659 100644 --- 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 @@ -143,7 +143,7 @@ public class QpidBrokerTestCase extends QpidTestCase protected String _brokerCommand = System.getProperty(BROKER_COMMAND); private Boolean _brokerCleanBetweenTests = Boolean.getBoolean(BROKER_CLEAN_BETWEEN_TESTS); private final AmqpProtocolVersion _brokerVersion = AmqpProtocolVersion.valueOf(System.getProperty(BROKER_VERSION, "")); - protected String _output = System.getProperty(TEST_OUTPUT); + protected String _output = System.getProperty(TEST_OUTPUT, System.getProperty("java.io.tmpdir")); protected Boolean _brokerPersistent = Boolean.getBoolean(BROKER_PERSITENT); private String _brokerProtocolExcludes = System.getProperty(BROKER_PROTOCOL_EXCLUDES); @@ -653,21 +653,28 @@ public class QpidBrokerTestCase extends QpidTestCase public String getTestConfigFile() { - String path = _output == null ? System.getProperty("java.io.tmpdir") : _output; - return path + "/" + getTestQueueName() + "-config.xml"; + return _output + "/" + getTestQueueName() + "-config.xml"; } public String getTestVirtualhostsFile() { - String path = _output == null ? System.getProperty("java.io.tmpdir") : _output; - return path + "/" + getTestQueueName() + "-virtualhosts.xml"; + return _output + "/" + getTestQueueName() + "-virtualhosts.xml"; + } + + private String relativeToQpidHome(String file) + { + return file.replace(System.getProperty(QPID_HOME,"QPID_HOME") + "/",""); } protected void saveTestConfiguration() throws ConfigurationException { // Specify the test config file String testConfig = getTestConfigFile(); - setSystemProperty("test.config", testConfig); + String relative = relativeToQpidHome(testConfig); + + setSystemProperty("test.config", relative); + _logger.info("Set test.config property to: " + relative); + _logger.info("Saving test virtualhosts file at: " + testConfig); // Create the file if configuration does not exist if (_testConfiguration.isEmpty()) @@ -681,7 +688,11 @@ public class QpidBrokerTestCase extends QpidTestCase { // Specify the test virtualhosts file String testVirtualhosts = getTestVirtualhostsFile(); - setSystemProperty("test.virtualhosts", testVirtualhosts); + String relative = relativeToQpidHome(testVirtualhosts); + + setSystemProperty("test.virtualhosts", relative); + _logger.info("Set test.virtualhosts property to: " + relative); + _logger.info("Saving test virtualhosts file at: " + testVirtualhosts); // Create the file if configuration does not exist if (_testVirtualhosts.isEmpty()) |
