Sha256: 3806ab670f13ab7bb4c236da52cd5cbfb8c3b214fce952c0fc1061b92a92783f

Contents?: true

Size: 1.05 KB

Versions: 73

Compression:

Stored size: 1.05 KB

Contents

require 'helper'
require 'fluent/output'

class KafkaOutputTest < Test::Unit::TestCase
  def setup
    Fluent::Test.setup
  end

  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

  def test_format
    d = create_driver
  end

  def test_write
    d = create_driver
    time = Time.parse("2011-01-02 13:14:15 UTC").to_i
    d.emit({"a"=>1}, time)
    d.emit({"a"=>2}, time)
  end
end

Version data entries

73 entries across 73 versions & 3 rubygems

Version Path
fluent-plugin-kafka-0.5.5 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-0.5.4 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.35 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.34 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.33 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.32 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.31 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.30 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.29 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.28 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.27 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.26 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.25 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.24 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.23 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.21 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.20 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.19 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.18 test/plugin/test_out_kafka.rb
fluent-plugin-kafka-enchanced-0.5.17 test/plugin/test_out_kafka.rb