[Groonga-commit] droonga/fluent-plugin-droonga at 83bc31d [master] Migrate a test for output-limit

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Jan 31 16:11:24 JST 2014


YUKI Hiroshi	2014-01-31 16:11:24 +0900 (Fri, 31 Jan 2014)

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

  Message:
    Migrate a test for output-limit

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

  Modified: test/unit/plugin/distributor/test_search_planner.rb (+61 -0)
===================================================================
--- test/unit/plugin/distributor/test_search_planner.rb    2014-01-31 16:11:04 +0900 (24a4d77)
+++ test/unit/plugin/distributor/test_search_planner.rb    2014-01-31 16:11:24 +0900 (d181639)
@@ -220,6 +220,67 @@ class DistributedSearchPlannerTest < Test::Unit::TestCase
       end
     end
 
+    class NoOutputLimitTest < self
+      def setup
+        @request = {
+          "type" => "search",
+          "dataset" => "Droonga",
+          "body" => {
+            "queries" => {
+              "users" => {
+                "source" => "User",
+                "output" => {
+                  "format" => "complex",
+                  "elements" => ["count", "records"],
+                },
+              },
+            },
+          },
+        }
+      end
+
+      def test_dependencies
+        reduce_inputs = ["errors", "users"]
+        gather_inputs = ["errors_reduced", "users_reduced"]
+        assert_equal(expected_dependencies(reduce_inputs, gather_inputs),
+                     dependencies)
+      end
+
+      def test_broadcast_message
+        assert_valid_broadcast_message
+        assert_equal({
+                       "queries" => {
+                         "users" => {
+                           "source" => "User",
+                           "output" => {
+                             "format" => "simple",
+                             "elements" => ["count", "records"],
+                           },
+                         },
+                       },
+                     },
+                     broadcast_message["body"])
+      end
+
+      def test_reduce_body
+        assert_equal({
+                       "users_reduced" => {
+                         "count" => {
+                           "type" => "sum",
+                         },
+                       },
+                     },
+                     reduce_message["body"]["users"])
+      end
+
+      def test_gather_body
+        assert_equal({
+                       "output" => "users",
+                     },
+                     gather_message["body"]["users_reduced"])
+      end
+    end
+
     class ElementsTest < self
       class CountTest < self
         def setup
-------------- next part --------------
HTML����������������������������...
Download 



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