Sha256: 603d8b149db4ed4592c4734e639007396bcaed5048d702e08435dcd48f1b7a25

Contents?: true

Size: 1 KB

Versions: 4

Compression:

Stored size: 1 KB

Contents

require 'helper'

class MysqlQueryInputTest < 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
    ]
    d.instance.inspect
    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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fluent-plugin-mysql-query-0.2.3 test/plugin/test_in_mysql_query.rb
fluent-plugin-mysql-query-0.2.2 test/plugin/test_in_mysql_query.rb
fluent-plugin-mysql-query-0.2.1 test/plugin/test_in_mysql_query.rb
fluent-plugin-mysql-query-0.1.1 test/plugin/test_in_mysql_query.rb