fix integration tests

This commit is contained in:
jway 2015-06-01 09:42:37 -07:00
parent 8c614437bf
commit 2aecf369e6
3 changed files with 9 additions and 7 deletions

View File

@ -50,9 +50,9 @@ require 'hermann/producer'
broker_ids_array = Hermann::Discovery::Zookeeper.new('localhost:2181').get_brokers
p = Hermann::Producer.new('topic', broker_ids_array) # arguments topic, list of brokers
f = p.push('hello world from mri')
f.state
p.tick_reactor
f = p.push('hello world from mri')
f.state
p.tick_reactor
f.state
```
@ -95,9 +95,11 @@ the_consumer.consume(new_topic) do |msg| # can change topic with optional argu
end
```
#### Testing
To run the integration tests:
* startup your own instance of zookeeper/kafka
* `rspec spec/integration/producer_spec.rb`
#### How to convert from using jruby-kafka

View File

@ -15,7 +15,7 @@ describe 'producer', :platform => :java do
let(:timeout) { 10 }
let(:message) { 'msg' }
let(:consumer) do
Hermann::Consumer.new(topic, "rspec-group", zookeepers)
Hermann::Consumer.new(topic, { :group_id => "rspec-group", :zookeepers => zookeepers })
end
let(:consumer_promise) do
Concurrent::Promise.execute do

View File

@ -13,7 +13,7 @@ RSpec.configure do |c|
c.formatter = :documentation
shared_context 'integration test context', :type => :integration do
let(:topic) { "hermann_testing_" + rand(100_000_000).to_s }
let(:topic) { "hermann_testing" }
let(:brokers) { $integrationconf['kafka']['brokers'].join(',') }
let(:zookeepers) { $integrationconf['zookeepers'] }
end