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:
Gary Tully 2010-08-27 08:31:00 +00:00
parent 966de0ce55
commit 550637b84c
1 changed files with 19 additions and 0 deletions

View File

@ -16,8 +16,11 @@
*/ */
package org.apache.activemq.config; package org.apache.activemq.config;
import javax.jms.Connection;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.BrokerFactory; import org.apache.activemq.broker.BrokerFactory;
import org.apache.activemq.broker.BrokerRegistry;
import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.BrokerService;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@ -37,5 +40,21 @@ public class BrokerPropertiesTest extends TestCase {
assertEquals("isUseJmx()", false, broker.isUseJmx()); assertEquals("isUseJmx()", false, broker.isUseJmx());
assertEquals("isPersistent()", false, broker.isPersistent()); assertEquals("isPersistent()", false, broker.isPersistent());
assertEquals("getBrokerName()", "Cheese", broker.getBrokerName()); 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();
} }
} }