MCPcopy
hub / github.com/OpenTSDB/opentsdb / httpIncludeOverrideTest

Method httpIncludeOverrideTest

test/tools/TestConfigArgP.java:293–307  ·  view source on GitHub ↗

Validates that an HTTP URL defined include successfully overrides the default values. @throws Exception thrown on any error

()

Source from the content-addressed store, hash-verified

291 * @throws Exception thrown on any error
292 */
293 @SuppressWarnings("unchecked")
294 @Test
295 public void httpIncludeOverrideTest() throws Exception {
296 try {
297 final String url = newResponderForContent("/content", configToContent(
298 new ConfigArgP().getConfig(),
299 Collections.singletonMap("tsd.network.worker_threads", "7")),
300 "plain/text");
301 ConfigArgP cap = new ConfigArgP("--include", url); // include overwrites config
302 Config config = cap.getConfig();
303 assertEquals("The HTTP overriden value for key [tsd.network.worker_threads]", 7, config.getInt("tsd.network.worker_threads"));
304 } finally {
305 webServer.removeResponder("/content");
306 }
307 }
308
309
310 /**

Callers

nothing calls this directly

Calls 6

configToContentMethod · 0.95
getConfigMethod · 0.95
getIntMethod · 0.95
removeResponderMethod · 0.80
getConfigMethod · 0.45

Tested by

no test coverage detected