You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2015/08/11 17:23:24 UTC
[2/2] activemq-artemis git commit: Openwire test fix: Fixed issues
with TcpTransportBrokerTest removed one irrelevant test Not all tests in it
are passing however that'll fix 125 of total 128 tests.
Openwire test fix:
Fixed issues with TcpTransportBrokerTest
removed one irrelevant test
Not all tests in it are passing however that'll
fix 125 of total 128 tests.
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/bb1e03c0
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/bb1e03c0
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/bb1e03c0
Branch: refs/heads/master
Commit: bb1e03c0798439ce22523f7bcb55b281f8781d16
Parents: 126be4c
Author: Howard Gao <hg...@redhat.com>
Authored: Tue Aug 11 16:06:46 2015 +0800
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Aug 11 11:23:08 2015 -0400
----------------------------------------------------------------------
.../org/apache/activemq/broker/BrokerService.java | 17 +++++++++++++++++
.../artemiswrapper/ArtemisBrokerWrapper.java | 8 +++++++-
.../org/apache/activemq/broker/BrokerTest.java | 4 ----
.../transport/TransportBrokerTestSupport.java | 3 ++-
4 files changed, 26 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bb1e03c0/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/BrokerService.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/BrokerService.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/BrokerService.java
index b46c346..a3dce7f 100644
--- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/BrokerService.java
+++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/BrokerService.java
@@ -22,6 +22,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URI;
+import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@@ -633,6 +634,22 @@ public class BrokerService implements Service {
map.clear();
return runningBrokers;
}
+
+ public URI getConnectURI() {
+ URI uri = null;
+ try {
+ if (this.extraConnectors.size() > 0) {
+ Integer port = extraConnectors.iterator().next();
+ uri = new URI("tcp://localhost:" + port);
+ } else {
+ uri = new URI(this.getDefaultUri());
+ }
+ } catch (URISyntaxException e) {
+ //ignore
+ }
+ return uri;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bb1e03c0/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java
index 31da179..bf92a9c 100644
--- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java
+++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java
@@ -199,6 +199,12 @@ public class ArtemisBrokerWrapper extends ArtemisBrokerBase {
settings.setSlowConsumerCheckPeriod(1);
settings.setSlowConsumerPolicy(SlowConsumerPolicy.NOTIFY);
}
+ if (entry.isProducerFlowControl()) {
+ settings.setMaxSizeBytes(10240).setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
+ if (bservice.getSystemUsage().isSendFailIfNoSpace()) {
+ settings.setAddressFullMessagePolicy(AddressFullMessagePolicy.FAIL);
+ }
+ }
}
PolicyEntry defaultEntry = policyMap.getDefaultEntry();
@@ -209,7 +215,7 @@ public class ArtemisBrokerWrapper extends ArtemisBrokerBase {
settingsMap.put("#", defSettings);
}
if (defaultEntry.isProducerFlowControl()) {
- defSettings.setMaxSizeBytes(1).setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
+ defSettings.setMaxSizeBytes(10240).setAddressFullMessagePolicy(AddressFullMessagePolicy.BLOCK);
if (bservice.getSystemUsage().isSendFailIfNoSpace()) {
defSettings.setAddressFullMessagePolicy(AddressFullMessagePolicy.FAIL);
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bb1e03c0/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTest.java
index e225f00..8ec55b7 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/BrokerTest.java
@@ -1653,10 +1653,6 @@ public class BrokerTest extends BrokerTestSupport {
connection.request(createAck(consumerInfo, m3, 1, MessageAck.DELIVERED_ACK_TYPE));
}
- public void testGetServices() throws Exception {
- assertTrue(broker.getServices().length != 0);
- }
-
public static Test suite() {
return suite(BrokerTest.class);
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bb1e03c0/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TransportBrokerTestSupport.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TransportBrokerTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TransportBrokerTestSupport.java
index 501c2a0..a40e873 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TransportBrokerTestSupport.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/TransportBrokerTestSupport.java
@@ -25,6 +25,7 @@ import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.BrokerTest;
import org.apache.activemq.broker.StubConnection;
import org.apache.activemq.broker.TransportConnector;
+import org.apache.activemq.broker.artemiswrapper.ArtemisBrokerWrapper;
public abstract class TransportBrokerTestSupport extends BrokerTest {
@@ -65,7 +66,7 @@ public abstract class TransportBrokerTestSupport extends BrokerTest {
// Note: on platforms like OS X we cannot bind to the actual hostname, so we
// instead use the original host name (typically localhost) to bind to
- URI actualURI = connector.getServer().getConnectURI();
+ URI actualURI = this.broker.getConnectURI();
URI connectURI = new URI(actualURI.getScheme(), actualURI.getUserInfo(), bindURI.getHost(), actualURI.getPort(), actualURI.getPath(), bindURI.getQuery(), bindURI.getFragment());
Transport transport = TransportFactory.connect(connectURI);