Permalink
Browse files

fix zktest build failures (fix #108)

  • Loading branch information...
1 parent 12eb520 commit a7d0e2652d5b7c4233157c1bf5922789106d976f @kmaehashi kmaehashi committed Sep 24, 2012
Showing with 16 additions and 7 deletions.
  1. +7 −2 src/common/cached_zk_test.cpp
  2. +9 −5 src/common/zk_test.cpp
@@ -37,13 +37,18 @@ namespace {
zk_ = pfi::lang::shared_ptr<jubatus::common::lock_service>
(common::create_lock_service("zk", "localhost:2181", 1024, "test.log"));
+ std::string engine_name, engine_root;
+ engine_name = "test";
+ engine_root = ACTOR_BASE_PATH + "/" + engine_name;
+
name_ = build_loc_str("localhost", 10000);
- build_actor_path(path, name_);
+ build_actor_path(path, engine_name, name_);
name1_ = build_loc_str("localhost", 10001);
- build_actor_path(path1, name1_);
+ build_actor_path(path1, engine_name, name1_);
zk_->create(JUBATUS_BASE_PATH, "");
zk_->create(ACTOR_BASE_PATH, "");
+ zk_->create(engine_root, "");
zk_->create(path, "hoge0", true);
zk_->create(path1, "hoge1", true);
View
@@ -32,18 +32,22 @@ TEST(zk, zk_trivial) {
pfi::lang::shared_ptr<jubatus::common::lock_service> zk_;
zk_ = pfi::lang::shared_ptr<jubatus::common::lock_service>
(common::create_lock_service("zk", "localhost:2181", 1024, "test.log"));
- zk_->create(ACTOR_BASE_PATH, "");
+ std::string engine_name, engine_root;
std::string name_, path;
std::string name1_, path1;
+ engine_name = "test";
+ engine_root = ACTOR_BASE_PATH + "/" + engine_name;
+
name_ = build_loc_str("localhost", 10000);
- build_actor_path(path, name_);
+ build_actor_path(path, engine_name, name_);
name1_ = build_loc_str("localhost", 10001);
- build_actor_path(path1, name1_);
+ build_actor_path(path1, engine_name, name1_);
zk_->create(JUBATUS_BASE_PATH, "");
zk_->create(ACTOR_BASE_PATH, "");
+ zk_->create(engine_root, "");
zk_->create(path, "hoge0", true);
ASSERT_EQ(true, zk_->exists(path));
@@ -57,11 +61,11 @@ TEST(zk, zk_trivial) {
ASSERT_EQ("hoge0", dat);
std::vector<std::string> pathlist;
- zk_->list(ACTOR_BASE_PATH, pathlist);
+ zk_->list(engine_root, pathlist);
ASSERT_EQ((unsigned int)2, pathlist.size());
std::string name_e;
- zk_->hd_list(ACTOR_BASE_PATH, name_e);
+ zk_->hd_list(engine_root, name_e);
ASSERT_EQ(name_e , name_);
ASSERT_EQ("zk", zk_->type());

0 comments on commit a7d0e26

Please sign in to comment.