Added the 'disabled' keyword in config to disable a listener on a port
This commit is contained in:
@@ -55,7 +55,7 @@ public class ConfigurationClassLoaderTest implements IAuthenticator, IAuthorizat
|
||||
|
||||
@Test
|
||||
public void loadAuthenticator() throws Exception {
|
||||
Properties props = new Properties(IntegrationUtils.prepareTestPropeties());
|
||||
Properties props = new Properties(IntegrationUtils.prepareTestProperties());
|
||||
props.setProperty(BrokerConstants.AUTHENTICATOR_CLASS_NAME, "io.moquette.server.ConfigurationClassLoaderTest");
|
||||
startServer(props);
|
||||
assertTrue(true);
|
||||
@@ -64,7 +64,7 @@ public class ConfigurationClassLoaderTest implements IAuthenticator, IAuthorizat
|
||||
|
||||
@Test
|
||||
public void loadAuthorizator() throws Exception {
|
||||
Properties props = new Properties(IntegrationUtils.prepareTestPropeties());
|
||||
Properties props = new Properties(IntegrationUtils.prepareTestProperties());
|
||||
props.setProperty(BrokerConstants.AUTHORIZATOR_CLASS_NAME, "io.moquette.server.ConfigurationClassLoaderTest");
|
||||
startServer(props);
|
||||
assertTrue(true);
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.util.Properties;
|
||||
|
||||
import static io.moquette.BrokerConstants.DEFAULT_MOQUETTE_STORE_MAP_DB_FILENAME;
|
||||
import static io.moquette.BrokerConstants.PERSISTENT_STORE_PROPERTY_NAME;
|
||||
import static io.moquette.BrokerConstants.PORT_PROPERTY_NAME;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
/**
|
||||
@@ -35,9 +36,10 @@ public class IntegrationUtils {
|
||||
return currentDir + File.separator + DEFAULT_MOQUETTE_STORE_MAP_DB_FILENAME;
|
||||
}
|
||||
|
||||
public static Properties prepareTestPropeties() {
|
||||
public static Properties prepareTestProperties() {
|
||||
Properties testProperties = new Properties();
|
||||
testProperties.put(PERSISTENT_STORE_PROPERTY_NAME, IntegrationUtils.localMapDBPath());
|
||||
testProperties.put(PORT_PROPERTY_NAME, "1883");
|
||||
return testProperties;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ServerIntegrationEmbeddedPublishTest {
|
||||
|
||||
protected void startServer() throws IOException {
|
||||
m_server = new Server();
|
||||
final Properties configProps = IntegrationUtils.prepareTestPropeties();
|
||||
final Properties configProps = IntegrationUtils.prepareTestProperties();
|
||||
m_config = new MemoryConfig(configProps);
|
||||
m_server.startServer(m_config);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ServerIntegrationFuseTest {
|
||||
|
||||
protected void startServer() throws IOException {
|
||||
m_server = new Server();
|
||||
final Properties configProps = IntegrationUtils.prepareTestPropeties();
|
||||
final Properties configProps = IntegrationUtils.prepareTestProperties();
|
||||
m_config = new MemoryConfig(configProps);
|
||||
m_server.startServer(m_config);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ServerIntegrationPahoTest {
|
||||
|
||||
protected void startServer() throws IOException {
|
||||
m_server = new Server();
|
||||
final Properties configProps = IntegrationUtils.prepareTestPropeties();
|
||||
final Properties configProps = IntegrationUtils.prepareTestProperties();
|
||||
m_config = new MemoryConfig(configProps);
|
||||
m_server.startServer(m_config);
|
||||
}
|
||||
@@ -193,7 +193,7 @@ public class ServerIntegrationPahoTest {
|
||||
|
||||
m_server.stopServer();
|
||||
|
||||
m_server.startServer(IntegrationUtils.prepareTestPropeties());
|
||||
m_server.startServer(IntegrationUtils.prepareTestProperties());
|
||||
|
||||
//reconnect and publish
|
||||
m_client.connect(options);
|
||||
|
||||
@@ -62,7 +62,7 @@ public class ServerIntegrationQoSValidationTest {
|
||||
|
||||
protected void startServer() throws IOException {
|
||||
m_server = new Server();
|
||||
final Properties configProps = IntegrationUtils.prepareTestPropeties();
|
||||
final Properties configProps = IntegrationUtils.prepareTestProperties();
|
||||
m_config = new MemoryConfig(configProps);
|
||||
m_server.startServer(m_config);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ServerIntegrationWebSocketTest {
|
||||
|
||||
protected void startServer() throws IOException {
|
||||
m_server = new Server();
|
||||
final Properties configProps = IntegrationUtils.prepareTestPropeties();
|
||||
final Properties configProps = IntegrationUtils.prepareTestProperties();
|
||||
configProps.put(BrokerConstants.WEB_SOCKET_PORT_PROPERTY_NAME, Integer.toString(BrokerConstants.WEBSOCKET_PORT));
|
||||
m_config = new MemoryConfig(configProps);
|
||||
m_server.startServer(m_config);
|
||||
|
||||
@@ -17,7 +17,6 @@ package io.moquette.server;
|
||||
|
||||
import io.moquette.parser.proto.messages.ConnectMessage;
|
||||
import io.moquette.parser.proto.messages.AbstractMessage;
|
||||
import io.moquette.parser.proto.messages.AbstractMessage.QOSType;
|
||||
import io.moquette.parser.proto.messages.ConnAckMessage;
|
||||
import io.moquette.server.config.IConfig;
|
||||
import io.moquette.server.config.MemoryConfig;
|
||||
@@ -50,7 +49,7 @@ public class ServerLowlevelMessagesIntegrationTests {
|
||||
|
||||
protected void startServer() throws IOException {
|
||||
m_server = new Server();
|
||||
final Properties configProps = IntegrationUtils.prepareTestPropeties();
|
||||
final Properties configProps = IntegrationUtils.prepareTestProperties();
|
||||
m_config = new MemoryConfig(configProps);
|
||||
m_server.startServer(m_config);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ServerRestartIntegrationTest {
|
||||
|
||||
protected void startServer() throws IOException {
|
||||
m_server = new Server();
|
||||
final Properties configProps = IntegrationUtils.prepareTestPropeties();
|
||||
final Properties configProps = IntegrationUtils.prepareTestProperties();
|
||||
m_config = new MemoryConfig(configProps);
|
||||
m_server.startServer(m_config);
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class ServerRestartIntegrationTest {
|
||||
IntegrationUtils.cleanPersistenceFile(m_config);
|
||||
|
||||
//restart the server
|
||||
m_server.startServer(IntegrationUtils.prepareTestPropeties());
|
||||
m_server.startServer(IntegrationUtils.prepareTestProperties());
|
||||
|
||||
//reconnect the Subscriber subscribing to the same /topic but different QoS
|
||||
m_subscriber.connect(CLEAN_SESSION_OPT);
|
||||
@@ -128,7 +128,7 @@ public class ServerRestartIntegrationTest {
|
||||
m_server.stopServer();
|
||||
|
||||
//restart the server
|
||||
m_server.startServer(IntegrationUtils.prepareTestPropeties());
|
||||
m_server.startServer(IntegrationUtils.prepareTestProperties());
|
||||
|
||||
m_publisher.connect();
|
||||
m_publisher.publish("/topic", "Hello world MQTT!!".getBytes(), 0, false);
|
||||
@@ -148,7 +148,7 @@ public class ServerRestartIntegrationTest {
|
||||
m_server.stopServer();
|
||||
|
||||
//restart the server
|
||||
m_server.startServer(IntegrationUtils.prepareTestPropeties());
|
||||
m_server.startServer(IntegrationUtils.prepareTestProperties());
|
||||
//subscriber reconnects
|
||||
m_subscriber = new MqttClient("tcp://localhost:1883", "Subscriber", s_dataStore);
|
||||
m_subscriber.setCallback(m_messageCollector);
|
||||
|
||||
Reference in New Issue
Block a user