test/plugin/test_out_kafka.rb in fluent-plugin-kafka-0.2.1 vs test/plugin/test_out_kafka.rb in fluent-plugin-kafka-0.2.2
- old
+ new
@@ -1,21 +1,40 @@
require 'helper'
+require 'fluent/output'
class KafkaOutputTest < Test::Unit::TestCase
def setup
Fluent::Test.setup
end
- CONFIG = %[
+ BASE_CONFIG = %[
+ type kafka_buffered
+ ]
+
+ CONFIG = BASE_CONFIG + %[
default_topic kitagawakeiko
brokers localhost:9092
]
def create_driver(conf = CONFIG, tag='test')
Fluent::Test::BufferedOutputTestDriver.new(Fluent::KafkaOutput, tag).configure(conf)
end
def test_configure
+ assert_nothing_raised(Fluent::ConfigError) {
+ create_driver(BASE_CONFIG)
+ }
+
+ assert_nothing_raised(Fluent::ConfigError) {
+ create_driver(CONFIG)
+ }
+
+ assert_nothing_raised(Fluent::ConfigError) {
+ create_driver(CONFIG + %[
+ buffer_type memory
+ ])
+ }
+
d = create_driver
assert_equal 'kitagawakeiko', d.instance.default_topic
assert_equal 'localhost:9092', d.instance.brokers
end