MCPcopy Create free account
hub / github.com/apache/mesos / SetUpTestCase

Method SetUpTestCase

src/tests/zookeeper.cpp:54–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53
54void ZooKeeperTest::SetUpTestCase()
55{
56 if (!Jvm::created()) {
57 const string zookeeper = "zookeeper-" ZOOKEEPER_VERSION;
58 string zkHome =
59 path::join(flags.build_dir, "3rdparty", zookeeper);
60#ifdef USE_CMAKE_BUILD_CONFIG
61 // CMake build directory is further nested.
62 zkHome = path::join(zkHome, "src", zookeeper);
63#endif // USE_CMAKE_BUILD_CONFIG
64
65 string classpath = "-Djava.class.path=" +
66 path::join(zkHome, zookeeper + ".jar");
67
68 // Now add all the libraries in 'lib' too.
69 Try<list<string>> jars = fs::list(path::join(zkHome, "lib", "*.jar"));
70
71 CHECK_SOME(jars);
72
73 foreach (const string& jar, jars.get()) {
74#ifdef __WINDOWS__
75 classpath += ";";
76#else
77 classpath += ":";
78#endif
79 classpath += jar;
80 }
81
82 LOG(INFO) << "Using Java classpath: " << classpath;
83
84 vector<string> options;
85 options.push_back(classpath);
86 Try<Jvm*> jvm = Jvm::create(options);
87 CHECK_SOME(jvm);
88
89 if (!flags.verbose) {
90 // Silence server logs.
91 org::apache::log4j::Logger::getRootLogger()
92 .setLevel(org::apache::log4j::Level::OFF);
93
94 // Silence client logs.
95 // TODO(jsirois): Create C++ ZooKeeper::setLevel.
96 zoo_set_debug_level(ZOO_LOG_LEVEL_ERROR);
97 }
98 }
99}
100
101
102void ZooKeeperTest::SetUp()

Callers

nothing calls this directly

Calls 4

setLevelMethod · 0.80
joinFunction · 0.50
listFunction · 0.50
createFunction · 0.50

Tested by

no test coverage detected