MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / constructorWithFile

Method constructorWithFile

test/TestConfig.java:87–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85 }
86
87 @Test
88 public void constructorWithFile() throws Exception {
89 PowerMockito.whenNew(FileInputStream.class).withAnyArguments()
90 .thenReturn(mock(FileInputStream.class));
91 final Properties props = new Properties();
92 props.setProperty("asynchbase.test", "val1");
93 PowerMockito.whenNew(Properties.class).withNoArguments().thenReturn(props);
94
95 final Config config = new Config("/tmp/config.file");
96 assertNotNull(config);
97 assertEquals("/tmp/config.file", config.config_location);
98 assertEquals("val1", config.getString("asynchbase.test"));
99 }
100
101 @Test(expected = FileNotFoundException.class)
102 public void constructorFileNotFound() throws Exception {

Callers

nothing calls this directly

Calls 1

getStringMethod · 0.95

Tested by

no test coverage detected