mirror of https://github.com/apache/activemq.git
Applied patcg for https://issues.apache.org/activemq/browse/AMQ-2555
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@905973 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
164826a421
commit
02fe43b8b6
|
@ -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());
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue