couchbase-jruby-client 0.1.8-java → 0.1.9-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/couchbase/query.rb +0 -16
- data/lib/couchbase/version.rb +1 -1
- data/lib/couchbase/view_row.rb +3 -1
- data/test/setup.rb +1 -1
- data/test/test_arithmetic.rb +1 -1
- data/test/test_async.rb +1 -276
- data/test/test_bucket.rb +1 -1
- data/test/test_cas.rb +1 -34
- data/test/test_cluster.rb +1 -1
- data/test/test_couchbase.rb +1 -1
- data/test/test_couchbase_rails_cache_store.rb +1 -1
- data/test/test_delete.rb +1 -1
- data/test/test_design_docs.rb +1 -1
- data/test/test_errors.rb +1 -1
- data/test/test_fetch.rb +1 -1
- data/test/test_format.rb +1 -1
- data/test/test_get.rb +1 -1
- data/test/test_query.rb +3 -3
- data/test/test_result.rb +15 -0
- data/test/test_stats.rb +1 -1
- data/test/test_store.rb +1 -1
- data/test/test_touch.rb +1 -1
- data/test/test_unlock.rb +1 -1
- data/test/test_utils.rb +1 -1
- data/test/test_version.rb +2 -17
- data/test/test_view.rb +1 -1
- metadata +4 -4
- data/test/test_timer.rb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ff8556640816f6cb67c87afb0aaeb5fc7001f2f
|
4
|
+
data.tar.gz: 08314e3ea7bec37d1010bad128a106fb61c73127
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c6218643d51c032b95aad0cb00944c617eb79c753fe095a4ae8f909be2ceb83e838aa629f9da3751a97862c9e1b18b645fd017bd88f9297f529aed6e74141ad
|
7
|
+
data.tar.gz: 46970dc0dcf1342ff99982058d5b768c28f3d57b66b4bd93d8f1732b5bf96146b094d13914bd06222b6d6e3507a34d27483c875f9a5b280c1dccac8a17b109d1
|
data/lib/couchbase/query.rb
CHANGED
@@ -69,22 +69,6 @@ module Couchbase
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
-
|
73
|
-
# @option params [true, false] :quiet (true) Do not raise error if
|
74
|
-
# associated document not found in the memory. If the parameter +true+
|
75
|
-
# will use +nil+ value instead.
|
76
|
-
# @option params [String, Symbol] :on_error (:continue) Sets the
|
77
|
-
# response in the event of an error. Supported values:
|
78
|
-
# :continue:: Continue to generate view information in the event of an
|
79
|
-
# error, including the error information in the view
|
80
|
-
# response stream.
|
81
|
-
# :stop:: Stop immediately when an error condition occurs. No
|
82
|
-
# further view information will be returned.
|
83
|
-
# @option params [Fixnum] :connection_timeout (75000) Timeout before the
|
84
|
-
# view request is dropped (milliseconds)
|
85
|
-
|
86
|
-
|
87
|
-
# @option params [Hash] :body
|
88
72
|
query
|
89
73
|
end
|
90
74
|
|
data/lib/couchbase/version.rb
CHANGED
data/lib/couchbase/view_row.rb
CHANGED
data/test/setup.rb
CHANGED
data/test/test_arithmetic.rb
CHANGED
data/test/test_async.rb
CHANGED
@@ -17,283 +17,8 @@
|
|
17
17
|
|
18
18
|
require File.join(File.dirname(__FILE__), 'setup')
|
19
19
|
|
20
|
-
class TestAsync <
|
20
|
+
class TestAsync < Minitest::Test
|
21
21
|
|
22
|
-
def test_result_object_provides_enough_info
|
23
|
-
obj = Couchbase::Result.new
|
24
|
-
assert obj.respond_to?(:success?)
|
25
|
-
assert obj.respond_to?(:error)
|
26
|
-
assert obj.respond_to?(:key)
|
27
|
-
assert obj.respond_to?(:value)
|
28
|
-
assert obj.respond_to?(:node)
|
29
|
-
assert obj.respond_to?(:cas)
|
30
|
-
end
|
31
22
|
|
32
|
-
def method_name
|
33
|
-
|
34
|
-
end
|
35
23
|
|
36
|
-
# def test_it_requires_block_for_running_loop
|
37
|
-
# refute cb.async?
|
38
|
-
# assert_raises(LocalJumpError) do
|
39
|
-
# cb.run
|
40
|
-
# end
|
41
|
-
# cb.run do |conn|
|
42
|
-
# assert conn.async?
|
43
|
-
# end
|
44
|
-
# end
|
45
|
-
|
46
|
-
# def test_it_resets_async_flag_when_raising_exception_from_callback
|
47
|
-
# assert_raises(RuntimeError) do
|
48
|
-
# cb.run do |conn|
|
49
|
-
# conn.set(uniq_id, "foo") { raise }
|
50
|
-
# end
|
51
|
-
# end
|
52
|
-
# refute cb.async?
|
53
|
-
# end
|
54
|
-
|
55
|
-
# def test_nested_async_get_set
|
56
|
-
# cb.set(uniq_id, {"bar" => 1})
|
57
|
-
# cb.set(uniq_id(:hit), 0)
|
58
|
-
|
59
|
-
# cb.run do |conn|
|
60
|
-
# conn.get(uniq_id) do
|
61
|
-
# conn.get(uniq_id(:hit)) do |res|
|
62
|
-
# conn.set(uniq_id(:hit), res.value + 1)
|
63
|
-
# end
|
64
|
-
# end
|
65
|
-
# end
|
66
|
-
|
67
|
-
# val = cb.get(uniq_id(:hit))
|
68
|
-
# assert_equal 1, val
|
69
|
-
# end
|
70
|
-
|
71
|
-
# def test_nested_async_set_get
|
72
|
-
# val = nil
|
73
|
-
|
74
|
-
# cb.run do |conn|
|
75
|
-
# conn.set(uniq_id, "foo") do
|
76
|
-
# conn.get(uniq_id) do |res|
|
77
|
-
# val = res.value
|
78
|
-
# end
|
79
|
-
# end
|
80
|
-
# end
|
81
|
-
|
82
|
-
# assert_equal "foo", val
|
83
|
-
# end
|
84
|
-
|
85
|
-
# def test_nested_async_touch_get
|
86
|
-
# cb.set(uniq_id, "foo")
|
87
|
-
# success = false
|
88
|
-
# val = nil
|
89
|
-
|
90
|
-
# cb.run do |conn|
|
91
|
-
# conn.touch(uniq_id, :ttl => 1) do |res1|
|
92
|
-
# success = res1.success?
|
93
|
-
# conn.get(uniq_id) do |res2|
|
94
|
-
# val = res2.value
|
95
|
-
# end
|
96
|
-
# end
|
97
|
-
# end
|
98
|
-
|
99
|
-
# assert success
|
100
|
-
# assert_equal "foo", val
|
101
|
-
# sleep(2)
|
102
|
-
# assert_raises(Couchbase::Error::NotFound) do
|
103
|
-
# cb.get(uniq_id)
|
104
|
-
# end
|
105
|
-
# end
|
106
|
-
|
107
|
-
# def test_nested_async_delete_get
|
108
|
-
# cas = cb.set(uniq_id, "foo")
|
109
|
-
# success = false
|
110
|
-
# val = :unknown
|
111
|
-
|
112
|
-
# cb.run do |conn|
|
113
|
-
# conn.delete(uniq_id, :cas => cas) do |res1|
|
114
|
-
# success = res1.success?
|
115
|
-
# conn.get(uniq_id, :quiet => true) do |res2|
|
116
|
-
# val = res2.value
|
117
|
-
# end
|
118
|
-
# end
|
119
|
-
# end
|
120
|
-
|
121
|
-
# assert success
|
122
|
-
# refute val
|
123
|
-
# end
|
124
|
-
|
125
|
-
# def test_nested_async_stats_set
|
126
|
-
# skip
|
127
|
-
# stats = {}
|
128
|
-
|
129
|
-
# cb.run do |conn|
|
130
|
-
# conn.stats do |res1|
|
131
|
-
# id = uniq_id(res1.node, res1.key)
|
132
|
-
# stats[id] = false
|
133
|
-
# conn.set(id, res1.value) do |res2|
|
134
|
-
# stats[id] = res2.cas
|
135
|
-
# end
|
136
|
-
# end
|
137
|
-
# end
|
138
|
-
|
139
|
-
# stats.keys.each do |key|
|
140
|
-
# assert stats[key].is_a?(Numeric)
|
141
|
-
# end
|
142
|
-
# end
|
143
|
-
|
144
|
-
# def test_nested_async_flush_set
|
145
|
-
# skip
|
146
|
-
# cas = cb.set(uniq_id, "foo")
|
147
|
-
# res = {}
|
148
|
-
|
149
|
-
# cb.run do |conn|
|
150
|
-
# conn.flush do |res1|
|
151
|
-
# assert res1.success?, "Expected: successful status code.\nActual: #{res1.error.inspect}"
|
152
|
-
# id = uniq_id(res1.node)
|
153
|
-
# res[id] = false
|
154
|
-
# conn.set(id, true) do |res2|
|
155
|
-
# res[id] = res2.cas
|
156
|
-
# end
|
157
|
-
# end
|
158
|
-
# end
|
159
|
-
|
160
|
-
# assert_raises(Couchbase::Error::NotFound) do
|
161
|
-
# cb.get(uniq_id)
|
162
|
-
# end
|
163
|
-
# res.keys.each do |key|
|
164
|
-
# assert res[key].is_a?(Numeric)
|
165
|
-
# assert cb.get(key)
|
166
|
-
# end
|
167
|
-
# end
|
168
|
-
|
169
|
-
# def test_nested_async_incr_get
|
170
|
-
# skip
|
171
|
-
# cas = cb.set(uniq_id, 1)
|
172
|
-
# val = nil
|
173
|
-
|
174
|
-
# cb.run do |conn|
|
175
|
-
# conn.incr(uniq_id) do
|
176
|
-
# conn.get(uniq_id) do |res|
|
177
|
-
# val = res.value
|
178
|
-
# end
|
179
|
-
# end
|
180
|
-
# end
|
181
|
-
|
182
|
-
# assert_equal 2, val
|
183
|
-
# end
|
184
|
-
|
185
|
-
# def test_it_doesnt_accept_callbacks_in_synchronous_mode
|
186
|
-
# refute cb.async?
|
187
|
-
|
188
|
-
# assert_raises(ArgumentError) { cb.add(uniq_id, "foo") {} }
|
189
|
-
# assert_raises(ArgumentError) { cb.set(uniq_id, "foo") {} }
|
190
|
-
# assert_raises(ArgumentError) { cb.replace(uniq_id, "foo") {} }
|
191
|
-
# assert_raises(ArgumentError) { cb.get(uniq_id) {} }
|
192
|
-
# assert_raises(ArgumentError) { cb.touch(uniq_id) {} }
|
193
|
-
# assert_raises(ArgumentError) { cb.incr(uniq_id) {} }
|
194
|
-
# assert_raises(ArgumentError) { cb.decr(uniq_id) {} }
|
195
|
-
# assert_raises(ArgumentError) { cb.delete(uniq_id) {} }
|
196
|
-
# assert_raises(ArgumentError) { cb.append(uniq_id, "bar") {} }
|
197
|
-
# assert_raises(ArgumentError) { cb.prepend(uniq_id, "bar") {} }
|
198
|
-
# assert_raises(ArgumentError) { cb.stats {} }
|
199
|
-
# end
|
200
|
-
|
201
|
-
# def test_it_disallow_nested_run
|
202
|
-
# assert_raises(Couchbase::Error::Invalid) do
|
203
|
-
# cb.run do
|
204
|
-
# cb.run do
|
205
|
-
# end
|
206
|
-
# end
|
207
|
-
# end
|
208
|
-
# end
|
209
|
-
|
210
|
-
# def test_it_extends_timeout_in_async_mode_if_needed
|
211
|
-
# skip
|
212
|
-
# cb.set(uniq_id, "foo")
|
213
|
-
|
214
|
-
# cb.timeout = 100_000 # 100_000 us
|
215
|
-
# cb.run do
|
216
|
-
# cb.get(uniq_id) do |ret|
|
217
|
-
# assert ret.success?
|
218
|
-
# assert_equal "foo", ret.value
|
219
|
-
# end
|
220
|
-
# sleep(1.5) # 1_500_000 us
|
221
|
-
# end
|
222
|
-
# end
|
223
|
-
|
224
|
-
# def test_send_threshold
|
225
|
-
# skip
|
226
|
-
# sent = false
|
227
|
-
# cb.run(:send_threshold => 100) do # 100 bytes
|
228
|
-
# cb.set(uniq_id, "foo" * 100) {|r| sent = true}
|
229
|
-
# assert sent
|
230
|
-
# end
|
231
|
-
# end
|
232
|
-
|
233
|
-
# def test_asynchronous_connection
|
234
|
-
# skip
|
235
|
-
# connection = Couchbase.new(:hostname => @mock.host, :port => @mock.port, :async => true)
|
236
|
-
# refute cb.connected?, "new asynchronous connection must be disconnected"
|
237
|
-
# cb.on_connect do |res|
|
238
|
-
# assert res.success?, "on_connect called with error #{res.error.inspect}"
|
239
|
-
# assert_same connection, res.bucket
|
240
|
-
# end
|
241
|
-
# cb.run {}
|
242
|
-
# assert cb.connected?, "it should be connected after first run"
|
243
|
-
# end
|
244
|
-
|
245
|
-
# def test_it_calls_callback_immediately_if_connected_sync
|
246
|
-
# skip
|
247
|
-
# assert cb.connected?, "connection wasn't established in sync mode"
|
248
|
-
# called = false
|
249
|
-
# cb.on_connect do |res|
|
250
|
-
# assert res.success?, "on_connect called with error #{res.error.inspect}"
|
251
|
-
# called = true
|
252
|
-
# end
|
253
|
-
# assert called, "the callback hasn't been called on set"
|
254
|
-
# called = false
|
255
|
-
# cb.on_connect do |res|
|
256
|
-
# assert res.success?, "on_connect called with error #{res.error.inspect}"
|
257
|
-
# called = true
|
258
|
-
# end
|
259
|
-
# refute called, "the callback must not be called on subsequent sets"
|
260
|
-
# end
|
261
|
-
|
262
|
-
# def test_it_calls_callback_immediately_if_connected_async
|
263
|
-
# skip
|
264
|
-
# connection = Couchbase.new(:hostname => @mock.host, :port => @mock.port, :async => true)
|
265
|
-
# refute cb.connected?, "new asynchronous connection must be disconnected"
|
266
|
-
# called = false
|
267
|
-
# cb.run {}
|
268
|
-
# assert cb.connected?, "the connection must be established"
|
269
|
-
# cb.run do
|
270
|
-
# cb.on_connect do |res|
|
271
|
-
# assert res.success?, "on_connect called with error #{res.error.inspect}"
|
272
|
-
# called = true
|
273
|
-
# end
|
274
|
-
# end
|
275
|
-
# assert called, "the callback hasn't been called on set"
|
276
|
-
# called = false
|
277
|
-
# cb.run do
|
278
|
-
# cb.on_connect do |res|
|
279
|
-
# assert res.success?, "on_connect called with error #{res.error.inspect}"
|
280
|
-
# called = true
|
281
|
-
# end
|
282
|
-
# end
|
283
|
-
# refute called, "the callback must not be called on subsequent sets"
|
284
|
-
# end
|
285
|
-
|
286
|
-
# def test_it_returns_error_if_user_start_work_on_disconnected_instance_outside_on_connect_callback
|
287
|
-
# skip
|
288
|
-
# connection = Couchbase.new(:hostname => @mock.host, :port => @mock.port, :async => true)
|
289
|
-
# refute cb.connected?, "new asynchronous connection must be disconnected"
|
290
|
-
# error = nil
|
291
|
-
# cb.on_error do |ex|
|
292
|
-
# error = ex
|
293
|
-
# end
|
294
|
-
# cb.run do |c|
|
295
|
-
# c.set("foo", "bar")
|
296
|
-
# end
|
297
|
-
# assert_instance_of(Couchbase::Error::Connect, error)
|
298
|
-
# end
|
299
24
|
end
|
data/test/test_bucket.rb
CHANGED
data/test/test_cas.rb
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
|
18
18
|
require File.join(File.dirname(__FILE__), 'setup')
|
19
19
|
|
20
|
-
class TestCas <
|
20
|
+
class TestCas < Minitest::Test
|
21
21
|
|
22
22
|
def test_compare_and_swap
|
23
23
|
cb.set(uniq_id, {"bar" => 1})
|
@@ -29,37 +29,4 @@ class TestCas < MiniTest::Test
|
|
29
29
|
expected = {"bar" => 1, "baz" => 2}
|
30
30
|
assert_equal expected, val
|
31
31
|
end
|
32
|
-
|
33
|
-
def test_compare_and_swap_async
|
34
|
-
skip
|
35
|
-
cb.set(uniq_id, {"bar" => 1})
|
36
|
-
calls = 0
|
37
|
-
cb.run do |conn|
|
38
|
-
conn.cas(uniq_id) do |ret|
|
39
|
-
calls += 1
|
40
|
-
case ret.operation
|
41
|
-
when :get
|
42
|
-
new_val = ret.value
|
43
|
-
new_val["baz"] = 2
|
44
|
-
new_val
|
45
|
-
when :set
|
46
|
-
assert ret.success?
|
47
|
-
else
|
48
|
-
flunk "Unexpected operation: #{ret.operation.inspect}"
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
assert_equal 2, calls
|
53
|
-
val = cb.get(uniq_id)
|
54
|
-
expected = {"bar" => 1, "baz" => 2}
|
55
|
-
assert_equal expected, val
|
56
|
-
end
|
57
|
-
|
58
|
-
def test_flags_replication
|
59
|
-
skip
|
60
|
-
cb.set(uniq_id, "bar", :flags => 0x100)
|
61
|
-
cb.cas(uniq_id) { "baz" }
|
62
|
-
_, flags, _ = cb.get(uniq_id, :extended => true)
|
63
|
-
assert_equal 0x100, flags
|
64
|
-
end
|
65
32
|
end
|
data/test/test_cluster.rb
CHANGED
data/test/test_couchbase.rb
CHANGED
data/test/test_delete.rb
CHANGED
data/test/test_design_docs.rb
CHANGED
data/test/test_errors.rb
CHANGED
data/test/test_fetch.rb
CHANGED
data/test/test_format.rb
CHANGED
data/test/test_get.rb
CHANGED
data/test/test_query.rb
CHANGED
data/test/test_result.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'setup')
|
2
|
+
|
3
|
+
class TestResult < Minitest::Test
|
4
|
+
|
5
|
+
def test_result_object_provides_enough_info
|
6
|
+
obj = Couchbase::Result.new
|
7
|
+
assert obj.respond_to?(:success?)
|
8
|
+
assert obj.respond_to?(:error)
|
9
|
+
assert obj.respond_to?(:key)
|
10
|
+
assert obj.respond_to?(:value)
|
11
|
+
assert obj.respond_to?(:node)
|
12
|
+
assert obj.respond_to?(:cas)
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
data/test/test_stats.rb
CHANGED
data/test/test_store.rb
CHANGED
data/test/test_touch.rb
CHANGED
data/test/test_unlock.rb
CHANGED
data/test/test_utils.rb
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
|
18
18
|
require File.join(File.dirname(__FILE__), 'setup')
|
19
19
|
|
20
|
-
class TestUtils <
|
20
|
+
class TestUtils < Minitest::Test
|
21
21
|
|
22
22
|
def test_complex_startkey
|
23
23
|
assert_equal "all_docs?startkey=%5B%22Deadmau5%22%2C%22%22%5D", Couchbase::Utils.build_query("all_docs", :startkey => ["Deadmau5", ""])
|
data/test/test_version.rb
CHANGED
@@ -17,27 +17,12 @@
|
|
17
17
|
|
18
18
|
require File.join(File.dirname(__FILE__), 'setup')
|
19
19
|
|
20
|
-
class TestVersion <
|
20
|
+
class TestVersion < Minitest::Test
|
21
21
|
|
22
|
-
def
|
22
|
+
def test_version
|
23
23
|
ver = cb.version
|
24
24
|
assert ver.is_a?(Hash)
|
25
25
|
assert_equal 1, ver.size
|
26
26
|
end
|
27
27
|
|
28
|
-
def test_async_version
|
29
|
-
skip
|
30
|
-
ver = {}
|
31
|
-
cb.run do |conn|
|
32
|
-
conn.version do |ret|
|
33
|
-
assert ret.success?
|
34
|
-
ver[ret.node] = ret.value
|
35
|
-
end
|
36
|
-
end
|
37
|
-
assert_equal 1, ver.size
|
38
|
-
ver.each do |node, v|
|
39
|
-
assert v.is_a?(String)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
28
|
end
|
data/test/test_view.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: couchbase-jruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Mike Evans
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -186,9 +186,9 @@ files:
|
|
186
186
|
- test/test_format.rb
|
187
187
|
- test/test_get.rb
|
188
188
|
- test/test_query.rb
|
189
|
+
- test/test_result.rb
|
189
190
|
- test/test_stats.rb
|
190
191
|
- test/test_store.rb
|
191
|
-
- test/test_timer.rb
|
192
192
|
- test/test_touch.rb
|
193
193
|
- test/test_unlock.rb
|
194
194
|
- test/test_utils.rb
|
@@ -240,9 +240,9 @@ test_files:
|
|
240
240
|
- test/test_format.rb
|
241
241
|
- test/test_get.rb
|
242
242
|
- test/test_query.rb
|
243
|
+
- test/test_result.rb
|
243
244
|
- test/test_stats.rb
|
244
245
|
- test/test_store.rb
|
245
|
-
- test/test_timer.rb
|
246
246
|
- test/test_touch.rb
|
247
247
|
- test/test_unlock.rb
|
248
248
|
- test/test_utils.rb
|
data/test/test_timer.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
# Author:: Couchbase <info@couchbase.com>
|
2
|
-
# Copyright:: 2012 Couchbase, Inc.
|
3
|
-
# License:: Apache License, Version 2.0
|
4
|
-
#
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
# you may not use this file except in compliance with the License.
|
7
|
-
# You may obtain a copy of the License at
|
8
|
-
#
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
#
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
# See the License for the specific language governing permissions and
|
15
|
-
# limitations under the License.
|
16
|
-
#
|
17
|
-
|
18
|
-
require File.join(File.dirname(__FILE__), 'setup')
|
19
|
-
|
20
|
-
class TestTimer < MiniTest::Test
|
21
|
-
|
22
|
-
def test_initialization
|
23
|
-
skip
|
24
|
-
num = 0
|
25
|
-
cb.run do
|
26
|
-
assert Couchbase::Timer.new(connection, 100) { num += 1}
|
27
|
-
assert cb.create_timer(100) { num += 1}
|
28
|
-
|
29
|
-
assert Couchbase::Timer.new(connection, 100, :periodic => true) {|t| num += 1; t.cancel}
|
30
|
-
assert cb.create_periodic_timer(100) {|t| num += 1; t.cancel}
|
31
|
-
end
|
32
|
-
assert_equal 4, num
|
33
|
-
end
|
34
|
-
end
|