[Groonga-commit] droonga/fluent-plugin-droonga at 739b295 [master] Check the metadata of broadcasted message

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Jan 31 14:38:53 JST 2014


YUKI Hiroshi	2014-01-31 14:38:53 +0900 (Fri, 31 Jan 2014)

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

  Message:
    Check the metadata of broadcasted message

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

  Modified: test/unit/plugin/distributor/test_search_planner.rb (+21 -3)
===================================================================
--- test/unit/plugin/distributor/test_search_planner.rb    2014-01-31 13:34:37 +0900 (552fb94)
+++ test/unit/plugin/distributor/test_search_planner.rb    2014-01-31 14:38:53 +0900 (ad1463a)
@@ -124,6 +124,21 @@ class DistributedSearchPlannerTest < Test::Unit::TestCase
     end
   end
 
+  def assert_valid_broadcast_message
+    message = broadcast_message
+    metadata = {
+      "command" => message["command"],
+      "dataset" => message["dataset"],
+      "replica" => message["replica"],
+    }
+    expected = {
+      "command" => @request["type"],
+      "dataset" => @request["dataset"],
+      "replica" => "random",
+    }
+    assert_equal(expected, metadata)
+  end
+
   class OutputTest < self
     class NothingTest < self
       def setup
@@ -147,7 +162,8 @@ class DistributedSearchPlannerTest < Test::Unit::TestCase
                      dependencies)
       end
 
-      def test_broadcast_body
+      def test_broadcast_message
+        assert_valid_broadcast_message
         assert_equal({
                        "queries" => {
                          "no_output" => {
@@ -206,7 +222,8 @@ class DistributedSearchPlannerTest < Test::Unit::TestCase
                        dependencies)
         end
 
-        def test_broadcast_body
+        def test_broadcast_message
+          assert_valid_broadcast_message
           assert_equal({
                          "queries" => {
                            "users" => {
@@ -279,7 +296,8 @@ class DistributedSearchPlannerTest < Test::Unit::TestCase
                      dependencies)
       end
 
-      def test_broadcast_body
+      def test_broadcast_message
+        assert_valid_broadcast_message
         changed_output_parameters = {
           "format" => "simple"
         }
-------------- next part --------------
HTML����������������������������...
下載 



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