stomp 1.1.6 → 1.1.7
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.
- data/CHANGELOG.rdoc +6 -1
- data/Rakefile +7 -7
- data/lib/stomp/message.rb +32 -13
- data/lib/stomp/version.rb +2 -2
- data/spec/client_spec.rb +1 -0
- data/spec/spec_helper.rb +1 -9
- data/stomp.gemspec +44 -44
- data/test/test_client.rb +17 -11
- data/test/test_connection.rb +7 -4
- data/test/test_helper.rb +14 -0
- data/test/test_message.rb +114 -0
- metadata +29 -15
- data/.gitignore +0 -3
data/CHANGELOG.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -15,7 +15,7 @@ $:.unshift(File.dirname(__FILE__) + "/lib")
|
|
15
15
|
require 'rubygems'
|
16
16
|
require 'rake'
|
17
17
|
require 'rake/testtask'
|
18
|
-
require '
|
18
|
+
require 'rspec/core/rake_task'
|
19
19
|
require "stomp/version"
|
20
20
|
|
21
21
|
begin
|
@@ -34,7 +34,7 @@ begin
|
|
34
34
|
gem.email = ["brianm@apache.org", 'marius@stones.com', 'morellon@gmail.com']
|
35
35
|
gem.homepage = "http://stomp.codehaus.org/"
|
36
36
|
gem.authors = ["Brian McCallister", 'Marius Mathiesen', 'Thiago Morello']
|
37
|
-
gem.add_development_dependency "rspec"
|
37
|
+
gem.add_development_dependency "rspec", '>= 2.3'
|
38
38
|
end
|
39
39
|
Jeweler::GemcutterTasks.new
|
40
40
|
rescue LoadError
|
@@ -42,14 +42,14 @@ rescue LoadError
|
|
42
42
|
end
|
43
43
|
|
44
44
|
desc 'Run the specs'
|
45
|
-
|
46
|
-
t.spec_opts = ['--colour
|
47
|
-
t.
|
45
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
46
|
+
t.spec_opts = ['--colour']
|
47
|
+
t.pattern = 'spec/**/*_spec.rb'
|
48
48
|
end
|
49
49
|
|
50
50
|
desc "Rspec : run all with RCov"
|
51
|
-
|
52
|
-
t.
|
51
|
+
RSpec::Core::RakeTask.new('spec:rcov') do |t|
|
52
|
+
t.pattern = 'spec/**/*_spec.rb'
|
53
53
|
t.rcov = true
|
54
54
|
t.rcov_opts = ['--exclude', 'gems', '--exclude', 'spec']
|
55
55
|
end
|
data/lib/stomp/message.rb
CHANGED
@@ -4,32 +4,50 @@ module Stomp
|
|
4
4
|
class Message
|
5
5
|
attr_accessor :command, :headers, :body, :original
|
6
6
|
|
7
|
-
|
7
|
+
@@allowed_commands = [ 'CONNECTED', 'MESSAGE', 'RECEIPT', 'ERROR' ]
|
8
|
+
|
9
|
+
def initialize(frame)
|
10
|
+
# p frame
|
8
11
|
# Set default empty values
|
9
12
|
self.command = ''
|
10
13
|
self.headers = {}
|
11
14
|
self.body = ''
|
12
|
-
self.original =
|
13
|
-
return self if is_blank?(
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
self.original = frame
|
16
|
+
return self if is_blank?(frame)
|
17
|
+
# Figure out where individual parts of the frame begin and end.
|
18
|
+
command_index = frame.index("\n")
|
19
|
+
raise Stomp::Error::InvalidFormat, 'command index' unless command_index
|
20
|
+
#
|
21
|
+
headers_index = frame.index("\n\n", command_index+1)
|
22
|
+
raise Stomp::Error::InvalidFormat, 'headers index' unless headers_index
|
23
|
+
#
|
24
|
+
lastnull_index = frame.rindex("\0")
|
25
|
+
raise Stomp::Error::InvalidFormat, 'lastnull index' unless lastnull_index
|
18
26
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
27
|
+
# Extract working copies of each frame part
|
28
|
+
work_command = frame[0..command_index-1]
|
29
|
+
raise Stomp::Error::InvalidFormat, 'nil command' unless @@allowed_commands.include?(work_command)
|
30
|
+
#
|
31
|
+
work_headers = frame[command_index+1..headers_index-1]
|
32
|
+
raise Stomp::Error::InvalidFormat, 'nil headers' unless work_headers
|
33
|
+
#
|
34
|
+
work_body = frame[headers_index+2..lastnull_index-1]
|
35
|
+
raise Stomp::Error::InvalidFormat, 'nil body' unless work_body
|
36
|
+
# Set the frame values
|
37
|
+
self.command = work_command
|
38
|
+
work_headers.split("\n").map do |value|
|
23
39
|
parsed_value = value.match /^([\w|-]*):(.*)$/
|
40
|
+
raise Stomp::Error::InvalidFormat, 'parsed header value' unless parsed_value
|
24
41
|
self.headers[parsed_value[1].strip] = parsed_value[2].strip if parsed_value
|
25
42
|
end
|
26
43
|
|
27
44
|
body_length = -1
|
45
|
+
|
28
46
|
if self.headers['content-length']
|
29
47
|
body_length = self.headers['content-length'].to_i
|
30
|
-
raise Stomp::Error::InvalidMessageLength if
|
48
|
+
raise Stomp::Error::InvalidMessageLength if work_body.length != body_length
|
31
49
|
end
|
32
|
-
self.body =
|
50
|
+
self.body = work_body[0..body_length]
|
33
51
|
end
|
34
52
|
|
35
53
|
def to_s
|
@@ -47,3 +65,4 @@ module Stomp
|
|
47
65
|
end
|
48
66
|
|
49
67
|
end
|
68
|
+
|
data/lib/stomp/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,14 +1,6 @@
|
|
1
|
-
|
2
|
-
require 'spec'
|
3
|
-
rescue LoadError
|
4
|
-
require 'rubygems'
|
5
|
-
#gem 'rspec'
|
6
|
-
require 'spec'
|
7
|
-
end
|
8
|
-
|
1
|
+
require 'rspec'
|
9
2
|
dir = File.dirname(__FILE__)
|
10
3
|
lib_path = File.expand_path("#{dir}/../lib")
|
11
4
|
$LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path)
|
12
5
|
|
13
6
|
require 'stomp'
|
14
|
-
|
data/stomp.gemspec
CHANGED
@@ -1,78 +1,78 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{stomp}
|
8
|
-
s.version = "1.1.
|
8
|
+
s.version = "1.1.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Brian McCallister", "Marius Mathiesen", "Thiago Morello"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2011-01-14}
|
13
13
|
s.description = %q{Ruby client for the Stomp messaging protocol}
|
14
14
|
s.email = ["brianm@apache.org", "marius@stones.com", "morellon@gmail.com"]
|
15
15
|
s.executables = ["catstomp", "stompcat"]
|
16
16
|
s.extra_rdoc_files = [
|
17
17
|
"LICENSE",
|
18
|
-
|
18
|
+
"README.rdoc"
|
19
19
|
]
|
20
20
|
s.files = [
|
21
|
-
".
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
21
|
+
"CHANGELOG.rdoc",
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"bin/catstomp",
|
26
|
+
"bin/stompcat",
|
27
|
+
"examples/consumer.rb",
|
28
|
+
"examples/publisher.rb",
|
29
|
+
"lib/stomp.rb",
|
30
|
+
"lib/stomp/client.rb",
|
31
|
+
"lib/stomp/connection.rb",
|
32
|
+
"lib/stomp/errors.rb",
|
33
|
+
"lib/stomp/ext/hash.rb",
|
34
|
+
"lib/stomp/message.rb",
|
35
|
+
"lib/stomp/version.rb",
|
36
|
+
"spec/client_shared_examples.rb",
|
37
|
+
"spec/client_spec.rb",
|
38
|
+
"spec/connection_spec.rb",
|
39
|
+
"spec/message_spec.rb",
|
40
|
+
"spec/spec_helper.rb",
|
41
|
+
"stomp.gemspec",
|
42
|
+
"test/test_client.rb",
|
43
|
+
"test/test_connection.rb",
|
44
|
+
"test/test_helper.rb",
|
45
|
+
"test/test_message.rb"
|
46
46
|
]
|
47
47
|
s.homepage = %q{http://stomp.codehaus.org/}
|
48
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
49
48
|
s.require_paths = ["lib"]
|
50
|
-
s.rubygems_version = %q{1.3.
|
49
|
+
s.rubygems_version = %q{1.3.7}
|
51
50
|
s.summary = %q{Ruby client for the Stomp messaging protocol}
|
52
51
|
s.test_files = [
|
52
|
+
"examples/consumer.rb",
|
53
|
+
"examples/publisher.rb",
|
53
54
|
"spec/client_shared_examples.rb",
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
"examples/publisher.rb"
|
55
|
+
"spec/client_spec.rb",
|
56
|
+
"spec/connection_spec.rb",
|
57
|
+
"spec/message_spec.rb",
|
58
|
+
"spec/spec_helper.rb",
|
59
|
+
"test/test_client.rb",
|
60
|
+
"test/test_connection.rb",
|
61
|
+
"test/test_helper.rb",
|
62
|
+
"test/test_message.rb"
|
63
63
|
]
|
64
64
|
|
65
65
|
if s.respond_to? :specification_version then
|
66
66
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
67
67
|
s.specification_version = 3
|
68
68
|
|
69
|
-
if Gem::Version.new(Gem::
|
70
|
-
s.add_development_dependency(%q<rspec>, [">=
|
69
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
70
|
+
s.add_development_dependency(%q<rspec>, [">= 2.3"])
|
71
71
|
else
|
72
|
-
s.add_dependency(%q<rspec>, [">=
|
72
|
+
s.add_dependency(%q<rspec>, [">= 2.3"])
|
73
73
|
end
|
74
74
|
else
|
75
|
-
s.add_dependency(%q<rspec>, [">=
|
75
|
+
s.add_dependency(%q<rspec>, [">= 2.3"])
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
data/test/test_client.rb
CHANGED
@@ -181,44 +181,47 @@ class TestClient < Test::Unit::TestCase
|
|
181
181
|
|
182
182
|
def test_unsubscribe
|
183
183
|
message = nil
|
184
|
+
dest = destination
|
185
|
+
to_send = message_text
|
184
186
|
client = Stomp::Client.new(user, passcode, host, port, true)
|
185
187
|
assert_nothing_raised {
|
186
|
-
client.subscribe(
|
187
|
-
@client.publish
|
188
|
+
client.subscribe(dest, :ack => 'client') { |m| message = m }
|
189
|
+
@client.publish dest, to_send
|
188
190
|
Timeout::timeout(4) do
|
189
191
|
sleep 0.01 until message
|
190
192
|
end
|
191
193
|
}
|
192
|
-
assert_equal
|
194
|
+
assert_equal to_send, message.body, "first body check"
|
193
195
|
assert_nothing_raised {
|
194
|
-
client.unsubscribe
|
196
|
+
client.unsubscribe dest # was throwing exception on unsub at one point
|
195
197
|
client.close
|
196
198
|
}
|
197
199
|
# Same message should remain on the queue. Receive it again with ack=>auto.
|
198
200
|
message_copy = nil
|
199
201
|
client = Stomp::Client.new(user, passcode, host, port, true)
|
200
202
|
assert_nothing_raised {
|
201
|
-
client.subscribe(
|
203
|
+
client.subscribe(dest, :ack => 'auto') { |m| message_copy = m }
|
202
204
|
Timeout::timeout(4) do
|
203
205
|
sleep 0.01 until message_copy
|
204
206
|
end
|
205
207
|
}
|
206
|
-
assert_equal
|
207
|
-
assert_equal message.headers['message-id'], message_copy.headers['message-id']
|
208
|
+
assert_equal to_send, message_copy.body, "second body check"
|
209
|
+
assert_equal message.headers['message-id'], message_copy.headers['message-id'], "header check"
|
208
210
|
end
|
209
211
|
|
210
212
|
def test_thread_one_subscribe
|
211
213
|
msg = nil
|
214
|
+
dest = destination
|
212
215
|
Thread.new(@client) do |acli|
|
213
216
|
assert_nothing_raised {
|
214
|
-
acli.subscribe(
|
217
|
+
acli.subscribe(dest) { |m| msg = m }
|
215
218
|
Timeout::timeout(4) do
|
216
219
|
sleep 0.01 until msg
|
217
220
|
end
|
218
221
|
}
|
219
222
|
end
|
220
223
|
#
|
221
|
-
@client.publish(
|
224
|
+
@client.publish(dest, message_text)
|
222
225
|
sleep 1
|
223
226
|
assert_not_nil msg
|
224
227
|
end
|
@@ -227,11 +230,12 @@ class TestClient < Test::Unit::TestCase
|
|
227
230
|
#
|
228
231
|
lock = Mutex.new
|
229
232
|
msg_ctr = 0
|
233
|
+
dest = destination
|
230
234
|
1.upto(@max_threads) do |tnum|
|
231
235
|
# Threads within threads .....
|
232
236
|
Thread.new(@client) do |acli|
|
233
237
|
assert_nothing_raised {
|
234
|
-
acli.subscribe(
|
238
|
+
acli.subscribe(dest) { |m|
|
235
239
|
msg = m
|
236
240
|
lock.synchronize do
|
237
241
|
msg_ctr += 1
|
@@ -245,7 +249,7 @@ class TestClient < Test::Unit::TestCase
|
|
245
249
|
#
|
246
250
|
1.upto(@max_msgs) do |mnum|
|
247
251
|
msg = Time.now.to_s + " #{mnum}"
|
248
|
-
@client.publish(
|
252
|
+
@client.publish(dest, message_text)
|
249
253
|
end
|
250
254
|
#
|
251
255
|
max_sleep=5
|
@@ -262,10 +266,12 @@ class TestClient < Test::Unit::TestCase
|
|
262
266
|
|
263
267
|
private
|
264
268
|
def message_text
|
269
|
+
name = caller_method_name unless name
|
265
270
|
"test_client#" + name
|
266
271
|
end
|
267
272
|
|
268
273
|
def destination
|
274
|
+
name = caller_method_name unless name
|
269
275
|
"/queue/test/ruby/client/" + name
|
270
276
|
end
|
271
277
|
end
|
data/test/test_connection.rb
CHANGED
@@ -148,6 +148,7 @@ class TestStomp < Test::Unit::TestCase
|
|
148
148
|
def test_multi_thread_receive
|
149
149
|
lock = Mutex.new
|
150
150
|
msg_ctr = 0
|
151
|
+
dest = make_destination
|
151
152
|
#
|
152
153
|
1.upto(@max_threads) do |tnum|
|
153
154
|
Thread.new(@conn) do |amq|
|
@@ -162,10 +163,10 @@ class TestStomp < Test::Unit::TestCase
|
|
162
163
|
end
|
163
164
|
end
|
164
165
|
#
|
165
|
-
@conn.subscribe(
|
166
|
+
@conn.subscribe( dest )
|
166
167
|
1.upto(@max_msgs) do |mnum|
|
167
168
|
msg = Time.now.to_s + " #{mnum}"
|
168
|
-
@conn.publish(
|
169
|
+
@conn.publish(dest, msg)
|
169
170
|
end
|
170
171
|
#
|
171
172
|
max_sleep=5
|
@@ -184,6 +185,7 @@ class TestStomp < Test::Unit::TestCase
|
|
184
185
|
#
|
185
186
|
lock = Mutex.new
|
186
187
|
msg_ctr = 0
|
188
|
+
dest = make_destination
|
187
189
|
#
|
188
190
|
1.upto(@max_threads) do |tnum|
|
189
191
|
Thread.new(@conn) do |amq|
|
@@ -203,10 +205,10 @@ class TestStomp < Test::Unit::TestCase
|
|
203
205
|
end
|
204
206
|
end
|
205
207
|
#
|
206
|
-
@conn.subscribe(
|
208
|
+
@conn.subscribe( dest )
|
207
209
|
1.upto(@max_msgs) do |mnum|
|
208
210
|
msg = Time.now.to_s + " #{mnum}"
|
209
|
-
@conn.publish(
|
211
|
+
@conn.publish(dest, msg)
|
210
212
|
end
|
211
213
|
#
|
212
214
|
max_sleep=5
|
@@ -223,6 +225,7 @@ class TestStomp < Test::Unit::TestCase
|
|
223
225
|
|
224
226
|
private
|
225
227
|
def make_destination
|
228
|
+
name = caller_method_name unless name
|
226
229
|
"/queue/test/ruby/stomp/" + name
|
227
230
|
end
|
228
231
|
|
data/test/test_helper.rb
CHANGED
@@ -20,5 +20,19 @@ module TestBase
|
|
20
20
|
def port
|
21
21
|
(ENV['STOMP_PORT'] || 61613).to_i
|
22
22
|
end
|
23
|
+
# Helper for minitest on 1.9
|
24
|
+
def caller_method_name
|
25
|
+
parse_caller(caller(2).first).last
|
26
|
+
end
|
27
|
+
# Helper for minitest on 1.9
|
28
|
+
def parse_caller(at)
|
29
|
+
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
|
30
|
+
file = Regexp.last_match[1]
|
31
|
+
line = Regexp.last_match[2].to_i
|
32
|
+
method = Regexp.last_match[3]
|
33
|
+
method.gsub!(" ","_")
|
34
|
+
[file, line, method]
|
35
|
+
end
|
36
|
+
end
|
23
37
|
end
|
24
38
|
|
@@ -0,0 +1,114 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__))
|
2
|
+
#
|
3
|
+
# Test Ruby 1.8 with $KCODE='U'
|
4
|
+
#
|
5
|
+
require 'test_helper'
|
6
|
+
#
|
7
|
+
class TestMessageKcode < Test::Unit::TestCase
|
8
|
+
include TestBase
|
9
|
+
#
|
10
|
+
def setup
|
11
|
+
$KCODE = 'U' if RUBY_VERSION =~ /1\.8/
|
12
|
+
@conn = Stomp::Connection.open(user, passcode, host, port)
|
13
|
+
# Message body data
|
14
|
+
@messages = [
|
15
|
+
"normal text message",
|
16
|
+
"bad byte: \372",
|
17
|
+
"\004\b{\f:\tbody\"\001\207\004\b{\b:\016statusmsg\"\aOK:\017statuscodei\000:\tdata{\t:\voutput\"3Enabled, not running, last run 693 seconds ago:\frunningi\000:\fenabledi\006:\flastrunl+\aE\021\022M:\rsenderid\"\032xx.xx.xx.xx:\016requestid\"%849d647bbe3e421ea19ac9f947bbdde4:\020senderagent\"\fpuppetd:\016msgtarget\"%/topic/mcollective.puppetd.reply:\thash\"\001\257ZdQqtaDmmdD0jZinnEcpN+YbkxQDn8uuCnwsQdvGHau6d+gxnnfPLUddWRSb\nZNMs+sQUXgJNfcV1eVBn1H+Z8QQmzYXVDMqz7J43jmgloz5PsLVbN9K3PmX/\ngszqV/WpvIyAqm98ennWqSzpwMuiCC4q2Jr3s3Gm6bUJ6UkKXnY=\n:\fmsgtimel+\a\372\023\022M"
|
18
|
+
]
|
19
|
+
#
|
20
|
+
end
|
21
|
+
|
22
|
+
def teardown
|
23
|
+
@conn.disconnect if @conn # allow tests to disconnect
|
24
|
+
end
|
25
|
+
|
26
|
+
# Various message bodies, including the failing test case reported
|
27
|
+
def test_kcode_001
|
28
|
+
#
|
29
|
+
dest = make_destination
|
30
|
+
@conn.subscribe dest
|
31
|
+
@messages.each do |abody|
|
32
|
+
@conn.publish dest, abody
|
33
|
+
msg = @conn.receive
|
34
|
+
assert_instance_of Stomp::Message , msg, "type check for #{abody}"
|
35
|
+
assert_equal abody, msg.body, "equal check for #{abody}"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# All possible byte values
|
40
|
+
def test_kcode_002
|
41
|
+
#
|
42
|
+
abody = ""
|
43
|
+
"\000".upto("\377") {|abyte| abody << abyte }
|
44
|
+
#
|
45
|
+
dest = make_destination
|
46
|
+
@conn.subscribe dest
|
47
|
+
@conn.publish dest, abody
|
48
|
+
msg = @conn.receive
|
49
|
+
assert_instance_of Stomp::Message , msg, "type check for #{abody}"
|
50
|
+
assert_equal abody, msg.body, "equal check for #{abody}"
|
51
|
+
end
|
52
|
+
|
53
|
+
# A single byte at a time
|
54
|
+
def test_kcode_003
|
55
|
+
#
|
56
|
+
dest = make_destination
|
57
|
+
@conn.subscribe dest
|
58
|
+
#
|
59
|
+
"\000".upto("\377") do |abody|
|
60
|
+
@conn.publish dest, abody
|
61
|
+
msg = @conn.receive
|
62
|
+
assert_instance_of Stomp::Message , msg, "type check for #{abody}"
|
63
|
+
assert_equal abody, msg.body, "equal check for #{abody}"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
#
|
68
|
+
def test_kcode_004
|
69
|
+
#
|
70
|
+
assert_raise(Stomp::Error::InvalidFormat) {
|
71
|
+
aframe = Stomp::Message.new("junk")
|
72
|
+
}
|
73
|
+
#
|
74
|
+
assert_raise(Stomp::Error::InvalidFormat) {
|
75
|
+
aframe = Stomp::Message.new("command\njunk")
|
76
|
+
}
|
77
|
+
#
|
78
|
+
assert_raise(Stomp::Error::InvalidFormat) {
|
79
|
+
aframe = Stomp::Message.new("command\nheaders\n\njunk")
|
80
|
+
}
|
81
|
+
#
|
82
|
+
assert_raise(Stomp::Error::InvalidFormat) {
|
83
|
+
aframe = Stomp::Message.new("junkcommand\nheaders\n\njunk\0\n\n")
|
84
|
+
}
|
85
|
+
#
|
86
|
+
assert_raise(Stomp::Error::InvalidFormat) {
|
87
|
+
aframe = Stomp::Message.new("ERROR\nbadheaders\n\njunk\0\n\n")
|
88
|
+
}
|
89
|
+
#
|
90
|
+
assert_nothing_raised {
|
91
|
+
aframe = Stomp::Message.new("CONNECTED\nh1:val1\n\njunk\0\n")
|
92
|
+
}
|
93
|
+
#
|
94
|
+
assert_nothing_raised {
|
95
|
+
aframe = Stomp::Message.new("MESSAGE\nh1:val1\n\njunk\0\n")
|
96
|
+
}
|
97
|
+
#
|
98
|
+
assert_nothing_raised {
|
99
|
+
aframe = Stomp::Message.new("RECEIPT\nh1:val1\n\njunk\0\n")
|
100
|
+
}
|
101
|
+
#
|
102
|
+
assert_nothing_raised {
|
103
|
+
aframe = Stomp::Message.new("ERROR\nh1:val1\n\njunk\0\n")
|
104
|
+
}
|
105
|
+
|
106
|
+
end
|
107
|
+
|
108
|
+
private
|
109
|
+
def make_destination
|
110
|
+
name = caller_method_name unless name
|
111
|
+
"/queue/test/rubyk01/stomp/" + name
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stomp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 1
|
8
|
+
- 7
|
9
|
+
version: 1.1.7
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Brian McCallister
|
@@ -11,19 +16,23 @@ autorequire:
|
|
11
16
|
bindir: bin
|
12
17
|
cert_chain: []
|
13
18
|
|
14
|
-
date:
|
19
|
+
date: 2011-01-14 00:00:00 -05:00
|
15
20
|
default_executable:
|
16
21
|
dependencies:
|
17
22
|
- !ruby/object:Gem::Dependency
|
18
23
|
name: rspec
|
19
|
-
|
20
|
-
|
21
|
-
|
24
|
+
prerelease: false
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
22
27
|
requirements:
|
23
28
|
- - ">="
|
24
29
|
- !ruby/object:Gem::Version
|
25
|
-
|
26
|
-
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 3
|
33
|
+
version: "2.3"
|
34
|
+
type: :development
|
35
|
+
version_requirements: *id001
|
27
36
|
description: Ruby client for the Stomp messaging protocol
|
28
37
|
email:
|
29
38
|
- brianm@apache.org
|
@@ -38,7 +47,6 @@ extra_rdoc_files:
|
|
38
47
|
- LICENSE
|
39
48
|
- README.rdoc
|
40
49
|
files:
|
41
|
-
- .gitignore
|
42
50
|
- CHANGELOG.rdoc
|
43
51
|
- LICENSE
|
44
52
|
- README.rdoc
|
@@ -63,35 +71,42 @@ files:
|
|
63
71
|
- test/test_client.rb
|
64
72
|
- test/test_connection.rb
|
65
73
|
- test/test_helper.rb
|
74
|
+
- test/test_message.rb
|
66
75
|
has_rdoc: true
|
67
76
|
homepage: http://stomp.codehaus.org/
|
68
77
|
licenses: []
|
69
78
|
|
70
79
|
post_install_message:
|
71
|
-
rdoc_options:
|
72
|
-
|
80
|
+
rdoc_options: []
|
81
|
+
|
73
82
|
require_paths:
|
74
83
|
- lib
|
75
84
|
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
76
86
|
requirements:
|
77
87
|
- - ">="
|
78
88
|
- !ruby/object:Gem::Version
|
89
|
+
segments:
|
90
|
+
- 0
|
79
91
|
version: "0"
|
80
|
-
version:
|
81
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
+
none: false
|
82
94
|
requirements:
|
83
95
|
- - ">="
|
84
96
|
- !ruby/object:Gem::Version
|
97
|
+
segments:
|
98
|
+
- 0
|
85
99
|
version: "0"
|
86
|
-
version:
|
87
100
|
requirements: []
|
88
101
|
|
89
102
|
rubyforge_project:
|
90
|
-
rubygems_version: 1.3.
|
103
|
+
rubygems_version: 1.3.7
|
91
104
|
signing_key:
|
92
105
|
specification_version: 3
|
93
106
|
summary: Ruby client for the Stomp messaging protocol
|
94
107
|
test_files:
|
108
|
+
- examples/consumer.rb
|
109
|
+
- examples/publisher.rb
|
95
110
|
- spec/client_shared_examples.rb
|
96
111
|
- spec/client_spec.rb
|
97
112
|
- spec/connection_spec.rb
|
@@ -100,5 +115,4 @@ test_files:
|
|
100
115
|
- test/test_client.rb
|
101
116
|
- test/test_connection.rb
|
102
117
|
- test/test_helper.rb
|
103
|
-
-
|
104
|
-
- examples/publisher.rb
|
118
|
+
- test/test_message.rb
|
data/.gitignore
DELETED