Skip to content

Commit

Permalink
Try to use old test driver
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmo0920 committed May 31, 2016
1 parent fd9c572 commit d87934e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/plugin/test_in_dummy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def create_driver(conf)
test "value of auto increment key is not suspended after stop-and-start" do
assert !File.exist?(File.join(TEST_PLUGIN_STORAGE_PATH, 'json', 'test-01.json'))

d1 = create_driver(conf1)
d1 = Fluent::Test::InputTestDriver.new(Fluent::Plugin::DummyInput).configure(conf1)
d1.expected_emits_length = 4
d1.run

Expand All @@ -119,12 +119,12 @@ def create_driver(conf)

assert !File.exist?(File.join(TEST_PLUGIN_STORAGE_PATH, 'json', 'test-01.json'))

d2 = create_driver(conf1)
d2.expected_emits_length = 4
d2.run
d2 = Fluent::Test::InputTestDriver.new(Fluent::Plugin::DummyInput).configure(conf1)

d2.run
d2.expected_emits_length = 4
first_id2 = d2.emits.first[2]['id']
assert_equal 0, first_id2
assert_equal d1.emits.length, first_id2

assert !File.exist?(File.join(TEST_PLUGIN_STORAGE_PATH, 'json', 'test-01.json'))
end
Expand Down Expand Up @@ -158,10 +158,10 @@ def create_driver(conf)
test "value of auto increment key is suspended after stop-and-start" do
assert !File.exist?(File.join(TEST_PLUGIN_STORAGE_PATH, 'json', 'test-02.json'))

d1 = create_driver(conf2)
d1 = Fluent::Test::InputTestDriver.new(Fluent::Plugin::DummyInput).configure(conf2)

d1.expected_emits_length = 4
d1.run
d1.expected_emits_length = 4

first_id1 = d1.emits.first[2]['id']
assert_equal 0, first_id1
Expand All @@ -171,9 +171,9 @@ def create_driver(conf)

assert File.exist?(File.join(TEST_PLUGIN_STORAGE_PATH, 'json', 'test-02.json'))

d2 = create_driver(conf2)
d2.expected_emits_length = 4
d2 = Fluent::Test::InputTestDriver.new(Fluent::Plugin::DummyInput).configure(conf2)
d2.run
d2.expected_emits_length = 4

first_id2 = d2.emits.first[2]['id']
assert_equal last_id1 + 1, first_id2
Expand Down

0 comments on commit d87934e

Please sign in to comment.