activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r1054096 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/network/ test/java/org/apache/activemq/broker/advisory/
Date Fri, 31 Dec 2010 11:18:15 GMT
Author: dejanb
Date: Fri Dec 31 11:18:14 2010
New Revision: 1054096

URL: http://svn.apache.org/viewvc?rev=1054096&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3107 - make sure advisories work for bridges created
by duplex

Added:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/advisory/AdvisoryDuplexNetworkBridgeTest.java
Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/advisory/AdvisoryNetworkBridgeTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java?rev=1054096&r1=1054095&r2=1054096&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
Fri Dec 31 11:18:14 2010
@@ -148,7 +148,6 @@ public abstract class DemandForwardingBr
         this.duplexInitiatingConnection = connection;
         start();
         serviceRemoteCommand(remoteBrokerInfo);
-        brokerService.getBroker().networkBridgeStarted(remoteBrokerInfo);
     }
 
     public void start() throws Exception {

Added: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/advisory/AdvisoryDuplexNetworkBridgeTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/advisory/AdvisoryDuplexNetworkBridgeTest.java?rev=1054096&view=auto
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/advisory/AdvisoryDuplexNetworkBridgeTest.java
(added)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/advisory/AdvisoryDuplexNetworkBridgeTest.java
Fri Dec 31 11:18:14 2010
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.broker.advisory;
+
+import org.apache.activemq.broker.BrokerFactory;
+import org.apache.activemq.broker.BrokerService;
+
+import java.net.URI;
+
+public class AdvisoryDuplexNetworkBridgeTest extends AdvisoryNetworkBridgeTest {
+
+    @Override
+    public void createBroker1() throws Exception {
+        broker1 = new BrokerService();
+        broker1.setBrokerName("broker1");
+        broker1.addConnector("tcp://localhost:61617");
+        broker1.setUseJmx(false);
+        broker1.setPersistent(false);
+        broker1.start();
+        broker1.waitUntilStarted();
+    }
+
+    @Override
+    public void createBroker2() throws Exception {
+        broker2 = BrokerFactory.createBroker(new URI("xbean:org/apache/activemq/network/duplexLocalBroker.xml"));
+        broker2.start();
+        broker2.waitUntilStarted();
+    }
+}

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/advisory/AdvisoryNetworkBridgeTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/advisory/AdvisoryNetworkBridgeTest.java?rev=1054096&r1=1054095&r2=1054096&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/advisory/AdvisoryNetworkBridgeTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/advisory/AdvisoryNetworkBridgeTest.java
Fri Dec 31 11:18:14 2010
@@ -36,9 +36,7 @@ public class AdvisoryNetworkBridgeTest e
 
 
     public void testAdvisory() throws Exception {
-        broker1 = BrokerFactory.createBroker(new URI("xbean:org/apache/activemq/network/reconnect-broker1.xml"));
-        broker1.start();
-        broker1.waitUntilStarted();
+        createBroker1();
 
         ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://broker1");
         Connection conn = factory.createConnection();
@@ -48,9 +46,7 @@ public class AdvisoryNetworkBridgeTest e
         
         Thread.sleep(1000);
 
-        broker2 = BrokerFactory.createBroker(new URI("xbean:org/apache/activemq/network/reconnect-broker2.xml"));
-        broker2.start();
-        broker2.waitUntilStarted();
+        createBroker2();
         
         ActiveMQMessage advisory = (ActiveMQMessage)consumer.receive(2000);
         assertNotNull(advisory);
@@ -67,6 +63,19 @@ public class AdvisoryNetworkBridgeTest e
 
     }
 
+    public void createBroker1() throws Exception {
+        broker1 = BrokerFactory.createBroker(new URI("xbean:org/apache/activemq/network/reconnect-broker1.xml"));
+        broker1.start();
+        broker1.waitUntilStarted();
+    }
+
+    public void createBroker2() throws Exception {
+        broker2 = BrokerFactory.createBroker(new URI("xbean:org/apache/activemq/network/reconnect-broker2.xml"));
+        broker2.start();
+        broker2.waitUntilStarted();
+    }
+
+
     @Override
     protected void tearDown() throws Exception {
        broker1.stop();



Mime
View raw message