YUKI Hiroshi
null+****@clear*****
Fri May 9 11:50:56 JST 2014
YUKI Hiroshi 2014-05-09 11:50:56 +0900 (Fri, 09 May 2014) New Revision: 6064524eefd6f7718190820fc28c03eb3b035357 https://github.com/droonga/droonga-engine/commit/6064524eefd6f7718190820fc28c03eb3b035357 Message: Add test for Dataset#all_nodes Modified files: test/unit/catalog/test_dataset.rb Modified: test/unit/catalog/test_dataset.rb (+32 -0) =================================================================== --- test/unit/catalog/test_dataset.rb 2014-05-09 11:41:41 +0900 (a867c20) +++ test/unit/catalog/test_dataset.rb 2014-05-09 11:50:56 +0900 (74f5684) @@ -101,4 +101,36 @@ class CatalogDatasetTest < Test::Unit::TestCase dataset.replicas) end end + + class NodesTest < self + def test_all_nodes + data = { + "replicas" => [ + { + "dimension" =>"_key", + "slicer" =>"hash", + "slices" =>[ + { "volume" =>{ "address" =>"127.0.0.1:23003/droonga.000" } }, + { "volume" =>{ "address" =>"127.0.0.1:23004/droonga.001" } }, + { "volume" =>{ "address" =>"127.0.0.1:23003/droonga.002" } }, + { "volume" =>{ "address" =>"127.0.0.1:23005/droonga.003" } }, + ], + }, + { + "dimension" =>"_key", + "slicer" =>"hash", + "slices" =>[ + { "volume" =>{ "address" =>"127.0.0.1:23004/droonga.000" } }, + { "volume" =>{ "address" =>"127.0.0.1:23005/droonga.001" } }, + { "volume" =>{ "address" =>"127.0.0.1:23003/droonga.002" } }, + { "volume" =>{ "address" =>"127.0.0.1:23004/droonga.003" } }, + ], + }, + ], + } + dataset = create_dataset(data) + assert_equal(["127.0.0.1:23003", "127.0.0.1:23004", "127.0.0.1:23005"], + dataset.all_nodes) + end + end end -------------- next part -------------- HTML����������������������������...Download