Skip to content

Commit

Permalink
fix the rest of the references
Browse files Browse the repository at this point in the history
  • Loading branch information
slyphon committed May 4, 2012
1 parent 6cdbbae commit 834baec
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/zookeeper.rb
Expand Up @@ -81,5 +81,5 @@ class << self
end

# just for first test, get rid of this soon
require_relative 'zookeeper/compatibility'
#require_relative 'zookeeper/compatibility'

5 changes: 3 additions & 2 deletions scripts/upgrade-1.0-sed-alike.rb
Expand Up @@ -29,9 +29,10 @@
while line = input.gets
tmp.puts line.gsub(/\bZookeeperStat::Stat\b/, 'Zookeeper::Stat').
gsub(/\bZookeeper::(\w+)Callback\b/, 'Zookeeper::Callbacks::\1Callback').
gsub(/\bZookeeperACLs::ACL\b/, 'Zookeeper::ACLs::ACL').
gsub(/\bZookeeperACLs::(ZOO_\w+)\b/, 'Zookeeper::Constants::\1').
gsub(/\bZookeeperConstants\b/, 'Zookeeper::Constants')
gsub(/\bZookeeper(Constants|Exceptions|Common|ACLs|Callbacks)\b/, 'Zookeeper::\1')


end
end

Expand Down
10 changes: 5 additions & 5 deletions spec/c_zookeeper_spec.rb
Expand Up @@ -16,12 +16,12 @@ def pop_all_events
end

def wait_until_connected(timeout=2)
wait_until(timeout) { @czk.state == ZookeeperConstants::ZOO_CONNECTED_STATE }
wait_until(timeout) { @czk.state == Zookeeper::Constants::ZOO_CONNECTED_STATE }
end

describe do
before do
@event_queue = ZookeeperCommon::QueueWithPipe.new
@event_queue = Zookeeper::Common::QueueWithPipe.new
@czk = Zookeeper::CZookeeper.new('localhost:2181', @event_queue)
end

Expand All @@ -42,9 +42,9 @@ def wait_until_connected(timeout=2)
it %[should have a connection event after being connected] do
event = wait_until(2) { @event_queue.pop }
event.should be
event[:req_id].should == ZookeeperCommon::ZKRB_GLOBAL_CB_REQ
event[:type].should == ZookeeperConstants::ZOO_SESSION_EVENT
event[:state].should == ZookeeperConstants::ZOO_CONNECTED_STATE
event[:req_id].should == Zookeeper::Common::ZKRB_GLOBAL_CB_REQ
event[:type].should == Zookeeper::Constants::ZOO_SESSION_EVENT
event[:state].should == Zookeeper::Constants::ZOO_CONNECTED_STATE
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/chrooted_connection_spec.rb
Expand Up @@ -52,7 +52,7 @@ def zk
it %[should return ZNONODE] do
rv = zk.create(:path => '/', :data => '')
rv[:rc].should_not be_zero
rv[:rc].should == ZookeeperExceptions::ZNONODE
rv[:rc].should == Zookeeper::Exceptions::ZNONODE
end
end
end
Expand Down
12 changes: 6 additions & 6 deletions spec/shared/connection_examples.rb
Expand Up @@ -353,7 +353,7 @@
it_should_behave_like "all success return values"

before do
@cb = ZookeeperCallbacks::StringsCallback.new
@cb = Zookeeper::Callbacks::StringsCallback.new
@rv = zk.get_children(:path => path, :callback => @cb, :callback_context => path)

wait_until { @cb.completed? }
Expand Down Expand Up @@ -384,7 +384,7 @@
@addtl_child = 'child3'

@watcher = Zookeeper::Callbacks::WatcherCallback.new
@cb = ZookeeperCallbacks::StringsCallback.new
@cb = Zookeeper::Callbacks::StringsCallback.new

@rv = zk.get_children(:path => path, :watcher => @watcher, :watcher_context => path, :callback => @cb, :callback_context => path)
wait_until { @cb.completed? }
Expand Down Expand Up @@ -472,7 +472,7 @@
it_should_behave_like "all success return values"

before do
@cb = ZookeeperCallbacks::StatCallback.new
@cb = Zookeeper::Callbacks::StatCallback.new
@rv = zk.stat(:path => path, :callback => @cb, :callback_context => path)

wait_until { @cb.completed? }
Expand All @@ -496,7 +496,7 @@

@watcher = Zookeeper::Callbacks::WatcherCallback.new

@cb = ZookeeperCallbacks::StatCallback.new
@cb = Zookeeper::Callbacks::StatCallback.new
@rv = zk.stat(:path => path, :callback => @cb, :callback_context => path, :watcher => @watcher, :watcher_context => path)

wait_until { @cb.completed? }
Expand Down Expand Up @@ -642,7 +642,7 @@

describe :async do
before do
@cb = ZookeeperCallbacks::StringCallback.new
@cb = Zookeeper::Callbacks::StringCallback.new
end

describe :default_flags do
Expand Down Expand Up @@ -821,7 +821,7 @@

describe :async do
before do
@cb = ZookeeperCallbacks::VoidCallback.new
@cb = Zookeeper::Callbacks::VoidCallback.new
end

describe 'without version' do
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Expand Up @@ -69,7 +69,7 @@ def rm_rf(z, path)
h[:children].each do |child|
rm_rf(z, File.join(path, child))
end
elsif h[:rc] == ZookeeperExceptions::ZNONODE
elsif h[:rc] == Zookeeper::Exceptions::ZNONODE
# no-op
else
raise "Oh noes! unexpected return value! #{h.inspect}"
Expand All @@ -78,7 +78,7 @@ def rm_rf(z, path)

rv = z.delete(:path => path)

unless (rv[:rc].zero? or rv[:rc] == ZookeeperExceptions::ZNONODE)
unless (rv[:rc].zero? or rv[:rc] == Zookeeper::Exceptions::ZNONODE)
raise "oh noes! failed to delete #{path}"
end

Expand Down

0 comments on commit 834baec

Please sign in to comment.