summaryrefslogtreecommitdiff
path: root/java/client/src/test
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2011-11-11 10:19:08 +0000
committerRobert Gemmell <robbie@apache.org>2011-11-11 10:19:08 +0000
commit26077f9bb4c93e90e8484b3fbc4847edd3e7bd89 (patch)
treeb2f37757b36298a724083501b9b9ea0380524938 /java/client/src/test
parent7f6fa1251db88c5546bf7fba973844512f025eb3 (diff)
downloadqpid-python-26077f9bb4c93e90e8484b3fbc4847edd3e7bd89.tar.gz
QPID-3610: set TCP_NODELAY to true by default, add new system property for changing default, add unit tests for system properties + connection url options.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1200803 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client/src/test')
-rw-r--r--java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.java31
1 files changed, 21 insertions, 10 deletions
diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.java b/java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.java
index 9095f94960..506185cbaf 100644
--- a/java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.java
+++ b/java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.java
@@ -20,19 +20,35 @@
*/
package org.apache.qpid.test.unit.client.BrokerDetails;
-import java.util.HashMap;
-import java.util.Map;
-
import junit.framework.TestCase;
import org.apache.qpid.client.AMQBrokerDetails;
-import org.apache.qpid.client.AMQConnectionURL;
-import org.apache.qpid.jms.ConnectionURL;
import org.apache.qpid.jms.BrokerDetails;
import org.apache.qpid.url.URLSyntaxException;
public class BrokerDetailsTest extends TestCase
{
+ public void testDefaultTCP_NODELAY() throws URLSyntaxException
+ {
+ String brokerURL = "tcp://localhost:5672";
+ AMQBrokerDetails broker = new AMQBrokerDetails(brokerURL);
+
+ assertNull("default value should be null", broker.getProperty(BrokerDetails.OPTIONS_TCP_NO_DELAY));
+ }
+
+ public void testOverridingTCP_NODELAY() throws URLSyntaxException
+ {
+ String brokerURL = "tcp://localhost:5672?tcp_nodelay='true'";
+ AMQBrokerDetails broker = new AMQBrokerDetails(brokerURL);
+
+ assertTrue("value should be true", Boolean.valueOf(broker.getProperty(BrokerDetails.OPTIONS_TCP_NO_DELAY)));
+
+ brokerURL = "tcp://localhost:5672?tcp_nodelay='false''&maxprefetch='1'";
+ broker = new AMQBrokerDetails(brokerURL);
+
+ assertFalse("value should be false", Boolean.valueOf(broker.getProperty(BrokerDetails.OPTIONS_TCP_NO_DELAY)));
+ }
+
public void testMultiParameters() throws URLSyntaxException
{
String url = "tcp://localhost:5672?timeout='200',immediatedelivery='true'";
@@ -82,9 +98,4 @@ public class BrokerDetailsTest extends TestCase
}
}
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(BrokerDetailsTest.class);
- }
}