Yoji Shidara
null+****@clear*****
Wed Jan 15 18:08:46 JST 2014
Yoji Shidara 2014-01-15 18:08:46 +0900 (Wed, 15 Jan 2014) New Revision: c8ac78c499865ea8ac9919ac6e9dcfbae943904d https://github.com/droonga/fluent-plugin-droonga/commit/c8ac78c499865ea8ac9919ac6e9dcfbae943904d Message: Split tests into two files by input and output Added files: test/unit/plugin/output_adapter/groonga/test_select.rb Renamed files: test/unit/plugin/input_adapter/groonga/test_select.rb (from test/unit/plugin/adapter/groonga/test_select.rb) Renamed: test/unit/plugin/input_adapter/groonga/test_select.rb (+1 -40) 85% =================================================================== --- test/unit/plugin/adapter/groonga/test_select.rb 2014-01-15 18:04:38 +0900 (3874aac) +++ test/unit/plugin/input_adapter/groonga/test_select.rb 2014-01-15 18:08:46 +0900 (10308ca) @@ -1,3 +1,4 @@ + # Copyright (C) 2013 Droonga Project # # This library is free software; you can redistribute it and/or @@ -14,7 +15,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require "droonga/plugin/input_adapter/groonga/select" -require "droonga/plugin/output_adapter/groonga/select" class InputAdapterGroongaSelectTest < Test::Unit::TestCase def setup @@ -246,42 +246,3 @@ class InputAdapterGroongaSelectTest < Test::Unit::TestCase end end end - -class OutputAdapterGroongaSelectTest < Test::Unit::TestCase - def setup - @select = Droonga::GroongaOutputAdapter::Select.new - end - - class ResponseTest < self - def test_empty - start_time = "2001-08-02T10:45:23.5+09:00" - elapsed_time = 0 - count = 0 - - search_response = { - "EmptyTable" => { - "startTime" => start_time, - "elapsedTime" => elapsed_time, - "count" => count, - "attributes" => [ - {"name" => "_id", "type" => "UInt32", "vector" => false}, - ], - "records" => [], - }, - } - - status_code = 0 - start_time_in_unix_time = Time.parse(start_time).to_f - headers = [["_id","UInt32"]] - expected_select_response = [[status_code, start_time_in_unix_time, elapsed_time], - [[[count], headers]]] - - assert_equal(expected_select_response, convert(search_response)) - end - - private - def convert(search_response) - @select.convert(search_response) - end - end -end Added: test/unit/plugin/output_adapter/groonga/test_select.rb (+55 -0) 100644 =================================================================== --- /dev/null +++ test/unit/plugin/output_adapter/groonga/test_select.rb 2014-01-15 18:08:46 +0900 (36efbcd) @@ -0,0 +1,55 @@ +# 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 "droonga/plugin/output_adapter/groonga/select" + +class OutputAdapterGroongaSelectTest < Test::Unit::TestCase + def setup + @select = Droonga::GroongaOutputAdapter::Select.new + end + + class ResponseTest < self + def test_empty + start_time = "2001-08-02T10:45:23.5+09:00" + elapsed_time = 0 + count = 0 + + search_response = { + "EmptyTable" => { + "startTime" => start_time, + "elapsedTime" => elapsed_time, + "count" => count, + "attributes" => [ + {"name" => "_id", "type" => "UInt32", "vector" => false}, + ], + "records" => [], + }, + } + + status_code = 0 + start_time_in_unix_time = Time.parse(start_time).to_f + headers = [["_id","UInt32"]] + expected_select_response = [[status_code, start_time_in_unix_time, elapsed_time], + [[[count], headers]]] + + assert_equal(expected_select_response, convert(search_response)) + end + + private + def convert(search_response) + @select.convert(search_response) + end + end +end -------------- next part -------------- HTML����������������������������...Descargar