[Groonga-commit] droonga/fluent-plugin-droonga at dee37c3 [pubsub] Add pubsub handler that does nothing at this time

Back to archive index

Yoji Shidara null+****@clear*****
Wed Oct 9 11:17:24 JST 2013


Yoji Shidara	2013-10-09 11:17:24 +0900 (Wed, 09 Oct 2013)

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

  Message:
    Add pubsub handler that does nothing at this time

  Added files:
    lib/droonga/plugin/handler_pubsub.rb
    test/plugin/handler/test_handler_pubsub.rb

  Added: lib/droonga/plugin/handler_pubsub.rb (+39 -0) 100644
===================================================================
--- /dev/null
+++ lib/droonga/plugin/handler_pubsub.rb    2013-10-09 11:17:24 +0900 (3eaa223)
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+#
+# 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/handler"
+
+module Droonga
+  class Plugin::PubSubHandler < Droonga::Handler
+    Droonga::HandlerPlugin.register("pubsub", self)
+
+    command :subscribe
+    def subscribe(request)
+      # TODO
+    end
+
+    command :unsunscribe
+    def unsubscribe(request)
+      # TODO
+    end
+
+    command :publish
+    def publish(request)
+      # TODO
+    end
+  end
+end

  Added: test/plugin/handler/test_handler_pubsub.rb (+46 -0) 100644
===================================================================
--- /dev/null
+++ test/plugin/handler/test_handler_pubsub.rb    2013-10-09 11:17:24 +0900 (28e48ae)
@@ -0,0 +1,46 @@
+# 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/handler_pubsub"
+
+class PubSubHandlerTest < Test::Unit::TestCase
+  def setup
+    setup_handler
+  end
+
+  def teardown
+    teardown_handler
+  end
+
+  def setup_handler
+    @worker = StubWorker.new
+    @handler = Droonga::Plugin::PubSubHandler.new(@worker)
+  end
+
+  def teardown_handler
+    @handler = nil
+  end
+
+  public
+  class TestSubscribe < self
+    def test_subscribe
+      request = {} # TODO
+      assert_nothing_raised do
+        @handler.subscribe(request)
+        # TODO assert that subscription created
+      end
+    end
+  end
+end
-------------- next part --------------
HTML����������������������������...
下載 



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