Moved testCleanSession_maintainClientSubscriptions from custome API to Fuse's
This commit is contained in:
@@ -63,6 +63,27 @@ public class ServerIntegrationFuseTest {
|
|||||||
assertEquals("/topic", msg.getTopic());
|
assertEquals("/topic", msg.getTopic());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCleanSession_maintainClientSubscriptions() throws Exception {
|
||||||
|
MQTT localMqtt = new MQTT(m_mqtt);
|
||||||
|
localMqtt.setCleanSession(false);
|
||||||
|
BlockingConnection connection = localMqtt.blockingConnection();
|
||||||
|
connection.connect();
|
||||||
|
|
||||||
|
Topic[] topics = {new Topic("/topic", QoS.AT_MOST_ONCE)};
|
||||||
|
connection.subscribe(topics);
|
||||||
|
connection.disconnect();
|
||||||
|
|
||||||
|
//reconnect and publish
|
||||||
|
connection = localMqtt.blockingConnection();
|
||||||
|
connection.connect();
|
||||||
|
connection.publish("/topic", "Test my payload".getBytes(), QoS.AT_MOST_ONCE, false);
|
||||||
|
|
||||||
|
Message msg = connection.receive();
|
||||||
|
msg.ack();
|
||||||
|
assertEquals("/topic", msg.getTopic());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPublishWithQoS1() throws Exception {
|
public void testPublishWithQoS1() throws Exception {
|
||||||
m_connection = m_mqtt.blockingConnection();
|
m_connection = m_mqtt.blockingConnection();
|
||||||
|
|||||||
Reference in New Issue
Block a user