test/test_plugin_classes.rb in fluentd-0.14.13 vs test/test_plugin_classes.rb in fluentd-0.14.14.pre.1

- old
+ new

@@ -19,10 +19,32 @@ @started = false super end end + class FluentTestGenInput < ::Fluent::Plugin::Input + ::Fluent::Plugin.register_input('test_in_gen', self) + + attr_reader :started + + config_param :num, :integer, default: 10000 + + def start + super + @started = true + + @num.times { |i| + router.emit("test.evet", Fluent::EventTime.now, {'message' => 'Hello!', 'key' => "value#{i}", 'num' => i}) + } + end + + def shutdown + @started = false + super + end + end + class FluentTestOutput < ::Fluent::Plugin::Output ::Fluent::Plugin.register_output('test_out', self) def initialize super @@ -110,9 +132,22 @@ end end class FluentTestBufferedOutput < ::Fluent::Plugin::Output ::Fluent::Plugin.register_output('test_out_buffered', self) + + attr_reader :started + + def start + super + @started = true + end + + def shutdown + @started = false + super + end + def write(chunk) # drop everything end end