Repository: activemq Updated Branches: refs/heads/master e375af381 -> 8ef44452a
https://issues.apache.org/jira/browse/AMQ-5880 Adds a test for the issue that is ignored for now while we wait for a fixed MQTT client release. Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/8ef44452 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/8ef44452 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/8ef44452 Branch: refs/heads/master Commit: 8ef44452a24685dea52b0757960c1a750abd4246 Parents: e375af3 Author: Timothy Bish <[email protected]> Authored: Tue Mar 1 16:18:16 2016 -0500 Committer: Timothy Bish <[email protected]> Committed: Tue Mar 1 16:18:16 2016 -0500 ---------------------------------------------------------------------- .../activemq/transport/mqtt/MQTTTest.java | 32 ++++++++++++++++++++ 1 file changed, 32 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/8ef44452/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTTest.java ---------------------------------------------------------------------- diff --git a/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTTest.java b/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTTest.java index a6e72e7..c89c15e 100644 --- a/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTTest.java +++ b/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTTest.java @@ -64,6 +64,7 @@ import org.fusesource.mqtt.client.Topic; import org.fusesource.mqtt.client.Tracer; import org.fusesource.mqtt.codec.MQTTFrame; import org.fusesource.mqtt.codec.PUBLISH; +import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -1337,6 +1338,37 @@ public class MQTTTest extends MQTTTestSupport { jmsConn.close(); } + @Ignore("Needs fix in MQTT client for string length decode.") + @Test(timeout = 30 * 10000) + public void testSubscribeWithLargeTopicFilter() throws Exception { + + byte[] payload = new byte[1024 * 32]; + for (int i = 0; i < payload.length; i++) { + payload[i] = '2'; + } + + StringBuilder topicBuilder = new StringBuilder("/topic/"); + + for (int i = 0; i < 32800; ++i) { + topicBuilder.append("a"); + } + + MQTT mqtt = createMQTTConnection(); + mqtt.setClientId("MQTT-Client"); + mqtt.setCleanSession(false); + + final BlockingConnection connection = mqtt.blockingConnection(); + connection.connect(); + + Topic[] topic = { new Topic(topicBuilder.toString(), QoS.EXACTLY_ONCE) }; + connection.subscribe(topic); + connection.publish(topic[0].name().toString(), payload, QoS.AT_LEAST_ONCE, false); + + Message message = connection.receive(); + assertNotNull(message); + message.ack(); + } + @Test(timeout = 30 * 10000) public void testSubscribeMultipleTopics() throws Exception {
