use of com.tvd12.properties.file.reader.BaseFileReader in project properties-file by tvd12.
the class YamlFileReaderTest method testEmptyKey.
@Test(expectedExceptions = YamlInvalidSyntaxException.class)
public void testEmptyKey() {
BaseFileReader reader = new BaseFileReader();
reader.read("invalid_yaml2.txt");
}
use of com.tvd12.properties.file.reader.BaseFileReader in project properties-file by tvd12.
the class YamlFileReaderTest method testInvalidSpaces.
@Test
public void testInvalidSpaces() {
BaseFileReader reader = new BaseFileReader();
Properties properties = reader.read("invalid_yaml3.txt");
System.out.println("testInvalidSpaces: " + properties);
}
use of com.tvd12.properties.file.reader.BaseFileReader in project properties-file by tvd12.
the class YamlFileReaderTest method readInvalidYamlFileLastSpaceCountEqualsLastSpaceCount.
@Test
public void readInvalidYamlFileLastSpaceCountEqualsLastSpaceCount() {
// given
BaseFileReader sut = new BaseFileReader();
// when
Throwable e = Asserts.assertThrows(() -> sut.read("v112_application_invalid2.yaml"));
// then
Asserts.assertEquals(YamlInvalidSyntaxException.class, e.getClass());
}
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 PropertiesFileReaderTest method getInputStreamByAbsolutePathTest.
@Test
public void getInputStreamByAbsolutePathTest() {
Method method = MethodBuilder.create().clazz(InputStreamUtil.class).method("getInputStreamByAbsolutePath").argument(File.class).build();
ReflectMethodUtil.invokeMethod(method, new BaseFileReader(), new File(getClass().getResource("/invalid.properties").getFile()));
ReflectMethodUtil.invokeMethod(method, new BaseFileReader(), new ExFile("abc"));
}
Aggregations