Sha256: 03e93d9aaea33fd72622c43fab0e3430d84029081a95193a8dc78814af603c4b

Contents?: true

Size: 900 Bytes

Versions: 15

Compression:

Stored size: 900 Bytes

Contents

require 'fluent/test'

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

  CONFIG = %[
    send_timeout 51
    <server>
      name test
      host 127.0.0.1
      port 13999
    </server>
  ]

  def create_driver(conf=CONFIG)
    Fluent::Test::OutputTestDriver.new(Fluent::ForwardOutput) do
      def write(chunk)
        chunk.read
      end
    end.configure(conf)
  end

  def test_configure
    d = create_driver
    nodes = d.instance.nodes
    assert_equal 51, d.instance.send_timeout
    assert_equal :udp, d.instance.heartbeat_type
    assert_equal 1, nodes.length
    node = nodes.first
    assert_equal "test", node.name
    assert_equal '127.0.0.1', node.host
    assert_equal 13999, node.port
  end

  def test_configure_tcp_heartbeat
    d = create_driver(CONFIG + "\nheartbeat_type tcp")
    assert_equal :tcp, d.instance.heartbeat_type
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
fluentd-0.10.45 test/plugin/out_forward.rb
fluentd-0.10.44 test/plugin/out_forward.rb
fluentd-0.10.43 test/plugin/out_forward.rb
fluentd-0.10.42 test/plugin/out_forward.rb
fluentd-0.10.41 test/plugin/out_forward.rb
fluentd-0.10.40 test/plugin/out_forward.rb
fluentd-0.10.39 test/plugin/out_forward.rb
fluentd-0.10.38 test/plugin/out_forward.rb
fluentd-0.10.37 test/plugin/out_forward.rb
fluentd-0.10.36 test/plugin/out_forward.rb
fluentd-0.10.35 test/plugin/out_forward.rb
fluentd-0.10.34 test/plugin/out_forward.rb
fluentd-0.10.33 test/plugin/out_forward.rb
fluentd-0.10.32 test/plugin/out_forward.rb
fluentd-0.10.31 test/plugin/out_forward.rb