Moved testUnsubscribe_do_not_notify_anymore_new_session from custome API to Fuse's

This commit is contained in:
andrea
2013-08-28 22:24:50 +02:00
parent f46cce493f
commit 693f498d05
@@ -174,6 +174,28 @@ public class ServerIntegrationFuseTest {
assertEquals("/topic", msg.getTopic());
}
@Test
public void testUnsubscribe_do_not_notify_anymore_new_session() throws Exception {
m_connection = m_mqtt.blockingConnection();
m_connection.connect();
m_connection.subscribe(new Topic[] {new Topic("/topic", QoS.AT_MOST_ONCE)});
m_connection.publish("/topic", "Test my payload".getBytes(), QoS.AT_MOST_ONCE, false);
//check message received
Message msg = m_connection.receive();
msg.ack();
assertEquals("/topic", msg.getTopic());
String[] topics = new String[] {"/topic"};
m_connection.unsubscribe(topics);
m_connection.disconnect();
BlockingConnection anotherConnection = m_mqtt.blockingConnection();
anotherConnection.connect();
anotherConnection.publish("/topic", "Test my payload".getBytes(), QoS.AT_MOST_ONCE, false);
msg = anotherConnection.receive(1, TimeUnit.SECONDS);
assertNull(msg);
}
@Test
public void testPublishWithQoS1() throws Exception {
m_connection = m_mqtt.blockingConnection();