stomp 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/stomp.gemspec CHANGED
@@ -4,13 +4,13 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "stomp"
8
- s.version = "1.2.0"
7
+ s.name = %q{stomp}
8
+ s.version = "1.2.1"
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", "Guy M. Allard"]
12
- s.date = "2011-12-15"
13
- s.description = "Ruby client for the Stomp messaging protocol. Note that this gem is no longer supported on rubyforge."
12
+ s.date = %q{2012-03-13}
13
+ s.description = %q{Ruby client for the Stomp messaging protocol. Note that this gem is no longer supported on rubyforge.}
14
14
  s.email = ["brianm@apache.org", "marius@stones.com", "morellon@gmail.com", "allard.guy.m@gmail.com"]
15
15
  s.executables = ["catstomp", "stompcat"]
16
16
  s.extra_rdoc_files = [
@@ -33,10 +33,20 @@ Gem::Specification.new do |s|
33
33
  "examples/get11conn_ex1.rb",
34
34
  "examples/get11conn_ex2.rb",
35
35
  "examples/logexamp.rb",
36
+ "examples/logexamp_ssl.rb",
36
37
  "examples/publisher.rb",
37
38
  "examples/put11conn_ex1.rb",
38
39
  "examples/putget11_rh1.rb",
39
40
  "examples/slogger.rb",
41
+ "examples/ssl_uc1.rb",
42
+ "examples/ssl_uc1_ciphers.rb",
43
+ "examples/ssl_uc2.rb",
44
+ "examples/ssl_uc2_ciphers.rb",
45
+ "examples/ssl_uc3.rb",
46
+ "examples/ssl_uc3_ciphers.rb",
47
+ "examples/ssl_uc4.rb",
48
+ "examples/ssl_uc4_ciphers.rb",
49
+ "examples/ssl_ucx_default_ciphers.rb",
40
50
  "examples/stomp11_common.rb",
41
51
  "examples/topic_consumer.rb",
42
52
  "examples/topic_publisher.rb",
@@ -48,6 +58,7 @@ Gem::Specification.new do |s|
48
58
  "lib/stomp/errors.rb",
49
59
  "lib/stomp/ext/hash.rb",
50
60
  "lib/stomp/message.rb",
61
+ "lib/stomp/sslparams.rb",
51
62
  "lib/stomp/version.rb",
52
63
  "spec/client_shared_examples.rb",
53
64
  "spec/client_spec.rb",
@@ -61,14 +72,16 @@ Gem::Specification.new do |s|
61
72
  "test/test_connection1p.rb",
62
73
  "test/test_helper.rb",
63
74
  "test/test_message.rb",
75
+ "test/test_ssl.rb",
64
76
  "test/tlogger.rb"
65
77
  ]
