use of com.tvd12.properties.file.reader.BaseFileReader in project properties-file by tvd12.
the class PropertiesFileReaderTest method loadInputStreamTest.
@SuppressWarnings("unchecked")
@Test(expectedExceptions = { PropertiesFileException.class })
public void loadInputStreamTest() throws PropertiesFileException, IOException {
InputStream stream = mock(InputStream.class);
when(stream.read()).thenThrow(IOException.class);
new BaseFileReader().loadInputStream(stream);
}
use of com.tvd12.properties.file.reader.BaseFileReader in project properties-file by tvd12.
the class PropertiesFileReaderTest method testWithValidData2.
@Test
public void testWithValidData2() throws PropertiesFileException {
File file = new File(getClass().getClassLoader().getResource("classes.properties").getFile());
assertNotNull(new BaseFileReader().read(Lists.newArrayList(file, file)));
assertNotNull(new BaseFileReader().read(Lists.newArrayList(file, file)));
}
use of com.tvd12.properties.file.reader.BaseFileReader in project properties-file by tvd12.
the class YamlFileReaderTest method testDashKey.
@Test(expectedExceptions = YamlInvalidSyntaxException.class)
public void testDashKey() {
BaseFileReader reader = new BaseFileReader();
reader.read("invalid_yaml4.txt");
}
use of com.tvd12.properties.file.reader.BaseFileReader in project properties-file by tvd12.
the class PropertiesFileReaderTest method loadInputStreamTest.
@SuppressWarnings("unchecked")
@Test(expectedExceptions = { PropertiesFileException.class })
public void loadInputStreamTest() throws PropertiesFileException, IOException {
InputStream stream = mock(InputStream.class);
when(stream.read()).thenThrow(IOException.class);
new BaseFileReader().loadInputStream(stream);
}
use of com.tvd12.properties.file.reader.BaseFileReader in project properties-file by tvd12.
the class YamlFileReaderTest method readSpaces.
@Test
public void readSpaces() {
BaseFileReader reader = new BaseFileReader();
Properties properties = reader.read("application.yaml");
System.out.println(properties);
assert properties.get("include.profiles").equals("local,alpha");
assert properties.get("cors.allow_origin").equals("*");
assert properties.get("cors.enable").equals("true");
assert properties.get("server.port").equals("3005");
assert properties.get("server.host").equals("0.0.0.0");
assert properties.get("server.admin.username").equals("admin");
assert properties.get("server.admin.password").equals("123456");
assert properties.get("hello").equals("world");
assert properties.get("foo").equals("bar");
properties = reader.read("hello_yaml");
assert properties.get("hello").equals("world");
}
Aggregations