Fixed NPE exception of inflight ACK because the publisher with clean=true removed all messages, also the published from message store
This commit is contained in:
@@ -74,7 +74,7 @@ public class ServerIntegrationFuseTest {
|
||||
|
||||
@Test
|
||||
public void checkWillTestamentIsPublishedOnConnectionKill_noRetain() throws Exception {
|
||||
LOG.info("checkWillTestamentIsPublishedOnConnectionKill");
|
||||
LOG.info("checkWillTestamentIsPublishedOnConnectionKill_noRetain");
|
||||
|
||||
String willTestamentTopic = "/will/test";
|
||||
String willTestamentMsg = "Bye bye";
|
||||
@@ -93,7 +93,6 @@ public class ServerIntegrationFuseTest {
|
||||
m_mqtt.setClientId("Subscriber");
|
||||
m_subscriber = m_mqtt.blockingConnection();
|
||||
m_subscriber.connect();
|
||||
// Topic[] topics = new Topic[]{new Topic(willTestamentTopic, QoS.AT_LEAST_ONCE)};
|
||||
Topic[] topics = new Topic[]{new Topic(willTestamentTopic, QoS.AT_MOST_ONCE)};
|
||||
m_subscriber.subscribe(topics);
|
||||
|
||||
|
||||
@@ -286,6 +286,7 @@ public class ServerIntegrationPahoTest {
|
||||
assertEquals("Hello MQTT", m_messagesCollector.getMessage(true).toString());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void checkReceivePublishedMessage_after_a_reconnect_with_notCleanSession() throws Exception {
|
||||
LOG.info("*** checkReceivePublishedMessage_after_a_reconnect_with_notCleanSession ***");
|
||||
@@ -461,10 +462,10 @@ public class ServerIntegrationPahoTest {
|
||||
clientForPublish.publish("topic", "Hello".getBytes(), 2, true);
|
||||
|
||||
//verify clientForSubscribe1 doesn't receive a notification but clientForSubscribe2 yes
|
||||
System.out.println("Before waiting to receive 1 sec from " + clientForSubscribe1.getClientId());
|
||||
LOG.info("Before waiting to receive 1 sec from " + clientForSubscribe1.getClientId());
|
||||
assertFalse(clientForSubscribe1.isConnected());
|
||||
assertTrue(clientForSubscribe2.isConnected());
|
||||
System.out.println("Waiting to receive 1 sec from " + clientForSubscribe2.getClientId());
|
||||
LOG.info("Waiting to receive 1 sec from " + clientForSubscribe2.getClientId());
|
||||
MqttMessage messageOnB = cbSubscriber2.getMessage(true);
|
||||
assertEquals("Hello", new String(messageOnB.getPayload()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user