broker/ConfigurationParserTest: code formatter used
This commit is contained in:
@@ -13,17 +13,16 @@
|
|||||||
*
|
*
|
||||||
* You may elect to redistribute this code under either of these licenses.
|
* You may elect to redistribute this code under either of these licenses.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.moquette.server.config;
|
package io.moquette.server.config;
|
||||||
|
|
||||||
import io.moquette.BrokerConstants;
|
import io.moquette.BrokerConstants;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
@@ -45,7 +44,7 @@ public class ConfigurationParserTest {
|
|||||||
public void checkDefaultOptions() {
|
public void checkDefaultOptions() {
|
||||||
Properties props = m_parser.getProperties();
|
Properties props = m_parser.getProperties();
|
||||||
|
|
||||||
//verifyDefaults(props);
|
// verifyDefaults(props);
|
||||||
assertTrue(props.isEmpty());
|
assertTrue(props.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,8 +53,8 @@ public class ConfigurationParserTest {
|
|||||||
Reader conf = new StringReader(" ");
|
Reader conf = new StringReader(" ");
|
||||||
m_parser.parse(conf);
|
m_parser.parse(conf);
|
||||||
|
|
||||||
//Verify
|
// Verify
|
||||||
// verifyDefaults(m_parser.getProperties());
|
// verifyDefaults(m_parser.getProperties());
|
||||||
assertTrue(m_parser.getProperties().isEmpty());
|
assertTrue(m_parser.getProperties().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,8 +63,8 @@ public class ConfigurationParserTest {
|
|||||||
Reader conf = new StringReader("#simple comment");
|
Reader conf = new StringReader("#simple comment");
|
||||||
m_parser.parse(conf);
|
m_parser.parse(conf);
|
||||||
|
|
||||||
//Verify
|
// Verify
|
||||||
// verifyDefaults(m_parser.getProperties());
|
// verifyDefaults(m_parser.getProperties());
|
||||||
assertTrue(m_parser.getProperties().isEmpty());
|
assertTrue(m_parser.getProperties().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,21 +79,18 @@ public class ConfigurationParserTest {
|
|||||||
Reader conf = new StringReader("port 1234");
|
Reader conf = new StringReader("port 1234");
|
||||||
m_parser.parse(conf);
|
m_parser.parse(conf);
|
||||||
|
|
||||||
//Verify
|
// Verify
|
||||||
assertEquals("1234", m_parser.getProperties().getProperty("port"));
|
assertEquals("1234", m_parser.getProperties().getProperty("port"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void parseCompleteFile() throws ParseException {
|
public void parseCompleteFile() throws ParseException {
|
||||||
String content = "# This is initial m_config format \r\n"
|
String content = "# This is initial m_config format \r\n" + " \r\n" + "port 1234 \r\n"
|
||||||
+ " \r\n"
|
+ "host localhost \r\n" + "fake multi word string property\r\n";
|
||||||
+ "port 1234 \r\n"
|
|
||||||
+ "host localhost \r\n"
|
|
||||||
+ "fake multi word string property\r\n";
|
|
||||||
Reader conf = new StringReader(content);
|
Reader conf = new StringReader(content);
|
||||||
m_parser.parse(conf);
|
m_parser.parse(conf);
|
||||||
|
|
||||||
//Verify
|
// Verify
|
||||||
Properties props = m_parser.getProperties();
|
Properties props = m_parser.getProperties();
|
||||||
assertEquals("1234", props.getProperty("port"));
|
assertEquals("1234", props.getProperty("port"));
|
||||||
assertEquals("localhost", props.getProperty("host"));
|
assertEquals("localhost", props.getProperty("host"));
|
||||||
|
|||||||
Reference in New Issue
Block a user