Sha256: af257157e4fefbb38d3f896491f741a568a4134054e2ae581ae0d5e4f889108f

Contents?: true

Size: 1.52 KB

Versions: 21

Compression:

Stored size: 1.52 KB

Contents

#
# Fluentd
#
#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.
#

require 'test/unit'
require 'fluent/env' # for Fluent.windows?
require 'fluent/test/log'
require 'fluent/test/base'
require 'fluent/test/input_test'
require 'fluent/test/output_test'
require 'fluent/test/filter_test'
require 'fluent/test/parser_test'
require 'fluent/test/formatter_test'
require 'serverengine'


module Fluent
  module Test
    def self.dummy_logger
      dl_opts = {log_level: ServerEngine::DaemonLogger::INFO}
      logdev = Fluent::Test::DummyLogDevice.new
      logger = ServerEngine::DaemonLogger.new(logdev, dl_opts)
      Fluent::Log.new(logger)
    end

    def self.setup
      $log = dummy_logger

      Fluent.__send__(:remove_const, :Engine)
      engine = Fluent.const_set(:Engine, EngineClass.new).init(SystemConfig.new)

      engine.define_singleton_method(:now=) {|n|
        @now = n
      }
      engine.define_singleton_method(:now) {
        @now ||= super()
      }

      nil
    end
  end
end

$log ||= Fluent::Test.dummy_logger

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
fluentd-0.14.11-x64-mingw32 lib/fluent/test.rb
fluentd-0.14.11-x86-mingw32 lib/fluent/test.rb
fluentd-0.14.11 lib/fluent/test.rb
fluentd-0.14.10-x64-mingw32 lib/fluent/test.rb
fluentd-0.14.10-x86-mingw32 lib/fluent/test.rb
fluentd-0.14.10 lib/fluent/test.rb
fluentd-0.14.9 lib/fluent/test.rb
fluentd-0.14.8 lib/fluent/test.rb
fluentd-0.14.7-x64-mingw32 lib/fluent/test.rb
fluentd-0.14.7-x86-mingw32 lib/fluent/test.rb
fluentd-0.14.7 lib/fluent/test.rb
fluentd-0.14.6 lib/fluent/test.rb
fluentd-0.14.5-x64-mingw32 lib/fluent/test.rb
fluentd-0.14.5-x86-mingw32 lib/fluent/test.rb
fluentd-0.14.5 lib/fluent/test.rb
fluentd-0.14.4-x64-mingw32 lib/fluent/test.rb
fluentd-0.14.4-x86-mingw32 lib/fluent/test.rb
fluentd-0.14.4 lib/fluent/test.rb
fluentd-0.14.3 lib/fluent/test.rb
fluentd-0.14.2 lib/fluent/test.rb