Sha256: b4e7c7ae18e23adc30412646d1d4f59078b9e325abbb77bae0d5b8cacdb00a67

Contents?: true

Size: 729 Bytes

Versions: 8

Compression:

Stored size: 729 Bytes

Contents

require 'helper'

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

  CONFIG = %[
    protocol rest
    server localhost:8089
    verify false
    auth admin:changeme
  ]

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

  def test_configure
    # default
    d = create_driver
    assert_equal 'rest', d.instance.protocol
    assert_equal '{TAG}', d.instance.source
    assert_equal 'fluent', 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

8 entries across 8 versions & 2 rubygems

Version Path
fluent-plugin-splunkapi-ssln-0.0.2 test/plugin/test_out_splunkapi.rb
fluent-plugin-splunkapi-ssln-0.0.1 test/plugin/test_out_splunkapi.rb
fluent-plugin-splunkapi-0.2.0 test/plugin/test_out_splunkapi.rb
fluent-plugin-splunkapi-0.1.5 test/plugin/test_out_splunkapi.rb
fluent-plugin-splunkapi-0.1.3 test/plugin/test_out_splunkapi.rb
fluent-plugin-splunkapi-0.1.2 test/plugin/test_out_splunkapi.rb
fluent-plugin-splunkapi-0.1.1 test/plugin/test_out_splunkapi.rb
fluent-plugin-splunkapi-0.1.0 test/plugin/test_out_splunkapi.rb