activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r365746 - in /incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq: spring/ test/retroactive/ xbean/
Date Tue, 03 Jan 2006 21:01:16 GMT
Author: chirino
Date: Tue Jan  3 13:01:10 2006
New Revision: 365746

URL: http://svn.apache.org/viewcvs?rev=365746&view=rev
Log:
use the BrokerFactory to create BrokerService objects

Modified:
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/spring/SpringTest.java
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithSimpleMessageListTest.java
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerWithMessageQueryTest.java
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/XBeanConfigTest.java

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/spring/SpringTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/spring/SpringTest.java?rev=365746&r1=365745&r2=365746&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/spring/SpringTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/spring/SpringTest.java
Tue Jan  3 13:01:10 2006
@@ -88,6 +88,7 @@
      * @throws Exception
      */
     protected void assertSenderConfig(String config) throws Exception {
+        Thread.currentThread().setContextClassLoader(SpringTest.class.getClassLoader());
         context = new ClassPathXmlApplicationContext(config);
 
         consumer = (SpringConsumer) context.getBean("consumer");

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithSimpleMessageListTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithSimpleMessageListTest.java?rev=365746&r1=365745&r2=365746&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithSimpleMessageListTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerTestWithSimpleMessageListTest.java
Tue Jan  3 13:01:10 2006
@@ -16,12 +16,8 @@
  */
 package org.apache.activemq.test.retroactive;
 
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.EmbeddedBrokerTestSupport;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.util.MessageIdList;
-import org.apache.activemq.xbean.BrokerFactoryBean;
-import org.springframework.core.io.ClassPathResource;
+import java.net.URI;
+import java.util.Date;
 
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
@@ -30,7 +26,11 @@
 import javax.jms.Session;
 import javax.jms.TextMessage;
 
-import java.util.Date;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.EmbeddedBrokerTestSupport;
+import org.apache.activemq.broker.BrokerFactory;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.util.MessageIdList;
 
 /**
  * 
@@ -93,9 +93,7 @@
     protected BrokerService createBroker() throws Exception {
         String uri = getBrokerXml();
         System.out.println("Loading broker configuration from the classpath with URI: " +
uri);
-        BrokerFactoryBean factory = new BrokerFactoryBean(new ClassPathResource(uri));
-        factory.afterPropertiesSet();
-        return factory.getBroker();
+        return BrokerFactory.createBroker(new URI("xbean:"+uri));
     }
 
     protected void startBroker() throws Exception {

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerWithMessageQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerWithMessageQueryTest.java?rev=365746&r1=365745&r2=365746&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerWithMessageQueryTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/retroactive/RetroactiveConsumerWithMessageQueryTest.java
Tue Jan  3 13:01:10 2006
@@ -18,6 +18,7 @@
 
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.EmbeddedBrokerTestSupport;
+import org.apache.activemq.broker.BrokerFactory;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.util.MessageIdList;
 import org.apache.activemq.xbean.BrokerFactoryBean;
@@ -30,6 +31,7 @@
 import javax.jms.Session;
 import javax.jms.TextMessage;
 
+import java.net.URI;
 import java.util.Date;
 
 /**
@@ -91,9 +93,7 @@
     protected BrokerService createBroker() throws Exception {
         String uri = getBrokerXml();
         System.out.println("Loading broker configuration from the classpath with URI: " +
uri);
-        BrokerFactoryBean factory = new BrokerFactoryBean(new ClassPathResource(uri));
-        factory.afterPropertiesSet();
-        return factory.getBroker();
+        return BrokerFactory.createBroker(new URI("xbean:"+uri));
     }
 
     protected void startBroker() throws Exception {

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/XBeanConfigTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/XBeanConfigTest.java?rev=365746&r1=365745&r2=365746&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/XBeanConfigTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/XBeanConfigTest.java
Tue Jan  3 13:01:10 2006
@@ -16,7 +16,12 @@
  */
 package org.apache.activemq.xbean;
 
+import java.net.URI;
+
+import junit.framework.TestCase;
+
 import org.apache.activemq.broker.Broker;
+import org.apache.activemq.broker.BrokerFactory;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.ConnectionContext;
 import org.apache.activemq.broker.region.Topic;
@@ -29,10 +34,6 @@
 import org.apache.activemq.command.ActiveMQTopic;
 import org.apache.activemq.command.ConnectionId;
 import org.apache.activemq.command.ConnectionInfo;
-import org.apache.activemq.xbean.BrokerFactoryBean;
-import org.springframework.core.io.ClassPathResource;
-
-import junit.framework.TestCase;
 
 /**
  * 
@@ -107,9 +108,9 @@
     }
 
     protected BrokerService createBroker() throws Exception {
-        BrokerFactoryBean factory = new BrokerFactoryBean(new ClassPathResource("org/apache/activemq/xbean/activemq-policy.xml"));
-        factory.afterPropertiesSet();
-        return factory.getBroker();
+        String uri = "org/apache/activemq/xbean/activemq-policy.xml";
+        System.out.println("Loading broker configuration from the classpath with URI: " +
uri);
+        return BrokerFactory.createBroker(new URI("xbean:"+uri));
     }
 
 }



Mime
View raw message