From 550637b84c5b522d71a066a305019fa8e4f4f7b2 Mon Sep 17 00:00:00 2001 From: Gary Tully Date: Fri, 27 Aug 2010 08:31:00 +0000 Subject: [PATCH] add simple vm properties test git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@990066 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/config/BrokerPropertiesTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/activemq-core/src/test/java/org/apache/activemq/config/BrokerPropertiesTest.java b/activemq-core/src/test/java/org/apache/activemq/config/BrokerPropertiesTest.java index 32c04c3b6f..631fc2d175 100644 --- a/activemq-core/src/test/java/org/apache/activemq/config/BrokerPropertiesTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/config/BrokerPropertiesTest.java @@ -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(); } }