git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@905973 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2010-02-03 10:23:34 +00:00
parent 164826a421
commit 02fe43b8b6
2 changed files with 9 additions and 5 deletions

View File

@ -30,11 +30,8 @@ import org.apache.activemq.test.JmsTopicSendReceiveWithTwoConnectionsTest;
*/
public class BrokerXmlConfigFromJNDITest extends JmsTopicSendReceiveWithTwoConnectionsTest {
protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
// START SNIPPET: example
assertBaseDirectoryContainsSpaces();
// System.err.print(System.getProperties());
// we could put these properties into a jndi.properties
// on the classpath instead
Hashtable properties = new Hashtable();
@ -42,7 +39,6 @@ public class BrokerXmlConfigFromJNDITest extends JmsTopicSendReceiveWithTwoConne
// configure the embedded broker using an XML config file
// which is either a URL or a resource on the classpath
File f = new File(System.getProperty("basedir", "."), "/src/test/resources/activemq.xml");
properties.put(Context.PROVIDER_URL, "vm://localhost?brokerConfig=xbean:" + f.toURI());

View File

@ -16,6 +16,7 @@
*/
package org.apache.activemq.test;
import java.io.File;
import java.lang.reflect.Array;
import javax.jms.Connection;
@ -169,6 +170,13 @@ public abstract class TestSupport extends TestCase {
assertEquals(message, m1, m2);
}
}
/**
* Test if base directory contains spaces
*/
protected void assertBaseDirectoryContainsSpaces() {
assertFalse("Base directory cannot contain spaces.", new File(System.getProperty("basedir", ".")).getAbsoluteFile().toString().contains(" "));
}
/**
* Creates an ActiveMQConnectionFactory.