Sha256: 7ba55ce2432fd63ab7614fbd885a21dad0265a6a3c5b7dda03e9a8f664e62011

Contents?: true

Size: 690 Bytes

Versions: 2

Compression:

Stored size: 690 Bytes

Contents

require 'helper'

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

  CONFIG = %[
    server localhost:8089
    verify false
    token changeme
  ]

  def create_driver(conf=CONFIG, tag='test')
    Fluent::Test::BufferedOutputTestDriver.new(Fluent::SplunkHTTPEventcollectorOutput, tag).configure(conf)
  end

  def test_configure
    # default
    d = create_driver
    assert_equal '{TAG}', d.instance.source
    assert_equal '_json', d.instance.sourcetype
  end

  def test_write
    d = create_driver

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

    d.run
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fluent-plugin-splunk-http-eventcollector-0.1.0 test/plugin/test_out_splunk-http-eventcollector.rb
fluent-plugin-splunk-http-eventcollector-0.0.4 test/plugin/test_out_splunk-http-eventcollector.rb