Added simple main class to test embedding of Broker
This commit is contained in:
@@ -49,7 +49,7 @@ class ConfigurationParser {
|
|||||||
ConfigurationParser(Properties properties) {
|
ConfigurationParser(Properties properties) {
|
||||||
this();
|
this();
|
||||||
for (Entry<Object, Object> entrySet : properties.entrySet()) {
|
for (Entry<Object, Object> entrySet : properties.entrySet()) {
|
||||||
m_properties.put(entrySet.getKey(), entrySet.getValue());
|
m_properties.put(entrySet.getKey(), entrySet.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<relativePath>../</relativePath>
|
||||||
|
<!--<relativePath>../pom.xml</relativePath>-->
|
||||||
|
<artifactId>moquette-parent</artifactId>
|
||||||
|
<groupId>org.eclipse.moquette</groupId>
|
||||||
|
<version>${moquette.version}</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>moquette-embedded-test</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<!--<version>${moquette-version}</version>-->
|
||||||
|
<name>Moquette - Embedded test</name>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.moquette</groupId>
|
||||||
|
<artifactId>moquette-broker</artifactId>
|
||||||
|
<version>0.8-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--<dependency>-->
|
||||||
|
<!--<groupId>org.slf4j</groupId>-->
|
||||||
|
<!--<artifactId>slf4j-log4j12</artifactId>-->
|
||||||
|
<!--<version>1.6.4</version>-->
|
||||||
|
<!--</dependency>-->
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>4.8.2</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
package org.eclipse.moquette.testembedded;
|
||||||
|
|
||||||
|
import org.eclipse.moquette.server.Server;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
public class EmbeddedLauncher {
|
||||||
|
public static void main(String[] args) throws InterruptedException, IOException {
|
||||||
|
final Server mqttBroker = new Server();
|
||||||
|
mqttBroker.startServer();
|
||||||
|
System.out.println("Broker started");
|
||||||
|
Thread.sleep(1000);
|
||||||
|
System.out.println("Stopping broker");
|
||||||
|
mqttBroker.stopServer();
|
||||||
|
System.out.println("Broker stopped");
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user