fixing the tests

Fixes #6109
This commit is contained in:
Pier-Hugues Pellerin 2016-10-21 09:41:13 -04:00
parent 6626fa897c
commit 58ccca7028
4 changed files with 6 additions and 5 deletions

View file

@ -121,10 +121,8 @@ class LogStash::Plugin
# This is keep for backward compatibility, the logic was moved into the registry class
# but some plugins use this method to return a specific instance on lookup
#
#
#
# Should I remove this now and make sure the pipeline invoke the Registry or I should wait for 6.0
# Its not really part of the public api but its used by the tests.
# Its not really part of the public api but its used by the tests a lot to mock the plugins.
def self.lookup(type, name)
LogStash::PluginRegistry.lookup_pipeline_plugin(type, name)
end

View file

@ -137,7 +137,7 @@ module LogStash module Plugins
if plugin.nil?
begin
path = "logstash/#{type}s/#{plugin_name}"
require path
require path rescue LoadError # Plugin might be already defined in the current scope
klass = namespace_lookup(type, plugin_name)
plugin = lazy_add(type, plugin_name, klass)
rescue => e
@ -170,7 +170,7 @@ module LogStash module Plugins
end
def lazy_add(type, name, klass)
logger.error("Lazy Adding plugin to the registry", :name => name, :type => type, :class => klass)
logger.error("On demand adding plugin to the registry", :name => name, :type => type, :class => klass)
add_plugin(type, name, klass)
end

View file

@ -5,6 +5,7 @@ require "stud/task"
require "logstash/devutils/rspec/spec_helper"
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
require "lib/api/support/resource_dsl_methods"
require_relative "../support/mocks_classes"
require 'rspec/expectations'
require "logstash/settings"
require 'rack/test'

View file

@ -2,6 +2,7 @@
require "logstash/outputs/base"
require "thread"
module LogStash module Outputs
class DummyOutput < LogStash::Outputs::Base
config_name "dummyoutput"
milestone 2
@ -47,3 +48,4 @@ class DummyOutputWithEventsArray < LogStash::Outputs::Base
def close
end
end
end end