Kouhei Sutou
null+****@clear*****
Wed Apr 16 17:28:04 JST 2014
Kouhei Sutou 2014-04-16 17:28:04 +0900 (Wed, 16 Apr 2014) New Revision: 694532f41d7b2ddd9f42110226c912f0eec25d99 https://github.com/droonga/droonga-engine/commit/694532f41d7b2ddd9f42110226c912f0eec25d99 Message: Remove test for fluent plugin The fluent plugin implementation still exists. It should be removed when we implement droonga-engine server process. Removed files: test/unit/test_output.rb Modified files: test/unit/run-test.rb Modified: test/unit/run-test.rb (+6 -0) =================================================================== --- test/unit/run-test.rb 2014-04-16 17:27:19 +0900 (9991fc2) +++ test/unit/run-test.rb 2014-04-16 17:28:04 +0900 (2be48ee) @@ -37,6 +37,12 @@ lib_dir = File.join(base_dir, "lib") test_dir = File.join(base_dir, "test", "unit") $LOAD_PATH.unshift(lib_dir) + +require "droonga/engine" +require "droonga/plugin_loader" + +Droonga::PluginLoader.load_all + $LOAD_PATH.unshift(test_dir) require "helper" Deleted: test/unit/test_output.rb (+0 -103) 100644 =================================================================== --- test/unit/test_output.rb 2014-04-16 17:27:19 +0900 (2dc99c6) +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright (C) 2013 Droonga Project -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License version 2.1 as published by the Free Software Foundation. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -require "fluent/plugin/out_droonga" - -module OutputStub - class Engine - attr_reader :processed_envelope - def initialize(response) - @response = response - @processed_envelope = nil - end - - def process(envelope) - @processed_envelope = envelope - @response - end - - def shutdown - end - end - - class Logger - attr_reader :tag, :options - attr_reader :posted_tag, :posted_message - def initialize(tag, options) - @tag = tag - @options = options - end - - def post(tag, message) - @posted_tag = tag - @posted_message = message - end - - def close - end - end - - class Output < Fluent::DroongaOutput - attr_reader :engine - def initialize(response) - @response = response - super() - end - - def start - @engine = Engine.new(@response) - end - - def shutdown - @engine.shutdown - end - - def create_logger(tag, options) - Logger.new(tag, options) - end - end -end - -class OutputTest < Test::Unit::TestCase - setup - def setup_fluent - Fluent::Test.setup - end - - def test_exec - response = {} - driver = create_driver("droonga.message", response) - request = {"hello" => "world"} - time = Time.parse("2012-10-26T08:45:42Z").to_i - driver.run do - driver.emit(request, time) - end - assert_equal(request, @output.engine.processed_envelope) - end - - private - def create_driver(tag, response) - @output = OutputStub::Output.new(response) - driver = Fluent::Test::OutputTestDriver.new(@output, tag) - driver.configure(configuration) - driver - end - - def configuration - <<-EOC -n_workers 0 -EOC - end -end -------------- next part -------------- HTML����������������������������...Download