stomp 1.3.5 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/test/test_ssl.rb CHANGED
@@ -39,13 +39,13 @@ class TestSSL < Test::Unit::TestCase
39
39
  # Test using correct parameters.
40
40
  def test_ssl_0020_noraise
41
41
  assert_nothing_raised {
42
- ssl_parms = Stomp::SSLParams.new(:cert_file => "dummy1", :key_file => "dummy2")
42
+ _ = Stomp::SSLParams.new(:cert_file => "dummy1", :key_file => "dummy2")
43
43
  }
44
44
  assert_nothing_raised {
45
- ssl_parms = Stomp::SSLParams.new(:ts_files => "dummyts1")
45
+ _ = Stomp::SSLParams.new(:ts_files => "dummyts1")
46
46
  }
47
47
  assert_nothing_raised {
48
- ssl_parms = Stomp::SSLParams.new(:ts_files => "dummyts1",
48
+ _ = Stomp::SSLParams.new(:ts_files => "dummyts1",
49
49
  :cert_file => "dummy1", :key_file => "dummy2")
50
50
  }
51
51
  end
@@ -53,25 +53,25 @@ class TestSSL < Test::Unit::TestCase
53
53
  # Test using incorrect / incomplete parameters.
54
54
  def test_ssl_0030_raise
55
55
  assert_raise(Stomp::Error::SSLClientParamsError) {
56
- ssl_parms = Stomp::SSLParams.new(:cert_file => "dummy1")
56
+ _ = Stomp::SSLParams.new(:cert_file => "dummy1")
57
57
  }
58
58
  assert_raise(Stomp::Error::SSLClientParamsError) {
59
- ssl_parms = Stomp::SSLParams.new(:key_file => "dummy2")
59
+ _ = Stomp::SSLParams.new(:key_file => "dummy2")
60
60
  }
61
61
  end
62
62
 
63
63
  # Test that :fsck works.
64
64
  def test_ssl_0040_fsck
65
65
  assert_raise(Stomp::Error::SSLNoCertFileError) {
66
- ssl_parms = Stomp::SSLParams.new(:cert_file => "dummy1",
66
+ _ = Stomp::SSLParams.new(:cert_file => "dummy1",
67
67
  :key_file => "dummy2", :fsck => true)
68
68
  }
69
69
  assert_raise(Stomp::Error::SSLNoKeyFileError) {
70
- ssl_parms = Stomp::SSLParams.new(:cert_file => __FILE__,
70
+ _ = Stomp::SSLParams.new(:cert_file => __FILE__,
71
71
  :key_file => "dummy2", :fsck => true)
72
72
  }
73
73
  assert_raise(Stomp::Error::SSLNoTruststoreFileError) {
74
- ssl_parms = Stomp::SSLParams.new(:ts_files => "/tmp/not-likely-here.txt",
74
+ _ = Stomp::SSLParams.new(:ts_files => "/tmp/not-likely-here.txt",
75
75
  :fsck => true)
76
76
  }
77
77
  end
data/test/test_urlogin.rb CHANGED
@@ -14,12 +14,12 @@ end
14
14
  =end
15
15
  class TestURLLogins < Test::Unit::TestCase
16
16
  include TestBase
17
-
17
+
18
18
  def setup
19
19
  hostname = host()
20
20
  portnum = port()
21
21
  sslpn = ssl_port()
22
- @tdstomp = [
22
+ @tdstomp = [
23
23
  "stomp://guestl:guestp@#{hostname}:#{portnum}",
24
24
  "stomp://#{hostname}:#{portnum}",
25
25
  "stomp://@#{hostname}:#{portnum}",
@@ -32,10 +32,10 @@ class TestURLLogins < Test::Unit::TestCase
32
32
  "failover://(stomp://#{hostname}:#{portnum})?whatup=doc&coyote=kaboom",
33
33
  "failover://(stomp://#{hostname}:#{portnum})?whatup=doc",
34
34
  "failover://(stomp://#{hostname}:#{portnum})?whatup=doc&coyote=kaboom&randomize=true",
35
- 'failover://(stomp://f@#$$%^&*()_+=o.o::b~!@#$%^&*()+-_=?:<>,.@@' + "localhost" + ":#{portnum}" + ")",
36
- 'failover://(stomp://f@#$$%^&*()_+=o.o::b~!@#$%^&*()+-_=:<>,.@@' + "localhost" + ":#{portnum}" + ")",
37
- 'failover://(stomp://f@#$$%^&*()_+=o.o::b~!@#$%^&*()+-_=?:<>,.@@' + "localhost" + ":#{portnum}" + ")?a=b",
38
- 'failover://(stomp://f@#$$%^&*()_+=o.o::b~!@#$%^&*()+-_=:<>,.@@' + "localhost" + ":#{portnum}" + ")?c=d&e=f",
35
+ 'failover://(stomp://f@#$$%^&*()_+=o.o::b~!@#$%^&*()+-_=?:<>,.@@' + "#{hostname}" + ":#{portnum}" + ")",
36
+ 'failover://(stomp://f@#$$%^&*()_+=o.o::b~!@#$%^&*()+-_=:<>,.@@' + "#{hostname}" + ":#{portnum}" + ")",
37
+ 'failover://(stomp://f@#$$%^&*()_+=o.o::b~!@#$%^&*()+-_=?:<>,.@@' + "#{hostname}" + ":#{portnum}" + ")?a=b",
38
+ 'failover://(stomp://f@#$$%^&*()_+=o.o::b~!@#$%^&*()+-_=:<>,.@@' + "#{hostname}" + ":#{portnum}" + ")?c=d&e=f",
39
39
  "failover://(stomp://usera:passa@#{hostname}:#{portnum})",
40
40
  "failover://(stomp://usera:@#{hostname}:#{portnum})",
41
41
  "failover://(stomp://#{hostname}:#{portnum},stomp://#{hostname}:#{portnum})",
@@ -43,12 +43,17 @@ class TestURLLogins < Test::Unit::TestCase
43
43
  "failover://(stomp://usera:@#{hostname}:#{portnum},stomp://#{hostname}:#{portnum})",
44
44
  "failover://(stomp://#{hostname}:#{portnum},stomp://#{hostname}:#{portnum})?a=b&c=d",
45
45
  "failover://(stomp://#{hostname}:#{portnum},stomp://#{hostname}:#{portnum})?a=b&c=d&connect_timeout=2020",
46
+ ]
47
+
48
+ @sslfailover = [
46
49
  "failover://(stomp+ssl://#{hostname}:#{sslpn})",
47
50
  "failover://(stomp+ssl://usera:passa@#{hostname}:#{sslpn})",
48
51
  "failover://(stomp://usera:@#{hostname}:#{portnum},stomp+ssl://#{hostname}:#{sslpn})",
49
52
  ]
50
53
 
51
54
  @badparms = "failover://(stomp://#{hostname}:#{portnum})?a=b&noequal"
55
+
56
+ @client = nil
52
57
  end
53
58
 
54
59
  def teardown
@@ -65,9 +70,21 @@ class TestURLLogins < Test::Unit::TestCase
65
70
  end
66
71
  end
67
72
 
68
- # test failover:// urls
69
- def test_0020_failover_urls()
73
+ # test failover:// urls - tcp
74
+ def test_0020_failover_urls_tcp()
70
75
  @tdfailover.each_with_index do |url, ndx|
76
+ # p [ "xurl", url, "xndx", ndx ]
77
+ c = Stomp::Client.new(url)
78
+ assert !c.nil?, url
79
+ assert c.open?, url
80
+ c.close
81
+ end
82
+ end
83
+
84
+ # test failover:// urls - ssl
85
+ def test_0020_failover_urls_ssl()
86
+ @sslfailover.each_with_index do |url, ndx|
87
+ # p [ "sslxurl", url, "sslxndx", ndx ]
71
88
  c = Stomp::Client.new(url)
72
89
  assert !c.nil?, url
73
90
  assert c.open?, url
@@ -78,9 +95,8 @@ class TestURLLogins < Test::Unit::TestCase
78
95
  # test failover:// with bad parameters
79
96
  def test_0020_failover_badparms()
80
97
  assert_raise(Stomp::Error::MalformedFailoverOptionsError) {
81
- c = Stomp::Client.new(@badparms)
98
+ _ = Stomp::Client.new(@badparms)
82
99
  }
83
100
  end
84
101
 
85
102
  end unless ENV['STOMP_RABBIT']
86
-
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stomp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 3
9
- - 5
10
- version: 1.3.5
8
+ - 4
9
+ - 0
10
+ version: 1.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian McCallister
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2016-03-02 00:00:00 -05:00
21
+ date: 2016-06-08 00:00:00 -04:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
@@ -44,75 +44,27 @@ email:
44
44
  - morellon@gmail.com
45
45
  - allard.guy.m@gmail.com
46
46
  executables:
47
- - catstomp
48
47
  - stompcat
48
+ - catstomp
49
49
  extensions: []
50
50
 
51
51
  extra_rdoc_files:
52
- - CHANGELOG.rdoc
53
52
  - LICENSE
54
- - README.rdoc
55
- - examples/amqdurasub.rb
56
- - examples/client11_ex1.rb
57
- - examples/client11_putget1.rb
58
- - examples/conn11_ex1.rb
59
- - examples/conn11_ex2.rb
60
- - examples/conn11_hb1.rb
61
- - examples/consumer.rb
62
- - examples/examplogger.rb
63
- - examples/get11conn_ex1.rb
64
- - examples/get11conn_ex2.rb
65
- - examples/logexamp.rb
66
- - examples/logexamp_ssl.rb
67
- - examples/publisher.rb
68
- - examples/put11conn_ex1.rb
69
- - examples/putget11_rh1.rb
70
- - examples/ssl_ctxoptions.rb
71
- - examples/ssl_newparm.rb
72
- - examples/ssl_uc1.rb
73
- - examples/ssl_uc1_ciphers.rb
74
- - examples/ssl_uc2.rb
75
- - examples/ssl_uc2_ciphers.rb
76
- - examples/ssl_uc3.rb
77
- - examples/ssl_uc3_ciphers.rb
78
- - examples/ssl_uc4.rb
79
- - examples/ssl_uc4_ciphers.rb
80
- - examples/ssl_ucx_default_ciphers.rb
81
- - examples/stomp11_common.rb
82
- - examples/topic_consumer.rb
83
- - examples/topic_publisher.rb
84
- - lib/client/utils.rb
85
- - lib/connection/heartbeats.rb
86
- - lib/connection/netio.rb
87
- - lib/connection/utf8.rb
88
- - lib/connection/utils.rb
89
- - lib/stomp.rb
90
- - lib/stomp/client.rb
91
- - lib/stomp/codec.rb
92
- - lib/stomp/connection.rb
93
- - lib/stomp/constants.rb
94
- - lib/stomp/errors.rb
95
- - lib/stomp/ext/hash.rb
96
- - lib/stomp/message.rb
97
- - lib/stomp/null_logger.rb
98
- - lib/stomp/slogger.rb
99
- - lib/stomp/sslparams.rb
100
- - lib/stomp/version.rb
101
- - test/test_anonymous.rb
102
- - test/test_client.rb
103
- - test/test_codec.rb
104
- - test/test_connection.rb
105
- - test/test_connection1p.rb
106
- - test/test_helper.rb
107
- - test/test_message.rb
108
- - test/test_ssl.rb
109
- - test/test_urlogin.rb
110
- - test/tlogger.rb
53
+ - README.md
111
54
  files:
112
- - CHANGELOG.rdoc
55
+ - CHANGELOG.md
113
56
  - LICENSE
114
- - README.rdoc
57
+ - README.md
115
58
  - Rakefile
59
+ - adhoc/.gitignore
60
+ - adhoc/README.md
61
+ - adhoc/issue121_01.rb
62
+ - adhoc/issue121_01_conn.rb
63
+ - adhoc/issue121_02.rb
64
+ - adhoc/issue121_03.rb
65
+ - adhoc/payload_generator.rb
66
+ - adhoc/payload_generator_adhoctest.rb
67
+ - adhoc/stomp_adhoc_common.rb
116
68
  - bin/catstomp
117
69
  - bin/stompcat
118
70
  - examples/amqdurasub.rb
@@ -121,12 +73,18 @@ files:
121
73
  - examples/conn11_ex1.rb
122
74
  - examples/conn11_ex2.rb
123
75
  - examples/conn11_hb1.rb
76
+ - examples/consume_file.rb
124
77
  - examples/consumer.rb
78
+ - examples/contrib.sh
79
+ - examples/contributors.rb
125
80
  - examples/examplogger.rb
126
81
  - examples/get11conn_ex1.rb
127
82
  - examples/get11conn_ex2.rb
83
+ - examples/lflogger.rb
128
84
  - examples/logexamp.rb
129
85
  - examples/logexamp_ssl.rb
86
+ - examples/publish_file.rb
87
+ - examples/publish_file_conn.rb
130
88
  - examples/publisher.rb
131
89
  - examples/put11conn_ex1.rb
132
90
  - examples/putget11_rh1.rb
@@ -168,6 +126,7 @@ files:
168
126
  - spec/message_spec.rb
169
127
  - spec/spec_helper.rb
170
128
  - stomp.gemspec
129
+ - test/.gitignore
171
130
  - test/test_anonymous.rb
172
131
  - test/test_client.rb
173
132
  - test/test_codec.rb
@@ -181,7 +140,7 @@ files:
181
140
  has_rdoc: true
182
141
  homepage: https://github.com/stompgem/stomp
183
142
  licenses:
184
- - Apache 2.0
143
+ - Apache-2.0
185
144
  post_install_message:
186
145
  rdoc_options: []
187
146
 
data/README.rdoc DELETED
@@ -1,163 +0,0 @@
1
- ==README
2
-
3
- * (https://github.com/stompgem/stomp/)
4
-
5
- ===Overview
6
-
7
- An implementation of the Stomp protocol for Ruby. See:
8
-
9
- * [STOMP 1.0, 1.1, and 1.2] (http://stomp.github.com/index.html)
10
-
11
- ===Hash Login Example Usage (this is the recommended login technique)
12
-
13
- hash = {
14
- :hosts => [
15
- # First connect is to remotehost1
16
- {:login => "login1", :passcode => "passcode1", :host => "remotehost1", :port => 61612, :ssl => true},
17
- # First failover connect is to remotehost2
18
- {:login => "login2", :passcode => "passcode2", :host => "remotehost2", :port => 61613, :ssl => false},
19
-
20
- ],
21
- # These are the default parameters and do not need to be set
22
- :reliable => true, # reliable (use failover)
23
- :initial_reconnect_delay => 0.01, # initial delay before reconnect (secs)
24
- :max_reconnect_delay => 30.0, # max delay before reconnect
25
- :use_exponential_back_off => true, # increase delay between reconnect attpempts
26
- :back_off_multiplier => 2, # next delay multiplier
27
- :max_reconnect_attempts => 0, # retry forever, use # for maximum attempts
28
- :randomize => false, # do not radomize hosts hash before reconnect
29
- :connect_timeout => 0, # Timeout for TCP/TLS connects, use # for max seconds
30
- :connect_headers => {}, # user supplied CONNECT headers (req'd for Stomp 1.1+)
31
- :parse_timeout => 5, # receive / read timeout, secs
32
- :logger => nil, # user suplied callback logger instance
33
- :dmh => false, # do not support multihomed IPV4 / IPV6 hosts during failover
34
- :closed_check => true, # check first if closed in each protocol method
35
- :hbser => false, # raise on heartbeat send exception
36
- :stompconn => false, # Use STOMP instead of CONNECT
37
- :usecrlf => false, # Use CRLF command and header line ends (1.2+)
38
- :max_hbread_fails => 0, # Max HB read fails before retry. 0 => never retry
39
- :max_hbrlck_fails => 0, # Max HB read lock obtain fails before retry. 0 => never retry
40
- :fast_hbs_adjust => 0.0, # Fast heartbeat senders sleep adjustment, seconds, needed ...
41
- # For fast heartbeat senders. 'fast' == YMMV. If not
42
- # correct for your environment, expect unnecessary fail overs
43
- :connread_timeout => 0, # Timeout during CONNECT for read of CONNECTED/ERROR, secs
44
- :tcp_nodelay => true, # Turns on the TCP_NODELAY socket option; disables Nagle's algorithm
45
- :start_timeout => 0, # Timeout around Stomp::Client initialization
46
- :sslctx_newparm => nil, # Param for SSLContext.new
47
- }
48
-
49
- # for client
50
- client = Stomp::Client.new(hash)
51
-
52
- # for connection
53
- connection = Stomp::Connection.new(hash)
54
-
55
- ===Positional Parameter Usage
56
-
57
- client = Stomp::Client.new("user", "pass", "localhost", 61613)
58
- client.publish("/queue/mine", "hello world!")
59
- client.subscribe("/queue/mine") do |msg|
60
- p msg
61
- end
62
-
63
- ===Stomp URL Usage
64
-
65
- # Stomp URL :
66
- A Stomp URL must begin with 'stomp://' and can be in one of the following forms:
67
-
68
- stomp://host:port
69
- stomp://host.domain.tld:port
70
- stomp://login:passcode@host:port
71
- stomp://login:passcode@host.domain.tld:port
72
-
73
- e.g. c = Stomp::Client.new(urlstring)
74
-
75
- ===Failover + SSL Example URL Usage
76
-
77
- options = "initialReconnectDelay=5000&randomize=false&useExponentialBackOff=false"
78
-
79
- # remotehost1 uses SSL, remotehost2 doesn't
80
- client = Stomp::Client.new("failover:(stomp+ssl://login1:passcode1@remotehost1:61612,stomp://login2:passcode2@remotehost2:61613)?#{options}")
81
-
82
- client.publish("/queue/mine", "hello world!")
83
- client.subscribe("/queue/mine") do |msg|
84
- p msg
85
- end
86
-
87
- ===New
88
-
89
- See _CHANGELOG.rdoc_ for details.
90
-
91
- * Gem version 1.3.5. Miscellaneous fixes, see CHANGELOG.rdoc for details.
92
- * Gem version 1.3.4. Miscellaneous fixes, see CHANGELOG.rdoc for details.
93
- * Gem version 1.3.3. Miscellaneous fixes, see CHANGELOG.rdoc for details.
94
- * Gem version 1.3.2. Miscellaneous fixes, see changelog for details.
95
- * Gem version 1.3.1. Bugfix for logging.
96
- * Gem version 1.3.0. Added ERROR frame raising as exception, added anonymous connections, miscellaneous other fixes.
97
- * Gem version 1.2.16. Fixed Stomp::Client to expose its connection's host parameters.
98
- * Gem version 1.2.15. Timeout cleanup, added license info to gemspec.
99
- * Gem version 1.2.14. Cleanup.
100
- * Gem version 1.2.13. Stomp::Client#unreceive max_redeliveries fix.
101
- * Gem version 1.2.12. Miscellaneous issue fixes and cleanup.
102
- * Gem version 1.2.11. JRuby and AMQ support fixes.
103
- * Gem version 1.2.10. Support failover from heartbeat threads.
104
- * Gem version 1.2.9. Miscellaneous fixes and changes.
105
- * Gem version 1.2.8. Stomp 1.1+ header codec inversion fix, test refactoring.
106
- * Gem version 1.2.7. Stomp 1.2 support and miscellaneous fixes.
107
- * Gem version 1.2.6. Miscellaneous fixes and changes.
108
- * Gem version 1.2.5. Restructure. Forks with modifcations will be affected.
109
- * Gem version 1.2.4. Stomp 1.1 heartbeat fix, autoflush capability, miscellaneous fixes.
110
- * Gem version 1.2.3. Miscellaneous fixes, see changelog for details.
111
- * Gem version 1.2.2. Performance and more SSL enhancements.
112
- * Gem version 1.2.1. Full support of SSL certificates.
113
- * Gem version 1.2.0. Support of Stomp protocol level 1.1.
114
-
115
- ===Historical Information
116
-
117
- Up until March 2009 the project was maintained and primarily developed by Brian McCallister.
118
-
119
- ===Source Code and Project URLs
120
-
121
- https://github.com/stompgem/stomp/
122
-
123
- ===Stomp Protocol Information :
124
-
125
- http://stomp.github.com/index.html
126
-
127
- = Contributors
128
-
129
- The following people have contributed to Stomp:
130
-
131
- * Brian McCallister
132
- * Glenn Rempe <glenn@rempe.us>
133
- * jstrachan
134
- * Marius Mathiesen <marius.mathiesen@gmail.com>
135
- * Johan S√∏rensen <johan@johansorensen.com>
136
- * Thiago Morello
137
- * Guy M. Allard <stompgem@gmail.com>
138
- * kookster
139
- * Tony Garnock-Jones <tonyg@lshift.net>
140
- * chirino
141
- * Stefan Saasen
142
- * Neil Wilson
143
- * Dinesh Majrekar
144
- * Kiall Mac Innes
145
- * Rob Skaggs
146
- * Tom May
147
- * Lucas Hills
148
- * Chris Needham
149
- * R.I. Pienaar
150
- * tworker
151
- * James Pearson
152
- * Craig
153
- * Tommy Bishop
154
- * Jeremy Gailor
155
- * JP Hastings-Spital
156
- * Glenn Roberts
157
- * Ian Smith
158
- * Orazio Cotroneo
159
- * m4rCsi
160
- * Michael Klishin
161
- * Patrick Sharp
162
- * Wayne Robinson
163
-