[Groonga-commit] droonga/fluent-plugin-droonga at c61ee44 [master] Extract test of errors reducer and gatherer to another class

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Jan 31 14:58:29 JST 2014


YUKI Hiroshi	2014-01-31 14:58:29 +0900 (Fri, 31 Jan 2014)

  New Revision: c61ee44ba89cb8b7ad60c2a52c4be9def0578bc2
  https://github.com/droonga/fluent-plugin-droonga/commit/c61ee44ba89cb8b7ad60c2a52c4be9def0578bc2

  Message:
    Extract test of errors reducer and gatherer to another class

  Modified files:
    test/unit/plugin/distributor/test_search_planner.rb

  Modified: test/unit/plugin/distributor/test_search_planner.rb (+50 -21)
===================================================================
--- test/unit/plugin/distributor/test_search_planner.rb    2014-01-31 14:38:53 +0900 (ad1463a)
+++ test/unit/plugin/distributor/test_search_planner.rb    2014-01-31 14:58:29 +0900 (64f0ca0)
@@ -139,6 +139,51 @@ class DistributedSearchPlannerTest < Test::Unit::TestCase
     assert_equal(expected, metadata)
   end
 
+  # this should be moved to the test for DistributedCommandPlanner
+  class BasicTest < self
+    def setup
+      @request = {
+        "type" => "search",
+        "dataset" => "Droonga",
+        "body" => {
+          "queries" => {
+            "no_output" => {
+              "source" => "User",
+            },
+          },
+        },
+      }
+    end
+
+    def test_dependencies
+      reduce_inputs = ["errors"]
+      gather_inputs = ["errors_reduced"]
+      assert_equal(expected_dependencies(reduce_inputs, gather_inputs),
+                   dependencies)
+    end
+
+    def test_reduce_body
+      assert_equal({
+                     "errors" => {
+                       "errors_reduced" => {
+                         "type"  => "sum",
+                         "limit" => -1,
+                       },
+                     },
+                   },
+                   reduce_message["body"])
+    end
+
+    def test_gather_body
+      assert_equal({
+                     "errors_reduced" => {
+                       "output" => "errors",
+                     },
+                   },
+                   gather_message["body"])
+    end
+  end
+
   class OutputTest < self
     class NothingTest < self
       def setup
@@ -173,27 +218,6 @@ class DistributedSearchPlannerTest < Test::Unit::TestCase
                      },
                      broadcast_message["body"])
       end
-
-      def test_reduce_body
-        assert_equal({
-                       "errors" => {
-                         "errors_reduced" => {
-                           "type"  => "sum",
-                           "limit" => -1,
-                         },
-                       },
-                     },
-                     reduce_message["body"])
-      end
-
-      def test_gather_body
-        assert_equal({
-                       "errors_reduced" => {
-                         "output" => "errors",
-                       },
-                     },
-                     gather_message["body"])
-      end
     end
 
     class ElementsTest < self
@@ -326,6 +350,11 @@ class DistributedSearchPlannerTest < Test::Unit::TestCase
     end
   end
 
+
+
+
+
+
   class SingleQueryTest < self
     def test_no_output_limit
       request = {
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index