roma 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +42 -2
- data/Gemfile +1 -15
- data/LICENSE +1 -1
- data/README.md +78 -0
- data/Rakefile +1 -62
- data/bin/chg_redundancy +10 -0
- data/bin/cpdb +7 -0
- data/bin/key_access +7 -0
- data/bin/key_list +7 -0
- data/bin/log_merger +7 -0
- data/{ruby/server/bin → bin}/mkconfig +3 -1
- data/bin/mkrecent +7 -0
- data/bin/mkroute +7 -0
- data/{ruby/server/bin → bin}/multi_commander +4 -3
- data/bin/recoverlost +11 -0
- data/bin/recoverlost_alist +10 -0
- data/bin/recoverlost_alist_all +10 -0
- data/bin/recoverlost_alist_keys +10 -0
- data/bin/roma_watcher +10 -0
- data/{ruby/server/bin → bin}/romad +3 -2
- data/bin/safecopy_integration_test +10 -0
- data/bin/safecopy_test +10 -0
- data/bin/sample_watcher +10 -0
- data/bin/sample_watcher2 +10 -0
- data/bin/sample_watcher3 +10 -0
- data/bin/simple_bench +11 -0
- data/bin/ssroute +10 -0
- data/bin/tc_data_restore.rb +123 -0
- data/bin/test-scenario +11 -0
- data/bin/tribunus +7 -0
- data/{ruby/server/lib → lib}/roma/async_process.rb +105 -26
- data/{ruby/server/lib → lib}/roma/command/bg_command_receiver.rb +0 -0
- data/{ruby/server/lib → lib}/roma/command/command_definition.rb +12 -12
- data/{ruby/server/lib → lib}/roma/command/mh_command_receiver.rb +4 -4
- data/{ruby/server/lib → lib}/roma/command/receiver.rb +0 -0
- data/{ruby/server/lib → lib}/roma/command/rt_command_receiver.rb +7 -0
- data/{ruby/server/lib → lib}/roma/command/sys_command_receiver.rb +68 -3
- data/{ruby/server/lib → lib}/roma/command/util_command_receiver.rb +0 -0
- data/{ruby/server/lib → lib}/roma/command/vn_command_receiver.rb +0 -0
- data/{ruby/server/lib → lib}/roma/command_plugin.rb +0 -0
- data/{ruby/server/lib → lib}/roma/config.rb +4 -1
- data/{ruby/server/lib → lib}/roma/dns_cache.rb +0 -0
- data/{ruby/server/lib → lib}/roma/event/con_pool.rb +0 -0
- data/{ruby/server/lib → lib}/roma/event/handler.rb +0 -0
- data/{ruby/server/lib → lib}/roma/logging/rlogger.rb +61 -2
- data/{ruby/server/lib → lib}/roma/messaging/con_pool.rb +14 -0
- data/{ruby/server/lib → lib}/roma/plugin/plugin_alist.rb +0 -0
- data/{ruby/server/lib → lib}/roma/plugin/plugin_cmd_aliases.rb +0 -0
- data/{ruby/server/lib → lib}/roma/plugin/plugin_debug.rb +0 -0
- data/{ruby/server/lib → lib}/roma/plugin/plugin_gui.rb +12 -13
- data/{ruby/server/lib → lib}/roma/plugin/plugin_map.rb +0 -0
- data/{ruby/server/lib → lib}/roma/plugin/plugin_mapcount.rb +0 -0
- data/{ruby/server/lib → lib}/roma/plugin/plugin_storage.rb +11 -11
- data/{ruby/server/lib → lib}/roma/plugin/plugin_test.rb +0 -0
- data/{ruby/server/lib → lib}/roma/romad.rb +25 -1
- data/{ruby/server/lib → lib}/roma/routing/cb_rttable.rb +0 -0
- data/{ruby/server/lib → lib}/roma/routing/merkle_tree.rb +0 -0
- data/{ruby/server/lib → lib}/roma/routing/random_balancer.rb +0 -0
- data/{ruby/server/lib → lib}/roma/routing/random_partitioner.rb +0 -0
- data/{ruby/server/lib → lib}/roma/routing/routing_data.rb +0 -0
- data/{ruby/server/lib → lib}/roma/routing/rttable.rb +0 -0
- data/{ruby/server/lib → lib}/roma/stats.rb +11 -0
- data/{ruby/server/lib → lib}/roma/storage/basic_storage.rb +3 -0
- data/{ruby/server/lib → lib}/roma/storage/dbm_storage.rb +0 -0
- data/{ruby/server/lib → lib}/roma/storage/dummy_storage.rb +0 -0
- data/lib/roma/storage/groonga_storage.rb +101 -0
- data/{ruby/server/lib → lib}/roma/storage/rh_storage.rb +0 -0
- data/{ruby/server/lib → lib}/roma/storage/sqlite3_storage.rb +0 -0
- data/{ruby/server/lib → lib}/roma/storage/tc_storage.rb +0 -0
- data/{ruby/server/lib → lib}/roma/tools/chg_redundancy.rb +0 -0
- data/{ruby/server/lib → lib}/roma/tools/cpdb.rb +13 -2
- data/{ruby/server/lib → lib}/roma/tools/key_access.rb +1 -1
- data/{ruby/server/lib → lib}/roma/tools/key_list.rb +1 -1
- data/{ruby/server/lib → lib}/roma/tools/log_merger.rb +0 -0
- data/{ruby/server/lib → lib}/roma/tools/mkconfig.rb +1 -1
- data/{ruby/server/lib → lib}/roma/tools/mkrecent.rb +1 -1
- data/{ruby/server/lib → lib}/roma/tools/mkroute.rb +5 -1
- data/{ruby/server/lib → lib}/roma/tools/multi_commander.rb +0 -0
- data/{ruby/server/lib → lib}/roma/tools/recoverlost.rb +0 -0
- data/{ruby/server/lib → lib}/roma/tools/recoverlost_alist.rb +0 -0
- data/{ruby/server/lib → lib}/roma/tools/recoverlost_alist_all.rb +0 -0
- data/{ruby/server/lib → lib}/roma/tools/recoverlost_alist_keys.rb +0 -0
- data/{ruby/server/lib → lib}/roma/tools/recoverlost_lib.rb +1 -1
- data/{ruby/server/lib → lib}/roma/tools/roma_watcher.rb +0 -0
- data/{ruby/server/lib → lib}/roma/tools/roma_watcher_config.yml.example +0 -0
- data/{ruby/server/lib → lib}/roma/tools/safecopy_integration_test.rb +0 -0
- data/{ruby/server/lib → lib}/roma/tools/safecopy_test.rb +0 -0
- data/{ruby/server/lib → lib}/roma/tools/sample_watcher.rb +0 -0
- data/{ruby/server/lib → lib}/roma/tools/sample_watcher2.rb +0 -0
- data/{ruby/server/lib → lib}/roma/tools/sample_watcher3.rb +0 -0
- data/{ruby/server/lib → lib}/roma/tools/simple_bench.rb +0 -0
- data/{ruby/server/lib → lib}/roma/tools/simple_bench2.rb +0 -0
- data/{ruby/server/lib → lib}/roma/tools/ssroute.rb +1 -1
- data/{ruby/server/lib → lib}/roma/tools/test-scenario.rb +3 -3
- data/{ruby/server/lib → lib}/roma/tools/tribunus.rb +1 -1
- data/lib/roma/version.rb +4 -0
- data/{ruby/server/lib → lib}/roma/write_behind.rb +0 -0
- data/{ruby/server/test → test}/config4mhash.rb +0 -0
- data/{ruby/server/test → test}/config4storage_error.rb +0 -0
- data/{ruby/server/test → test}/config4test.rb +0 -0
- data/{ruby/server/test → test}/rcirb.rb +0 -0
- data/{ruby/server/test → test}/roma-test-utils.rb +10 -14
- data/test/run-test.rb +20 -0
- data/{ruby/server/test → test}/storage_error_storage.rb +0 -0
- data/{ruby/server/test → test}/t_command_definition.rb +10 -10
- data/{ruby/server/test → test}/t_cpdata.rb +0 -0
- data/{ruby/server/test → test}/t_eventmachine.rb +0 -0
- data/{ruby/server/test → test}/t_listplugin.rb +9 -3
- data/{ruby/server/test → test}/t_mapcountplugin.rb +0 -0
- data/{ruby/server/test → test}/t_mapplugin.rb +9 -3
- data/{ruby/server/test → test}/t_mhash.rb +7 -7
- data/{ruby/server/test → test}/t_protocol.rb +0 -0
- data/{ruby/server/test → test}/t_rclient.rb +8 -2
- data/{ruby/server/test → test}/t_routing_data.rb +0 -0
- data/{ruby/server/test → test}/t_storage.rb +58 -26
- data/{ruby/server/test → test}/t_storage_error.rb +5 -3
- data/{ruby/server/test → test}/t_writebehind.rb +17 -17
- metadata +225 -122
- data/README +0 -17
- data/ruby/server/bin/chg_redundancy +0 -10
- data/ruby/server/bin/cpdb +0 -6
- data/ruby/server/bin/key_access +0 -7
- data/ruby/server/bin/key_list +0 -7
- data/ruby/server/bin/log_merger +0 -6
- data/ruby/server/bin/mkrecent +0 -6
- data/ruby/server/bin/mkroute +0 -6
- data/ruby/server/bin/recoverlost +0 -10
- data/ruby/server/bin/recoverlost_alist +0 -10
- data/ruby/server/bin/recoverlost_alist_all +0 -10
- data/ruby/server/bin/recoverlost_alist_keys +0 -10
- data/ruby/server/bin/roma_watcher +0 -7
- data/ruby/server/bin/safecopy_integration_test +0 -10
- data/ruby/server/bin/safecopy_test +0 -10
- data/ruby/server/bin/sample_watcher +0 -7
- data/ruby/server/bin/sample_watcher2 +0 -7
- data/ruby/server/bin/sample_watcher3 +0 -7
- data/ruby/server/bin/simple_bench +0 -11
- data/ruby/server/bin/ssroute +0 -6
- data/ruby/server/bin/test-scenario +0 -11
- data/ruby/server/bin/tribunus +0 -6
- data/ruby/server/lib/roma/version.rb +0 -4
- data/ruby/server/test/run-test.rb +0 -17
@@ -228,9 +228,9 @@ class DefineCommandTest < Test::Unit::TestCase
|
|
228
228
|
|
229
229
|
# case of argument error
|
230
230
|
res = @obj.ev_get ['get']
|
231
|
-
assert_equal "CLIENT_ERROR
|
231
|
+
assert_equal "CLIENT_ERROR does not find key\r\n", res
|
232
232
|
res = @obj.ev_get []
|
233
|
-
assert_equal "CLIENT_ERROR
|
233
|
+
assert_equal "CLIENT_ERROR does not find key\r\n", res
|
234
234
|
|
235
235
|
# case of exception occur
|
236
236
|
assert_raise RuntimeError do
|
@@ -264,9 +264,9 @@ class DefineCommandTest < Test::Unit::TestCase
|
|
264
264
|
|
265
265
|
# case of argument error
|
266
266
|
res = @obj.ev_set ['set']
|
267
|
-
assert_equal "CLIENT_ERROR
|
267
|
+
assert_equal "CLIENT_ERROR does not find key\r\n", res
|
268
268
|
res = @obj.ev_set []
|
269
|
-
assert_equal "CLIENT_ERROR
|
269
|
+
assert_equal "CLIENT_ERROR does not find key\r\n", res
|
270
270
|
|
271
271
|
# case of exception occur
|
272
272
|
assert_raise RuntimeError do
|
@@ -296,31 +296,31 @@ class DefineCommandNoHashTest < Test::Unit::TestCase
|
|
296
296
|
|
297
297
|
def test_rcwk
|
298
298
|
ret = @obj.ev_rget ['get',"arg1\eno_hash_name"]
|
299
|
-
assert_equal "SERVER_ERROR no_hash_name
|
299
|
+
assert_equal "SERVER_ERROR no_hash_name does not exists.\r\n", ret
|
300
300
|
end
|
301
301
|
|
302
302
|
def test_wcwk
|
303
303
|
ret = @obj.ev_wget ['get',"arg1\eno_hash_name"]
|
304
|
-
assert_equal "SERVER_ERROR no_hash_name
|
304
|
+
assert_equal "SERVER_ERROR no_hash_name does not exists.\r\n", ret
|
305
305
|
end
|
306
306
|
|
307
307
|
def test_cwk
|
308
308
|
ret = @obj.ev_get ['get',"arg1\eno_hash_name"]
|
309
|
-
assert_equal "SERVER_ERROR no_hash_name
|
309
|
+
assert_equal "SERVER_ERROR no_hash_name does not exists.\r\n", ret
|
310
310
|
end
|
311
311
|
|
312
312
|
def test_rcwkv
|
313
313
|
ret = @obj.ev_rset ['set',"arg1\eno_hash_name", '0', '0', '5']
|
314
|
-
assert_equal "SERVER_ERROR no_hash_name
|
314
|
+
assert_equal "SERVER_ERROR no_hash_name does not exists.\r\n", ret
|
315
315
|
end
|
316
316
|
|
317
317
|
def test_wcwkv
|
318
318
|
ret = @obj.ev_wset ['set',"arg1\eno_hash_name", '0', '0', '5']
|
319
|
-
assert_equal "SERVER_ERROR no_hash_name
|
319
|
+
assert_equal "SERVER_ERROR no_hash_name does not exists.\r\n", ret
|
320
320
|
end
|
321
321
|
|
322
322
|
def test_cwkv
|
323
323
|
ret = @obj.ev_set ['set',"arg1\eno_hash_name", '0', '0', '5']
|
324
|
-
assert_equal "SERVER_ERROR no_hash_name
|
324
|
+
assert_equal "SERVER_ERROR no_hash_name does not exists.\r\n", ret
|
325
325
|
end
|
326
326
|
end
|
File without changes
|
File without changes
|
@@ -10,7 +10,7 @@ Roma::Client::RomaClient.class_eval{
|
|
10
10
|
end
|
11
11
|
}
|
12
12
|
|
13
|
-
|
13
|
+
module ListPluginTests
|
14
14
|
include RomaTestUtils
|
15
15
|
|
16
16
|
def setup
|
@@ -607,9 +607,15 @@ class ListPluginTest < Test::Unit::TestCase
|
|
607
607
|
end
|
608
608
|
private :push_a_vnode_stream
|
609
609
|
|
610
|
-
end #
|
610
|
+
end # ListPluginTests
|
611
|
+
|
612
|
+
class ListPluginTest < Test::Unit::TestCase
|
613
|
+
include ListPluginTests
|
614
|
+
end
|
615
|
+
|
616
|
+
class ListPluginTestForceForward < Test::Unit::TestCase
|
617
|
+
include ListPluginTests
|
611
618
|
|
612
|
-
class ListPluginTestForceForward < ListPluginTest
|
613
619
|
def setup
|
614
620
|
super
|
615
621
|
@rc.rttable.instance_eval{
|
File without changes
|
@@ -8,7 +8,7 @@ Roma::Client::RomaClient.class_eval{
|
|
8
8
|
end
|
9
9
|
}
|
10
10
|
|
11
|
-
|
11
|
+
module MapPluginTests
|
12
12
|
include RomaTestUtils
|
13
13
|
|
14
14
|
def setup
|
@@ -110,9 +110,15 @@ class MapPluginTest < Test::Unit::TestCase
|
|
110
110
|
assert_equal h, eval(@rc.map_to_s('key1'))
|
111
111
|
end
|
112
112
|
|
113
|
-
end #
|
113
|
+
end # MapPluginTests
|
114
|
+
|
115
|
+
class MapPluginTest < Test::Unit::TestCase
|
116
|
+
include MapPluginTests
|
117
|
+
end
|
118
|
+
|
119
|
+
class MapPluginTestForceForward < Test::Unit::TestCase
|
120
|
+
include MapPluginTests
|
114
121
|
|
115
|
-
class MapPluginTestForceForward < MapPluginTest
|
116
122
|
def setup
|
117
123
|
super
|
118
124
|
@rc.rttable.instance_eval{
|
@@ -55,13 +55,13 @@ class MHashTest < Test::Unit::TestCase
|
|
55
55
|
|
56
56
|
@rc.default_hash_name='not_exist_hash'
|
57
57
|
[:get, :delete, :incr, :decr].each do |m|
|
58
|
-
assert_raise(RuntimeError,'SERVER_ERROR not_exist_hash
|
58
|
+
assert_raise(RuntimeError,'SERVER_ERROR not_exist_hash does not exists.') do
|
59
59
|
@rc.send m, "key"
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
63
|
[:set, :add, :replace, :append, :prepend].each do |m|
|
64
|
-
assert_raise(RuntimeError,'SERVER_ERROR not_exist_hash
|
64
|
+
assert_raise(RuntimeError,'SERVER_ERROR not_exist_hash does not exists.') do
|
65
65
|
@rc.send m, "key","value"
|
66
66
|
end
|
67
67
|
end
|
@@ -127,8 +127,8 @@ class MHashTest < Test::Unit::TestCase
|
|
127
127
|
con.write("deletehash test\r\n")
|
128
128
|
ret = eval con.gets.chomp
|
129
129
|
assert_equal 2, ret.length
|
130
|
-
assert_equal 'SERVER_ERROR test
|
131
|
-
assert_equal 'SERVER_ERROR test
|
130
|
+
assert_equal 'SERVER_ERROR test does not exists.', ret['localhost_11211']
|
131
|
+
assert_equal 'SERVER_ERROR test does not exists.', ret['localhost_11212']
|
132
132
|
|
133
133
|
# delete hash to default
|
134
134
|
con.write("deletehash roma\r\n")
|
@@ -148,7 +148,7 @@ class MHashTest < Test::Unit::TestCase
|
|
148
148
|
|
149
149
|
con.write("rdefhash not_exist_hash\r\n")
|
150
150
|
ret = con.gets.chomp
|
151
|
-
assert_equal("CLIENT_ERROR not_exist_hash
|
151
|
+
assert_equal("CLIENT_ERROR not_exist_hash does not find.", ret)
|
152
152
|
|
153
153
|
con.write("createhash test\r\n")
|
154
154
|
con.gets
|
@@ -168,7 +168,7 @@ class MHashTest < Test::Unit::TestCase
|
|
168
168
|
# umount
|
169
169
|
con.write("umounthash test\r\n")
|
170
170
|
ret = con.gets.chomp
|
171
|
-
assert_equal("SERVER_ERROR test
|
171
|
+
assert_equal("SERVER_ERROR test does not find.", ret)
|
172
172
|
|
173
173
|
# add 'test' hash
|
174
174
|
con.write("createhash test\r\n")
|
@@ -189,7 +189,7 @@ class MHashTest < Test::Unit::TestCase
|
|
189
189
|
assert_equal 'UNMOUNTED', ret['localhost_11212']
|
190
190
|
|
191
191
|
@rc.default_hash_name='test'
|
192
|
-
assert_raise(RuntimeError,'SERVER_ERROR test
|
192
|
+
assert_raise(RuntimeError,'SERVER_ERROR test does not exists.') do
|
193
193
|
@rc.set "key", "value"
|
194
194
|
end
|
195
195
|
|
File without changes
|
@@ -9,7 +9,7 @@ Roma::Client::RomaClient.class_eval{
|
|
9
9
|
end
|
10
10
|
}
|
11
11
|
|
12
|
-
|
12
|
+
module RClientTests
|
13
13
|
include RomaTestUtils
|
14
14
|
|
15
15
|
def setup
|
@@ -180,7 +180,13 @@ class RClientTest < Test::Unit::TestCase
|
|
180
180
|
end
|
181
181
|
end
|
182
182
|
|
183
|
-
class
|
183
|
+
class RClientTest < Test::Unit::TestCase
|
184
|
+
include RClientTests
|
185
|
+
end
|
186
|
+
|
187
|
+
class RClientTestForceForward < Test::Unit::TestCase
|
188
|
+
include RClientTests
|
189
|
+
|
184
190
|
def setup
|
185
191
|
super
|
186
192
|
@rc.rttable.instance_eval{
|
File without changes
|
@@ -4,22 +4,11 @@ require 'roma/storage/tc_storage'
|
|
4
4
|
require 'roma/storage/dbm_storage'
|
5
5
|
require 'roma/storage/rh_storage'
|
6
6
|
require 'roma/storage/sqlite3_storage'
|
7
|
+
require 'roma/storage/groonga_storage'
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
super(arg)
|
12
|
-
@ndat=1000
|
13
|
-
end
|
14
|
-
|
15
|
-
def setup
|
16
|
-
rmtestdir('storage_test')
|
17
|
-
@st=Roma::Storage::TCStorage.new
|
18
|
-
@st.vn_list = [0,1,2,3,4,5,6,7,8,9]
|
19
|
-
@st.storage_path = 'storage_test'
|
20
|
-
@st.opendb
|
21
|
-
rescue =>e
|
22
|
-
p e
|
9
|
+
module StorageTests
|
10
|
+
def ndat
|
11
|
+
1000
|
23
12
|
end
|
24
13
|
|
25
14
|
def rmtestdir(dirname)
|
@@ -29,11 +18,6 @@ class TCStorageTest < Test::Unit::TestCase
|
|
29
18
|
end
|
30
19
|
end
|
31
20
|
|
32
|
-
def teardown
|
33
|
-
@st.closedb
|
34
|
-
rmtestdir('storage_test')
|
35
|
-
end
|
36
|
-
|
37
21
|
def test_set_get
|
38
22
|
assert_equal( 'abc_data',@st.set(0,'abc',0,0xffffffff,'abc_data')[4])
|
39
23
|
assert_equal( 'abc_data', @st.get(0,'abc',0) )
|
@@ -200,7 +184,7 @@ class TCStorageTest < Test::Unit::TestCase
|
|
200
184
|
assert_equal(2, Marshal.load(@st.dump(0)).length )
|
201
185
|
assert_nil( @st.dump(1) ) # another vnode is empty
|
202
186
|
|
203
|
-
n
|
187
|
+
n=ndat
|
204
188
|
n.times{|i|
|
205
189
|
@st.set(2,i.to_s,0,0xffffffff,'abc_data')
|
206
190
|
}
|
@@ -208,7 +192,7 @@ class TCStorageTest < Test::Unit::TestCase
|
|
208
192
|
end
|
209
193
|
|
210
194
|
def test_volume
|
211
|
-
n
|
195
|
+
n=ndat
|
212
196
|
n.times{|i|
|
213
197
|
@st.set(0,i.to_s,0,0xffffffff,'abc_data')
|
214
198
|
}
|
@@ -706,7 +690,9 @@ class TCStorageTest < Test::Unit::TestCase
|
|
706
690
|
end
|
707
691
|
end
|
708
692
|
|
709
|
-
class DbmStorageTest <
|
693
|
+
class DbmStorageTest < Test::Unit::TestCase
|
694
|
+
include StorageTests
|
695
|
+
|
710
696
|
def setup
|
711
697
|
rmtestdir('storage_test')
|
712
698
|
@st=Roma::Storage::DbmStorage.new
|
@@ -731,7 +717,28 @@ class DbmStorageTest < TCStorageTest
|
|
731
717
|
end
|
732
718
|
end
|
733
719
|
|
734
|
-
class
|
720
|
+
class TCStorageTest < Test::Unit::TestCase
|
721
|
+
include StorageTests
|
722
|
+
|
723
|
+
def setup
|
724
|
+
rmtestdir('storage_test')
|
725
|
+
@st=Roma::Storage::TCStorage.new
|
726
|
+
@st.vn_list = [0,1,2,3,4,5,6,7,8,9]
|
727
|
+
@st.storage_path = 'storage_test'
|
728
|
+
@st.opendb
|
729
|
+
rescue =>e
|
730
|
+
p e
|
731
|
+
end
|
732
|
+
|
733
|
+
def teardown
|
734
|
+
@st.closedb
|
735
|
+
rmtestdir('storage_test')
|
736
|
+
end
|
737
|
+
end
|
738
|
+
|
739
|
+
class RubyHashStorageTest < Test::Unit::TestCase
|
740
|
+
include StorageTests
|
741
|
+
|
735
742
|
def setup
|
736
743
|
@st=Roma::Storage::RubyHashStorage.new
|
737
744
|
@st.vn_list = [0,1,2,3,4,5,6,7,8,9]
|
@@ -793,7 +800,9 @@ class RubyHashStorageTest < TCStorageTest
|
|
793
800
|
|
794
801
|
end
|
795
802
|
|
796
|
-
class SQLite3StorageTest <
|
803
|
+
class SQLite3StorageTest < Test::Unit::TestCase
|
804
|
+
include StorageTests
|
805
|
+
|
797
806
|
def setup
|
798
807
|
rmtestdir('storage_test')
|
799
808
|
@st=Roma::Storage::SQLite3Storage.new
|
@@ -818,7 +827,9 @@ class SQLite3StorageTest < TCStorageTest
|
|
818
827
|
end
|
819
828
|
end
|
820
829
|
|
821
|
-
class TCMemStorageTest <
|
830
|
+
class TCMemStorageTest < Test::Unit::TestCase
|
831
|
+
include StorageTests
|
832
|
+
|
822
833
|
def setup
|
823
834
|
rmtestdir('storage_test')
|
824
835
|
@st=Roma::Storage::TCMemStorage.new
|
@@ -827,3 +838,24 @@ class TCMemStorageTest < TCStorageTest
|
|
827
838
|
@st.opendb
|
828
839
|
end
|
829
840
|
end
|
841
|
+
|
842
|
+
class GroongaStorageTest < Test::Unit::TestCase
|
843
|
+
include StorageTests
|
844
|
+
|
845
|
+
def storage_path
|
846
|
+
'groonga_storage_test'
|
847
|
+
end
|
848
|
+
|
849
|
+
def setup
|
850
|
+
rmtestdir(storage_path)
|
851
|
+
@st = Roma::Storage::GroongaStorage.new
|
852
|
+
@st.vn_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
853
|
+
@st.storage_path = storage_path
|
854
|
+
@st.opendb
|
855
|
+
end
|
856
|
+
|
857
|
+
def teardown
|
858
|
+
@st.closedb
|
859
|
+
rmtestdir(storage_path)
|
860
|
+
end
|
861
|
+
end
|
@@ -2,6 +2,7 @@
|
|
2
2
|
require 'roma/client/rclient'
|
3
3
|
require 'roma/messaging/con_pool'
|
4
4
|
require 'roma/config'
|
5
|
+
require 'pathname'
|
5
6
|
|
6
7
|
Roma::Client::RomaClient.class_eval{
|
7
8
|
def init_sync_routing_proc
|
@@ -12,14 +13,15 @@ class StorageErrorTest < Test::Unit::TestCase
|
|
12
13
|
include RomaTestUtils
|
13
14
|
|
14
15
|
def setup
|
15
|
-
|
16
|
-
`ln -s #{
|
16
|
+
base_path = Pathname(__FILE__).dirname.parent.expand_path
|
17
|
+
`ln -s #{base_path}/test/storage_error_storage.rb #{base_path}/lib/roma/storage`
|
17
18
|
start_roma 'config4storage_error.rb'
|
18
19
|
@rc=Roma::Client::RomaClient.new(["localhost_11211","localhost_11212"])
|
19
20
|
end
|
20
21
|
|
21
22
|
def teardown
|
22
|
-
|
23
|
+
base_path = Pathname(__FILE__).dirname.parent.expand_path
|
24
|
+
`rm -f #{base_path}/lib/roma/storage/storage_error_storage.rb`
|
23
25
|
stop_roma
|
24
26
|
Roma::Messaging::ConPool::instance.close_all
|
25
27
|
rescue => e
|
@@ -7,21 +7,7 @@ require 'roma/messaging/con_pool'
|
|
7
7
|
require 'roma/client/plugin/alist'
|
8
8
|
require 'roma/client/plugin/map'
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
def initialize(arg)
|
13
|
-
super(arg)
|
14
|
-
end
|
15
|
-
|
16
|
-
def setup
|
17
|
-
@stats = Roma::Stats.instance
|
18
|
-
@stats.address = 'roma0'
|
19
|
-
@stats.port = 11211
|
20
|
-
end
|
21
|
-
|
22
|
-
def teardown
|
23
|
-
system('rm -rf wb_test')
|
24
|
-
end
|
10
|
+
module FileWriterTests
|
25
11
|
|
26
12
|
# making and writing test
|
27
13
|
def test_wb_write
|
@@ -197,8 +183,22 @@ class FileWriterTest < Test::Unit::TestCase
|
|
197
183
|
|
198
184
|
end
|
199
185
|
|
186
|
+
class FileWriterTest < Test::Unit::TestCase
|
187
|
+
include FileWriterTests
|
188
|
+
|
189
|
+
def setup
|
190
|
+
@stats = Roma::Stats.instance
|
191
|
+
@stats.address = 'roma0'
|
192
|
+
@stats.port = 11211
|
193
|
+
end
|
194
|
+
|
195
|
+
def teardown
|
196
|
+
system('rm -rf wb_test')
|
197
|
+
end
|
198
|
+
end
|
200
199
|
|
201
|
-
class WriteBehindTest <
|
200
|
+
class WriteBehindTest < Test::Unit::TestCase
|
201
|
+
include FileWriterTests
|
202
202
|
include RomaTestUtils
|
203
203
|
|
204
204
|
def setup
|
@@ -458,7 +458,7 @@ class WriteBehindTest < FileWriterTest
|
|
458
458
|
rescue
|
459
459
|
end
|
460
460
|
#puts "#{cmd} #{key} #{val.inspect}"
|
461
|
-
|
461
|
+
assert_equal(res[cnt][0], cmd)
|
462
462
|
assert_equal(res[cnt][1], val)
|
463
463
|
cnt += 1
|
464
464
|
end
|