broker/MapDBPersistentStoreTest: code formatter used
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
*
|
||||
* You may elect to redistribute this code under either of these licenses.
|
||||
*/
|
||||
|
||||
package io.moquette.spi.persistence;
|
||||
|
||||
import io.moquette.BrokerConstants;
|
||||
@@ -29,11 +30,9 @@ import io.netty.handler.codec.mqtt.MqttQoS;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
@@ -109,7 +108,8 @@ public class MapDBPersistentStoreTest {
|
||||
// request a first ID
|
||||
|
||||
int packetId = m_sessionsStore.nextPacketID("CLIENT");
|
||||
m_sessionsStore.inFlight("CLIENT", packetId, new MessageGUID("ABCDE")); //simulate an inflight
|
||||
m_sessionsStore.inFlight("CLIENT", packetId, new MessageGUID("ABCDE")); // simulate an
|
||||
// inflight
|
||||
assertEquals(1, packetId);
|
||||
|
||||
// release the ID
|
||||
@@ -125,7 +125,8 @@ public class MapDBPersistentStoreTest {
|
||||
m_storageService.close();
|
||||
|
||||
// verify the executor is shutdown
|
||||
assertTrue("Storage service scheduler can't be stopped in 3 seconds",
|
||||
assertTrue(
|
||||
"Storage service scheduler can't be stopped in 3 seconds",
|
||||
m_storageService.m_scheduler.awaitTermination(3, TimeUnit.SECONDS));
|
||||
assertTrue(m_storageService.m_scheduler.isTerminated());
|
||||
}
|
||||
@@ -133,8 +134,10 @@ public class MapDBPersistentStoreTest {
|
||||
@Test
|
||||
public void testDropMessagesInSessionCleanAllNotRetainedStoredMessages() {
|
||||
m_sessionsStore.createNewSession("TestClient", true);
|
||||
IMessagesStore.StoredMessage publishToStore = new IMessagesStore.StoredMessage("Hello".getBytes(),
|
||||
MqttQoS.EXACTLY_ONCE, "/topic");
|
||||
IMessagesStore.StoredMessage publishToStore = new IMessagesStore.StoredMessage(
|
||||
"Hello".getBytes(),
|
||||
MqttQoS.EXACTLY_ONCE,
|
||||
"/topic");
|
||||
publishToStore.setClientID(TEST_CLIENT);
|
||||
publishToStore.setMessageID(1);
|
||||
publishToStore.setRetained(false);
|
||||
@@ -151,8 +154,10 @@ public class MapDBPersistentStoreTest {
|
||||
@Test
|
||||
public void testDropMessagesInSessionDoesntCleanAnyRetainedStoredMessages() {
|
||||
m_sessionsStore.createNewSession("TestClient", true);
|
||||
IMessagesStore.StoredMessage publishToStore = new IMessagesStore.StoredMessage("Hello".getBytes(),
|
||||
MqttQoS.EXACTLY_ONCE, "/topic");
|
||||
IMessagesStore.StoredMessage publishToStore = new IMessagesStore.StoredMessage(
|
||||
"Hello".getBytes(),
|
||||
MqttQoS.EXACTLY_ONCE,
|
||||
"/topic");
|
||||
publishToStore.setClientID(TEST_CLIENT);
|
||||
publishToStore.setMessageID(1);
|
||||
publishToStore.setRetained(true);
|
||||
|
||||
Reference in New Issue
Block a user