mirror of https://github.com/apache/activemq.git
add simple vm properties test
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@990066 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
966de0ce55
commit
550637b84c
|
@ -16,8 +16,11 @@
|
|||
*/
|
||||
package org.apache.activemq.config;
|
||||
|
||||
import javax.jms.Connection;
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.activemq.ActiveMQConnectionFactory;
|
||||
import org.apache.activemq.broker.BrokerFactory;
|
||||
import org.apache.activemq.broker.BrokerRegistry;
|
||||
import org.apache.activemq.broker.BrokerService;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
@ -37,5 +40,21 @@ public class BrokerPropertiesTest extends TestCase {
|
|||
assertEquals("isUseJmx()", false, broker.isUseJmx());
|
||||
assertEquals("isPersistent()", false, broker.isPersistent());
|
||||
assertEquals("getBrokerName()", "Cheese", broker.getBrokerName());
|
||||
broker.stop();
|
||||
}
|
||||
|
||||
|
||||
public void testVmBrokerPropertiesFile() throws Exception {
|
||||
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://localhost?brokerConfig=properties:org/apache/activemq/config/broker.properties");
|
||||
Connection connection = factory.createConnection();
|
||||
BrokerService broker = BrokerRegistry.getInstance().lookup("Cheese");
|
||||
LOG.info("Found broker : " + broker);
|
||||
assertNotNull(broker);
|
||||
|
||||
assertEquals("isUseJmx()", false, broker.isUseJmx());
|
||||
assertEquals("isPersistent()", false, broker.isPersistent());
|
||||
assertEquals("getBrokerName()", "Cheese", broker.getBrokerName());
|
||||
connection.close();
|
||||
broker.stop();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue