MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / constructorWithFile

Method constructorWithFile

test/utils/TestConfig.java:70–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68 }
69
70 @Test
71 public void constructorWithFile() throws Exception {
72 PowerMockito.whenNew(FileInputStream.class).withAnyArguments()
73 .thenReturn(mock(FileInputStream.class));
74 final Properties props = new Properties();
75 props.setProperty("tsd.test", "val1");
76 PowerMockito.whenNew(Properties.class).withNoArguments().thenReturn(props);
77
78 final Config config = new Config("/tmp/config.file");
79 assertNotNull(config);
80 assertEquals("/tmp/config.file", config.config_location);
81 assertEquals("val1", config.getString("tsd.test"));
82 }
83
84 @Test(expected = FileNotFoundException.class)
85 public void constructorFileNotFound() throws Exception {

Callers

nothing calls this directly

Calls 1

getStringMethod · 0.95

Tested by

no test coverage detected