YUKI Hiroshi
null+****@clear*****
Thu Apr 30 14:15:28 JST 2015
YUKI Hiroshi 2015-04-30 14:15:28 +0900 (Thu, 30 Apr 2015) New Revision: f7ab57fa97103ad8bd74a388a14155910faefcce https://github.com/droonga/droonga-engine/commit/f7ab57fa97103ad8bd74a388a14155910faefcce Message: Add more tests for Cluster Modified files: test/unit/test_cluster.rb Modified: test/unit/test_cluster.rb (+33 -0) =================================================================== --- test/unit/test_cluster.rb 2015-04-30 14:03:06 +0900 (3767131) +++ test/unit/test_cluster.rb 2015-04-30 14:15:28 +0900 (f3b6004) @@ -104,4 +104,37 @@ class ClusterTest < Test::Unit::TestCase }, cluster.engine_nodes_status) end + + def test_readable_nodes + cluster = create_cluster(:state => { + "node29:2929/droonga" => { + "live" => true, + "role" => Droonga::NodeRole::SERVICE_PROVIDER, + }, + "node30:2929/droonga" => { + "live" => false, + "role" => Droonga::NodeRole::SERVICE_PROVIDER, + }, + }, + :all_nodes => [ + "node29:2929/droonga", + "node30:2929/droonga", + ]) + assert_equal([ + "node29:2929/droonga", + ], + cluster.readable_nodes) + end + + def test_writable_nodes + cluster = create_cluster(:all_nodes => [ + "node29:2929/droonga", + "node30:2929/droonga", + ]) + assert_equal([ + "node29:2929/droonga", + "node30:2929/droonga", + ], + cluster.writable_nodes) + end end -------------- next part -------------- HTML����������������������������... ダウンロード