66
- s.homepage = "https://github.com/morellon/stomp"
78
+ s.homepage = %q{https://github.com/morellon/stomp}
67
79
  s.require_paths = ["lib"]
68
- s.rubygems_version = "1.8.11"
69
- s.summary = "Ruby client for the Stomp messaging protocol"
80
+ s.rubygems_version = %q{1.3.7}
81
+ s.summary = %q{Ruby client for the Stomp messaging protocol}
70
82
 
71
83
  if s.respond_to? :specification_version then
84
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
72
85
  s.specification_version = 3
73
86
 
74
87
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -22,6 +22,13 @@ class TestConnection < Test::Unit::TestCase
22
22
  assert_not_nil @conn
23
23
  end
24
24
 
25
+ def test_poll_async
26
+ @conn.subscribe("/queue/do.not.put.messages.on.this.queue")
27
+ # If the test 'hangs' here, Connection#poll is broken.
28
+ m = @conn.poll
29
+ assert m.nil?
30
+ end
31
+
25
32
  def test_no_length
26
33
  conn_subscribe make_destination
27
34
  #
@@ -247,5 +247,13 @@ class TestConnection1P < Test::Unit::TestCase
247
247
  @conn.unsubscribe dest, :id => sid
248
248
  end
249
249
 
250
+ def test_conn_1p_0120
251
+ dest = make_destination
252
+ sid = @conn.uuid()
253
+ sid.freeze
254
+ assert_nothing_raised {
255
+ @conn.subscribe dest, :id => sid
256
+ }
257
+ end
250
258
  end if ENV['STOMP_TEST11']
251
259
 
data/test/test_helper.rb CHANGED
@@ -29,6 +29,10 @@ module TestBase
29
29
  def port
30
30
  (ENV['STOMP_PORT'] || 61613).to_i
31
31
  end
32
+ # Get SSL port
33
+ def ssl_port
34
+ (ENV['STOMP_SSLPORT'] || 61612).to_i
35
+ end
32
36
  # Helper for minitest on 1.9
33
37
  def caller_method_name
34
38
  parse_caller(caller(2).first).last
@@ -50,6 +54,17 @@ module TestBase
50
54
  conn
51
55
  end
52
56
 
57
+ def get_ssl_connection()
58
+ ch = get_conn_headers()
59
+ hash = { :hosts => [
60
+ {:login => user, :passcode => passcode, :host => host, :port => ssl_port, :ssl => true},
61
+ ],
62
+ :connect_headers => ch
63
+ }
64
+ conn = Stomp::Connection.new(hash)
65
+ conn
66
+ end
67
+
53
68
  def get_client()
54
69
  hash = { :hosts => [
55
70
  {:login => user, :passcode => passcode, :host => host, :port => port},
data/test/test_ssl.rb ADDED
@@ -0,0 +1,51 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ $:.unshift(File.dirname(__FILE__))
4
+
5
+ require 'test_helper'
6
+
7
+ class TestSSL < Test::Unit::TestCase
8
+ include TestBase
9
+
10
+ def setup
11
+ @conn = get_ssl_connection()
12
+ end
13
+
14
+ def teardown
15
+ @conn.disconnect if @conn.open? # allow tests to disconnect
16
+ end
17
+ #
18
+ def test_ssl_0000
19
+ assert @conn.open?
20
+ end
21
+
22
+ #
23
+ def test_ssl_0010
24
+ ssl_params = Stomp::SSLParams.new
25
+ assert ssl_params.ts_files.nil?
26
+ assert ssl_params.cert_file.nil?
27
+ assert ssl_params.key_file.nil?
28
+ end
29
+
30
+ #
31
+ def test_ssl_0020
32
+ assert_raise(Stomp::Error::SSLClientParamsError) {
33
+ ssl_parms = Stomp::SSLParams.new(:cert_file => "dummy1")
34
+ }
35
+ assert_raise(Stomp::Error::SSLClientParamsError) {
36
+ ssl_parms = Stomp::SSLParams.new(:key_file => "dummy2")
37
+ }
38
+ assert_nothing_raised {
39
+ ssl_parms = Stomp::SSLParams.new(:cert_file => "dummy1", :key_file => "dummy2")
40
+ }
41
+ assert_nothing_raised {
42
+ ssl_parms = Stomp::SSLParams.new(:ts_files => "dummyts1")
43
+ }
44
+ assert_nothing_raised {
45
+ ssl_parms = Stomp::SSLParams.new(:ts_files => "dummyts1", :cert_file => "dummy1", :key_file => "dummy2")
46
+ }
47
+ end
48
+
49
+ #
50
+ end if ENV['STOMP_TESTSSL']
51
+
metadata CHANGED
@@ -1,10 +1,15 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: stomp
3
- version: !ruby/object:Gem::Version
4
- version: 1.2.0
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 1
8
+ - 2
9
+ - 1
10
+ version: 1.2.1
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Brian McCallister
9
14
  - Marius Mathiesen
10
15
  - Thiago Morello
@@ -12,34 +17,40 @@ authors:
12
17
  autorequire:
13
18
  bindir: bin
14
19
  cert_chain: []
15
- date: 2011-12-15 00:00:00.000000000 Z
16
- dependencies:
17
- - !ruby/object:Gem::Dependency
20
+
21
+ date: 2012-03-13 00:00:00 -04:00
22
+ default_executable:
23
+ dependencies:
24
+ - !ruby/object:Gem::Dependency
18
25
  name: rspec
19
- requirement: &14851600 !ruby/object:Gem::Requirement
26
+ prerelease: false
27
+ requirement: &id001 !ruby/object:Gem::Requirement
20
28
  none: false
21
- requirements:
22
- - - ! '>='
23
- - !ruby/object:Gem::Version
24
- version: '2.3'
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ hash: 5
33
+ segments:
34
+ - 2
35
+ - 3
36
+ version: "2.3"
25
37
  type: :development
26
- prerelease: false
27
- version_requirements: *14851600
28
- description: Ruby client for the Stomp messaging protocol. Note that this gem is
29
- no longer supported on rubyforge.
30
- email:
38
+ version_requirements: *id001
39
+ description: Ruby client for the Stomp messaging protocol. Note that this gem is no longer supported on rubyforge.
40
+ email:
31
41
  - brianm@apache.org
32
42
  - marius@stones.com
33
43
  - morellon@gmail.com
34
44
  - allard.guy.m@gmail.com
35
- executables:
45
+ executables:
36
46
  - catstomp
37
47
  - stompcat
38
48
  extensions: []
39
- extra_rdoc_files:
49
+
50
+ extra_rdoc_files:
40
51
  - LICENSE
41
52
  - README.rdoc
42
- files:
53
+ files:
43
54
  - CHANGELOG.rdoc
44
55
  - LICENSE
45
56
  - README.rdoc
@@ -55,10 +66,20 @@ files:
55
66
  - examples/get11conn_ex1.rb
56
67
  - examples/get11conn_ex2.rb
57
68
  - examples/logexamp.rb
69
+ - examples/logexamp_ssl.rb
58
70
  - examples/publisher.rb
59
71
  - examples/put11conn_ex1.rb
60
72
  - examples/putget11_rh1.rb
61
73
  - examples/slogger.rb
74
+ - examples/ssl_uc1.rb
75
+ - examples/ssl_uc1_ciphers.rb
76
+ - examples/ssl_uc2.rb
77
+ - examples/ssl_uc2_ciphers.rb
78
+ - examples/ssl_uc3.rb
79
+ - examples/ssl_uc3_ciphers.rb
80
+ - examples/ssl_uc4.rb
81
+ - examples/ssl_uc4_ciphers.rb
82
+ - examples/ssl_ucx_default_ciphers.rb
62
83
  - examples/stomp11_common.rb
63
84
  - examples/topic_consumer.rb
64
85
  - examples/topic_publisher.rb
@@ -70,6 +91,7 @@ files:
70
91
  - lib/stomp/errors.rb
71
92
  - lib/stomp/ext/hash.rb
72
93
  - lib/stomp/message.rb
94
+ - lib/stomp/sslparams.rb
73
95
  - lib/stomp/version.rb
74
96
  - spec/client_shared_examples.rb
75
97
  - spec/client_spec.rb
@@ -83,29 +105,41 @@ files:
83
105
  - test/test_connection1p.rb
84
106
  - test/test_helper.rb
85
107
  - test/test_message.rb
108
+ - test/test_ssl.rb
86
109
  - test/tlogger.rb
110
+ has_rdoc: true
87
111
  homepage: https://github.com/morellon/stomp
88
112
  licenses: []
113
+
89
114
  post_install_message:
90
115
  rdoc_options: []
91
- require_paths:
116
+
117
+ require_paths:
92
118
  - lib
93
- required_ruby_version: !ruby/object:Gem::Requirement
119
+ required_ruby_version: !ruby/object:Gem::Requirement
94
120
  none: false
95
- requirements:
96
- - - ! '>='
97
- - !ruby/object:Gem::Version
98
- version: '0'
99
- required_rubygems_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ hash: 3
125
+ segments:
126
+ - 0
127
+ version: "0"
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
100
129
  none: false
101
- requirements:
102
- - - ! '>='
103
- - !ruby/object:Gem::Version
104
- version: '0'
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ hash: 3
134
+ segments:
135
+ - 0
136
+ version: "0"
105
137
  requirements: []
138
+
106
139
  rubyforge_project:
107
- rubygems_version: 1.8.11
140
+ rubygems_version: 1.3.7
108
141
  signing_key:
109
142
  specification_version: 3
110
143
  summary: Ruby client for the Stomp messaging protocol
111
144
  test_files: []
145
+