Sha256: 5141d7fb6ef2ae2d963cf6f3fbe95dfbc049888ae42da509a7d5c7a851163ced

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

require 'helper'

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

  CONFIG = %[
    host            localhost
    port            3306
    interval        30
    tag             input.mysql
    query           SHOW VARIABLES LIKE 'Thread_%'
    record_hostname yes
  ]

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

  def test_configure
    assert_raise(Fluent::ConfigError) {
      d = create_driver('')
    }
    d = create_driver %[
      host            localhost
      port            3306
      interval        30
      tag             input.mysql
      query           SHOW VARIABLES LIKE 'Thread_%'
      record_hostname yes
    ]
    assert_equal 'localhost', d.instance.host
    assert_equal 3306, d.instance.port
    assert_equal 30, d.instance.interval
    assert_equal 'input.mysql', d.instance.tag
    assert_equal true, d.instance.record_hostname
    assert_equal false, d.instance.nest_result
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fluent-plugin-sqlquery-ssh-0.1.11 test/plugin/test_in_sqlquery_ssh.rb
fluent-plugin-sqlquery-ssh-0.1.10 test/plugin/test_in_sqlquery_ssh.rb