stomp 1.4.5 → 1.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +5 -2
- data/examples/ssl/SSL.md +1 -1
- data/lib/connection/netio.rb +12 -14
- data/lib/stomp/version.rb +2 -2
- data/stomp.gemspec +3 -3
- data/test/test_anonymous.rb +91 -2
- data/test/test_client.rb +164 -37
- data/test/test_codec.rb +13 -0
- data/test/test_connection.rb +107 -0
- data/test/test_connection1p.rb +85 -1
- data/test/test_helper.rb +1 -1
- data/test/test_message.rb +28 -4
- data/test/test_ssl.rb +20 -0
- data/test/test_urlogin.rb +19 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c814395091688edc6d4c400dea004f855feb2b7f53f9a20ca080b2876e570e5
|
4
|
+
data.tar.gz: b7cec9807723d92292e565b2864909b6ef332ceb931a050745b36fb1b6ee0f14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2305dac6286107dae1328aebad529e7960d2bc7d95ebc9cbcdea57395df4a1e28f28965a50a4735ba2d5b6f6d85a1f3847ceb93d7b801d9aca940c2b4a8ef7c
|
7
|
+
data.tar.gz: 74923725f94122d707defb178107f5d90c77a16d3e2f1741ac771bafa863d26911db287b61f12c1e7332f2ae02ac25375c449528ddcf85875eed582796ba8e74
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -45,6 +45,7 @@ An implementation of the Stomp protocol for Ruby. See:
|
|
45
45
|
:start_timeout => 0, # Timeout around Stomp::Client initialization
|
46
46
|
:sslctx_newparm => nil, # Param for SSLContext.new
|
47
47
|
:ssl_post_conn_check => true, # Further verify broker identity
|
48
|
+
:nto_cmd_read => true, # No timeout on COMMAND read
|
48
49
|
}
|
49
50
|
|
50
51
|
# for a client
|
@@ -93,7 +94,8 @@ A Stomp URL must begin with 'stomp://' and can be in one of the following forms:
|
|
93
94
|
|
94
95
|
See _CHANGELOG.rdoc_ for details.
|
95
96
|
|
96
|
-
* Gem version 1.4.
|
97
|
+
* Gem version 1.4.6. Fix version 1.4.5 which breaks JRuby support.
|
98
|
+
* Gem version 1.4.5. JRuby broken here. Use is not recommended.
|
97
99
|
* Gem version 1.4.4. Miscellaneous fixes, see CHANGELOG.md for details.
|
98
100
|
* Gem version 1.4.3. Fix broken install. Do not try to install 1.4.2.
|
99
101
|
* Gem version 1.4.2. Fix memory leak, and others !: see CHANGELOG.md for details.
|
@@ -318,7 +320,7 @@ Rafael Rosa
|
|
318
320
|
2010-03-23
|
319
321
|
</td>
|
320
322
|
<td style="border: 1px solid black;padding-left: 10px;" >
|
321
|
-
(
|
323
|
+
(0087)
|
322
324
|
</td>
|
323
325
|
<td style="border: 1px solid black;padding-left: 10px;" >
|
324
326
|
<span style="font-weight: bold;" >
|
@@ -804,3 +806,4 @@ Meg Richards
|
|
804
806
|
</td>
|
805
807
|
</tr>
|
806
808
|
</table>
|
809
|
+
|
data/examples/ssl/SSL.md
CHANGED
@@ -120,7 +120,7 @@ Subcase B - When your broker _does_ require client authentication:
|
|
120
120
|
|
121
121
|
* Expect connection failure (broker must be sent a valid client certificate).
|
122
122
|
|
123
|
-
### Use Case 3 - Authentification by broker, no authentification by
|
123
|
+
### Use Case 3 - Authentification by broker, no authentification by client
|
124
124
|
|
125
125
|
Subcase A - When your broker does _not_ require client authentication:
|
126
126
|
|
data/lib/connection/netio.rb
CHANGED
@@ -61,14 +61,6 @@ module Stomp
|
|
61
61
|
raise Stomp::Error::HandShakeDetectedError
|
62
62
|
end
|
63
63
|
|
64
|
-
# Check for a valid frame name from the server.
|
65
|
-
frname = line.chomp
|
66
|
-
p [ "_receive_frame_name_check", frname ] if drdbg
|
67
|
-
unless SERVER_FRAMES[frname]
|
68
|
-
sfex = Stomp::Error::ServerFrameNameError.new(frname)
|
69
|
-
raise sfex
|
70
|
-
end
|
71
|
-
|
72
64
|
p [ "_receive_norm_lend", line, Time.now ] if drdbg
|
73
65
|
line = _normalize_line_end(line) if @protocol >= Stomp::SPL_12
|
74
66
|
|
@@ -157,6 +149,12 @@ module Stomp
|
|
157
149
|
p [ "_receive_new_message" ] if drdbg
|
158
150
|
msg = Message.new(message_header + "\n" + message_body + "\0", @protocol >= Stomp::SPL_11)
|
159
151
|
p [ "_receive_decode_headers", msg.command, msg.headers ] if drdbg
|
152
|
+
# Check for a valid frame name from the server.
|
153
|
+
p [ "_receive_frame_name_check", msg.command ] if drdbg
|
154
|
+
unless SERVER_FRAMES[msg.command]
|
155
|
+
sfex = Stomp::Error::ServerFrameNameError.new(msg.command)
|
156
|
+
raise sfex
|
157
|
+
end
|
160
158
|
#
|
161
159
|
if @protocol >= Stomp::SPL_11 && msg.command != Stomp::CMD_CONNECTED
|
162
160
|
msg.headers = _decodeHeaders(msg.headers)
|
@@ -172,16 +170,16 @@ module Stomp
|
|
172
170
|
#
|
173
171
|
def _is_ready?(s)
|
174
172
|
rdy = s.ready?
|
175
|
-
|
173
|
+
#p [ "isr?", rdy ]
|
176
174
|
return rdy unless @jruby
|
177
|
-
|
175
|
+
#p [ "jrdychk", rdy.class ]
|
178
176
|
if rdy.class == NilClass
|
179
177
|
# rdy = true
|
180
178
|
rdy = false # A test
|
181
179
|
else
|
182
180
|
rdy = (rdy.class == Fixnum || rdy.class == TrueClass) ? true : false
|
183
181
|
end
|
184
|
-
|
182
|
+
#p [ "isr?_last", rdy ]
|
185
183
|
rdy
|
186
184
|
end
|
187
185
|
|
@@ -515,17 +513,17 @@ module Stomp
|
|
515
513
|
if @protocol == Stomp::SPL_10 || (@protocol >= Stomp::SPL_11 && !@hbr)
|
516
514
|
if @jruby
|
517
515
|
# Handle JRuby specific behavior.
|
518
|
-
|
516
|
+
#p [ "ilrjr00", _is_ready?(read_socket), RUBY_VERSION ]
|
519
517
|
if RUBY_VERSION < "2"
|
520
518
|
while true
|
521
|
-
|
519
|
+
#p [ "ilrjr01A1", _is_ready?(read_socket) ]
|
522
520
|
line = _interruptible_gets(read_socket) # Data from wire
|
523
521
|
break unless line == "\n"
|
524
522
|
line = ''
|
525
523
|
end
|
526
524
|
else # RUBY_VERSION >= "2"
|
527
525
|
while _is_ready?(read_socket)
|
528
|
-
|
526
|
+
#p [ "ilrjr01B2", _is_ready?(read_socket) ]
|
529
527
|
line = _interruptible_gets(read_socket) # Data from wire
|
530
528
|
break unless line == "\n"
|
531
529
|
line = ''
|
data/lib/stomp/version.rb
CHANGED
data/stomp.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: stomp 1.4.
|
5
|
+
# stub: stomp 1.4.6 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "stomp".freeze
|
9
|
-
s.version = "1.4.
|
9
|
+
s.version = "1.4.6"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Brian McCallister".freeze, "Marius Mathiesen".freeze, "Thiago Morello".freeze, "Guy M. Allard".freeze]
|
14
|
-
s.date = "2018-
|
14
|
+
s.date = "2018-11-05"
|
15
15
|
s.description = "Ruby client for the Stomp messaging protocol. Note that this gem is no longer supported on rubyforge.".freeze
|
16
16
|
s.email = ["brianm@apache.org".freeze, "marius@stones.com".freeze, "morellon@gmail.com".freeze, "allard.guy.m@gmail.com".freeze]
|
17
17
|
s.executables = ["catstomp".freeze, "stompcat".freeze]
|
data/test/test_anonymous.rb
CHANGED
@@ -20,6 +20,7 @@ class TestAnonymous < Test::Unit::TestCase
|
|
20
20
|
# Data for multi_thread tests
|
21
21
|
@max_threads = 20
|
22
22
|
@max_msgs = 100
|
23
|
+
@tandbg = ENV['TANDBG'] ? true : false
|
23
24
|
end
|
24
25
|
|
25
26
|
def teardown
|
@@ -28,21 +29,29 @@ class TestAnonymous < Test::Unit::TestCase
|
|
28
29
|
|
29
30
|
# Test basic connection creation.
|
30
31
|
def test_connection_exists
|
32
|
+
mn = "test_connection_exists" if @tandbg
|
33
|
+
p [ "01", mn, "starts" ] if @tandbg
|
31
34
|
assert_not_nil @conn
|
35
|
+
p [ "99", mn, "ends" ] if @tandbg
|
32
36
|
end
|
33
37
|
|
34
38
|
# Test asynchronous polling.
|
35
39
|
def test_poll_async
|
36
|
-
|
37
|
-
|
40
|
+
mn = "test_poll_async" if @tandbg
|
41
|
+
p [ "01", mn, "starts" ] if @tandbg
|
42
|
+
sq = ENV['STOMP_ARTEMIS'] ? "jms.queue.queue.do.not.put.messages.on.this.queue" :
|
43
|
+
"/queue/do.not.put.messages.on.this.queue"
|
38
44
|
@conn.subscribe(sq, :id => "a.no.messages.queue")
|
39
45
|
# If the test 'hangs' here, Connection#poll is broken.
|
40
46
|
m = @conn.poll
|
41
47
|
assert m.nil?
|
48
|
+
p [ "99", mn, "ends" ] if @tandbg
|
42
49
|
end
|
43
50
|
|
44
51
|
# Test suppression of content length header.
|
45
52
|
def test_no_length
|
53
|
+
mn = "test_no_length" if @tandbg
|
54
|
+
p [ "01", mn, "starts" ] if @tandbg
|
46
55
|
conn_subscribe make_destination
|
47
56
|
#
|
48
57
|
@conn.publish make_destination, "test_stomp#test_no_length",
|
@@ -55,34 +64,46 @@ class TestAnonymous < Test::Unit::TestCase
|
|
55
64
|
msg2 = @conn.receive
|
56
65
|
assert_equal "test_stomp#test_", msg2.body
|
57
66
|
checkEmsg(@conn)
|
67
|
+
p [ "99", mn, "ends" ] if @tandbg
|
58
68
|
end unless ENV['STOMP_RABBIT']
|
59
69
|
|
60
70
|
# Test direct / explicit receive.
|
61
71
|
def test_explicit_receive
|
72
|
+
mn = "test_explicit_receive" if @tandbg
|
73
|
+
p [ "01", mn, "starts" ] if @tandbg
|
62
74
|
conn_subscribe make_destination
|
63
75
|
@conn.publish make_destination, "test_stomp#test_explicit_receive"
|
64
76
|
msg = @conn.receive
|
65
77
|
assert_equal "test_stomp#test_explicit_receive", msg.body
|
78
|
+
p [ "99", mn, "ends" ] if @tandbg
|
66
79
|
end
|
67
80
|
|
68
81
|
# Test asking for a receipt.
|
69
82
|
def test_receipt
|
83
|
+
mn = "test_receipt" if @tandbg
|
84
|
+
p [ "01", mn, "starts" ] if @tandbg
|
70
85
|
conn_subscribe make_destination, :receipt => "abc"
|
71
86
|
msg = @conn.receive
|
72
87
|
assert_equal "abc", msg.headers['receipt-id']
|
73
88
|
checkEmsg(@conn)
|
89
|
+
p [ "99", mn, "ends" ] if @tandbg
|
74
90
|
end
|
75
91
|
|
76
92
|
# Test asking for a receipt on disconnect.
|
77
93
|
def test_disconnect_receipt
|
94
|
+
mn = "test_disconnect_receipt" if @tandbg
|
95
|
+
p [ "01", mn, "starts" ] if @tandbg
|
78
96
|
@conn.disconnect :receipt => "abc123"
|
79
97
|
assert_not_nil(@conn.disconnect_receipt, "should have a receipt")
|
80
98
|
assert_equal(@conn.disconnect_receipt.headers['receipt-id'],
|
81
99
|
"abc123", "receipt sent and received should match")
|
100
|
+
p [ "99", mn, "ends" ] if @tandbg
|
82
101
|
end
|
83
102
|
|
84
103
|
# Test ACKs for Stomp 1.0
|
85
104
|
def test_client_ack_with_symbol_10
|
105
|
+
mn = "test_client_ack_with_symbol_10" if @tandbg
|
106
|
+
p [ "01", mn, "starts" ] if @tandbg
|
86
107
|
if @conn.protocol != Stomp::SPL_10
|
87
108
|
assert true
|
88
109
|
return
|
@@ -95,10 +116,13 @@ class TestAnonymous < Test::Unit::TestCase
|
|
95
116
|
# matching the message-id for the MESSAGE being acknowledged.
|
96
117
|
@conn.ack msg.headers['message-id']
|
97
118
|
checkEmsg(@conn)
|
119
|
+
p [ "99", mn, "ends" ] if @tandbg
|
98
120
|
end
|
99
121
|
|
100
122
|
# Test ACKs for Stomp 1.1
|
101
123
|
def test_client_ack_with_symbol_11
|
124
|
+
mn = "test_client_ack_with_symbol_11" if @tandbg
|
125
|
+
p [ "01", mn, "starts" ] if @tandbg
|
102
126
|
if @conn.protocol != Stomp::SPL_11
|
103
127
|
assert true
|
104
128
|
return
|
@@ -114,10 +138,13 @@ class TestAnonymous < Test::Unit::TestCase
|
|
114
138
|
# id header.
|
115
139
|
@conn.ack msg.headers['message-id'], :subscription => msg.headers['subscription']
|
116
140
|
checkEmsg(@conn)
|
141
|
+
p [ "99", mn, "ends" ] if @tandbg
|
117
142
|
end
|
118
143
|
|
119
144
|
# Test ACKs for Stomp 1.2
|
120
145
|
def test_client_ack_with_symbol_12
|
146
|
+
mn = "test_client_ack_with_symbol_12" if @tandbg
|
147
|
+
p [ "01", mn, "starts" ] if @tandbg
|
121
148
|
if @conn.protocol != Stomp::SPL_12
|
122
149
|
assert true
|
123
150
|
return
|
@@ -131,33 +158,45 @@ class TestAnonymous < Test::Unit::TestCase
|
|
131
158
|
# of the MESSAGE being acknowledged.
|
132
159
|
@conn.ack msg.headers['ack']
|
133
160
|
checkEmsg(@conn)
|
161
|
+
p [ "99", mn, "ends" ] if @tandbg
|
134
162
|
end
|
135
163
|
|
136
164
|
# Test a message with 0x00 embedded in the body.
|
137
165
|
def test_embedded_null
|
166
|
+
mn = "test_embedded_null" if @tandbg
|
167
|
+
p [ "01", mn, "starts" ] if @tandbg
|
138
168
|
conn_subscribe make_destination
|
139
169
|
@conn.publish make_destination, "a\0"
|
140
170
|
msg = @conn.receive
|
141
171
|
assert_equal "a\0" , msg.body
|
142
172
|
checkEmsg(@conn)
|
173
|
+
p [ "99", mn, "ends" ] if @tandbg
|
143
174
|
end
|
144
175
|
|
145
176
|
# Test connection open checking.
|
146
177
|
def test_connection_open?
|
178
|
+
mn = "test_connection_open?" if @tandbg
|
179
|
+
p [ "01", mn, "starts" ] if @tandbg
|
147
180
|
assert_equal true , @conn.open?
|
148
181
|
@conn.disconnect
|
149
182
|
assert_equal false, @conn.open?
|
183
|
+
p [ "99", mn, "ends" ] if @tandbg
|
150
184
|
end
|
151
185
|
|
152
186
|
# Test connection closed checking.
|
153
187
|
def test_connection_closed?
|
188
|
+
mn = "test_connection_closed?" if @tandbg
|
189
|
+
p [ "01", mn, "starts" ] if @tandbg
|
154
190
|
assert_equal false, @conn.closed?
|
155
191
|
@conn.disconnect
|
156
192
|
assert_equal true, @conn.closed?
|
193
|
+
p [ "99", mn, "ends" ] if @tandbg
|
157
194
|
end
|
158
195
|
|
159
196
|
# Test that methods detect a closed connection.
|
160
197
|
def test_closed_checks_conn
|
198
|
+
mn = "test_closed_checks_conn" if @tandbg
|
199
|
+
p [ "01", mn, "starts" ] if @tandbg
|
161
200
|
@conn.disconnect
|
162
201
|
#
|
163
202
|
assert_raise Stomp::Error::NoCurrentConnection do
|
@@ -203,33 +242,45 @@ class TestAnonymous < Test::Unit::TestCase
|
|
203
242
|
assert_raise Stomp::Error::NoCurrentConnection do
|
204
243
|
_ = @conn.poll
|
205
244
|
end
|
245
|
+
p [ "99", mn, "ends" ] if @tandbg
|
206
246
|
end
|
207
247
|
|
208
248
|
# Test that we receive a Stomp::Message.
|
209
249
|
def test_response_is_instance_of_message_class
|
250
|
+
mn = "test_response_is_instance_of_message_class" if @tandbg
|
251
|
+
p [ "01", mn, "starts" ] if @tandbg
|
210
252
|
conn_subscribe make_destination
|
211
253
|
@conn.publish make_destination, "a\0"
|
212
254
|
msg = @conn.receive
|
213
255
|
assert_instance_of Stomp::Message , msg
|
214
256
|
checkEmsg(@conn)
|
257
|
+
p [ "99", mn, "ends" ] if @tandbg
|
215
258
|
end
|
216
259
|
|
217
260
|
# Test converting a Message to a string.
|
218
261
|
def test_message_to_s
|
262
|
+
mn = "test_message_to_s" if @tandbg
|
263
|
+
p [ "01", mn, "starts" ] if @tandbg
|
219
264
|
conn_subscribe make_destination
|
220
265
|
@conn.publish make_destination, "a\0"
|
221
266
|
msg = @conn.receive
|
222
267
|
assert_match(/^<Stomp::Message headers=/ , msg.to_s)
|
223
268
|
checkEmsg(@conn)
|
269
|
+
p [ "99", mn, "ends" ] if @tandbg
|
224
270
|
end
|
225
271
|
|
226
272
|
# Test that a connection frame is present.
|
227
273
|
def test_connection_frame
|
274
|
+
mn = "test_connection_frame" if @tandbg
|
275
|
+
p [ "01", mn, "starts" ] if @tandbg
|
228
276
|
assert_not_nil @conn.connection_frame
|
277
|
+
p [ "99", mn, "ends" ] if @tandbg
|
229
278
|
end
|
230
279
|
|
231
280
|
# Test messages with multiple line ends.
|
232
281
|
def test_messages_with_multipleLine_ends
|
282
|
+
mn = "test_messages_with_multipleLine_ends" if @tandbg
|
283
|
+
p [ "01", mn, "starts" ] if @tandbg
|
233
284
|
conn_subscribe make_destination
|
234
285
|
@conn.publish make_destination, "a\n\n"
|
235
286
|
@conn.publish make_destination, "b\n\na\n\n"
|
@@ -240,10 +291,13 @@ class TestAnonymous < Test::Unit::TestCase
|
|
240
291
|
assert_equal "a\n\n", msg_a.body
|
241
292
|
assert_equal "b\n\na\n\n", msg_b.body
|
242
293
|
checkEmsg(@conn)
|
294
|
+
p [ "99", mn, "ends" ] if @tandbg
|
243
295
|
end
|
244
296
|
|
245
297
|
# Test publishing multiple messages.
|
246
298
|
def test_publish_two_messages
|
299
|
+
mn = "test_publish_two_messages" if @tandbg
|
300
|
+
p [ "01", mn, "starts" ] if @tandbg
|
247
301
|
conn_subscribe make_destination
|
248
302
|
@conn.publish make_destination, "a\0"
|
249
303
|
@conn.publish make_destination, "b\0"
|
@@ -253,14 +307,18 @@ class TestAnonymous < Test::Unit::TestCase
|
|
253
307
|
assert_equal "a\0", msg_a.body
|
254
308
|
assert_equal "b\0", msg_b.body
|
255
309
|
checkEmsg(@conn)
|
310
|
+
p [ "99", mn, "ends" ] if @tandbg
|
256
311
|
end
|
257
312
|
|
258
313
|
def test_thread_hang_one
|
314
|
+
mn = "test_thread_hang_one" if @tandbg
|
315
|
+
p [ "01", mn, "starts" ] if @tandbg
|
259
316
|
received = nil
|
260
317
|
Thread.new(@conn) do |amq|
|
261
318
|
no_rep_error()
|
262
319
|
while true
|
263
320
|
received = amq.receive
|
321
|
+
Thread::exit if received
|
264
322
|
end
|
265
323
|
end
|
266
324
|
#
|
@@ -271,10 +329,13 @@ class TestAnonymous < Test::Unit::TestCase
|
|
271
329
|
assert_not_nil received
|
272
330
|
assert_equal message, received.body
|
273
331
|
checkEmsg(@conn)
|
332
|
+
p [ "99", mn, "ends" ] if @tandbg
|
274
333
|
end
|
275
334
|
|
276
335
|
# Test polling with a single thread.
|
277
336
|
def test_thread_poll_one
|
337
|
+
mn = "test_thread_poll_one" if @tandbg
|
338
|
+
p [ "01", mn, "starts" ] if @tandbg
|
278
339
|
received = nil
|
279
340
|
max_sleep = (RUBY_VERSION =~ /1\.8/) ? 10 : 1
|
280
341
|
Thread.new(@conn) do |amq|
|
@@ -294,10 +355,13 @@ class TestAnonymous < Test::Unit::TestCase
|
|
294
355
|
assert_not_nil received
|
295
356
|
assert_equal message, received.body
|
296
357
|
checkEmsg(@conn)
|
358
|
+
p [ "99", mn, "ends" ] if @tandbg
|
297
359
|
end
|
298
360
|
|
299
361
|
# Test receiving with multiple threads.
|
300
362
|
def test_multi_thread_receive
|
363
|
+
mn = "test_multi_thread_receive" if @tandbg
|
364
|
+
p [ "01", mn, "starts" ] if @tandbg
|
301
365
|
lock = Mutex.new
|
302
366
|
msg_ctr = 0
|
303
367
|
dest = make_destination
|
@@ -334,10 +398,13 @@ class TestAnonymous < Test::Unit::TestCase
|
|
334
398
|
end
|
335
399
|
assert_equal @max_msgs, msg_ctr
|
336
400
|
checkEmsg(@conn)
|
401
|
+
p [ "99", mn, "ends" ] if @tandbg
|
337
402
|
end unless RUBY_ENGINE =~ /jruby/
|
338
403
|
|
339
404
|
# Test polling with multiple threads.
|
340
405
|
def test_multi_thread_poll
|
406
|
+
mn = "test_multi_thread_poll" if @tandbg
|
407
|
+
p [ "01", mn, "starts" ] if @tandbg
|
341
408
|
#
|
342
409
|
lock = Mutex.new
|
343
410
|
msg_ctr = 0
|
@@ -380,20 +447,26 @@ class TestAnonymous < Test::Unit::TestCase
|
|
380
447
|
end
|
381
448
|
assert_equal @max_msgs, msg_ctr
|
382
449
|
checkEmsg(@conn)
|
450
|
+
p [ "99", mn, "ends" ] if @tandbg
|
383
451
|
end unless RUBY_ENGINE =~ /jruby/
|
384
452
|
|
385
453
|
# Test using a nil body.
|
386
454
|
def test_nil_body
|
455
|
+
mn = "test_nil_body" if @tandbg
|
456
|
+
p [ "01", mn, "starts" ] if @tandbg
|
387
457
|
dest = make_destination
|
388
458
|
@conn.publish dest, nil
|
389
459
|
conn_subscribe dest
|
390
460
|
msg = @conn.receive
|
391
461
|
assert_equal "", msg.body
|
392
462
|
checkEmsg(@conn)
|
463
|
+
p [ "99", mn, "ends" ] if @tandbg
|
393
464
|
end
|
394
465
|
|
395
466
|
# Test transaction message sequencing.
|
396
467
|
def test_transaction
|
468
|
+
mn = "test_transaction" if @tandbg
|
469
|
+
p [ "01", mn, "starts" ] if @tandbg
|
397
470
|
conn_subscribe make_destination
|
398
471
|
|
399
472
|
@conn.begin "txA"
|
@@ -408,10 +481,13 @@ class TestAnonymous < Test::Unit::TestCase
|
|
408
481
|
msg = @conn.receive
|
409
482
|
assert_equal "txn message", msg.body
|
410
483
|
checkEmsg(@conn)
|
484
|
+
p [ "99", mn, "ends" ] if @tandbg
|
411
485
|
end unless ENV['STOMP_ARTEMIS'] # See Artemis docs for 1.3, page 222
|
412
486
|
|
413
487
|
# Test duplicate subscriptions.
|
414
488
|
def test_duplicate_subscription
|
489
|
+
mn = "test_duplicate_subscription" if @tandbg
|
490
|
+
p [ "01", mn, "starts" ] if @tandbg
|
415
491
|
@conn.disconnect # not reliable
|
416
492
|
@conn = Stomp::Connection.open(nil, nil, host, port, true, nil, nil) # reliable
|
417
493
|
dest = make_destination
|
@@ -421,18 +497,24 @@ class TestAnonymous < Test::Unit::TestCase
|
|
421
497
|
conn_subscribe dest
|
422
498
|
end
|
423
499
|
checkEmsg(@conn)
|
500
|
+
p [ "99", mn, "ends" ] if @tandbg
|
424
501
|
end
|
425
502
|
|
426
503
|
# Test nil 1.1 connection parameters.
|
427
504
|
def test_nil_connparms
|
505
|
+
mn = "test_nil_connparms" if @tandbg
|
506
|
+
p [ "01", mn, "starts" ] if @tandbg
|
428
507
|
@conn.disconnect
|
429
508
|
#
|
430
509
|
@conn = Stomp::Connection.open(nil, nil, host, port, false, 5, nil)
|
431
510
|
checkEmsg(@conn)
|
511
|
+
p [ "99", mn, "ends" ] if @tandbg
|
432
512
|
end
|
433
513
|
|
434
514
|
# Basic NAK test.
|
435
515
|
def test_nack11p_0010
|
516
|
+
mn = "test_nack11p_0010" if @tandbg
|
517
|
+
p [ "01", mn, "starts" ] if @tandbg
|
436
518
|
if @conn.protocol == Stomp::SPL_10
|
437
519
|
assert_raise Stomp::Error::UnsupportedProtocolError do
|
438
520
|
@conn.nack "dummy msg-id"
|
@@ -465,6 +547,7 @@ class TestAnonymous < Test::Unit::TestCase
|
|
465
547
|
msg2 = @conn.receive
|
466
548
|
assert_equal smsg, msg2.body
|
467
549
|
checkEmsg(@conn)
|
550
|
+
p [ "99", mn, "ends" ] if @tandbg
|
468
551
|
end
|
469
552
|
end unless (ENV['STOMP_AMQ11'] || ENV['STOMP_ARTEMIS'])
|
470
553
|
|
@@ -472,6 +555,8 @@ class TestAnonymous < Test::Unit::TestCase
|
|
472
555
|
# fail only when connecting to a pure STOMP 1.0 server that does not
|
473
556
|
# return a 'version' header at all.
|
474
557
|
def test_conn10_simple
|
558
|
+
mn = "test_conn10_simple" if @tandbg
|
559
|
+
p [ "01", mn, "starts" ] if @tandbg
|
475
560
|
@conn.disconnect
|
476
561
|
#
|
477
562
|
vhost = ENV['STOMP_RABBIT'] ? "/" : host
|
@@ -494,15 +579,19 @@ class TestAnonymous < Test::Unit::TestCase
|
|
494
579
|
c = nil
|
495
580
|
c = Stomp::Connection.new(hash)
|
496
581
|
c.disconnect if c
|
582
|
+
p [ "99", mn, "ends" ] if @tandbg
|
497
583
|
end
|
498
584
|
|
499
585
|
# test JRuby detection
|
500
586
|
def test_jruby_presence
|
587
|
+
mn = "test_jruby_presence" if @tandbg
|
588
|
+
p [ "01", mn, "starts" ] if @tandbg
|
501
589
|
if defined?(RUBY_ENGINE) && RUBY_ENGINE =~ /jruby/
|
502
590
|
assert @conn.jruby
|
503
591
|
else
|
504
592
|
assert !@conn.jruby
|
505
593
|
end
|
594
|
+
p [ "99", mn, "ends" ] if @tandbg
|
506
595
|
end
|
507
596
|
|
508
597
|
end
|