torquebox-messaging 2.0.3-java → 2.1.0-java

Sign up to get free protection for your applications and to get access to all the features.
Binary file
@@ -1,14 +1,14 @@
1
1
  module TorqueboxMessaging
2
- VERSION = '2.0.3'
3
- MAVEN_VERSION = '2.0.3'
2
+ VERSION = '2.1.0'
3
+ MAVEN_VERSION = '2.1.0'
4
4
  end
5
5
  begin
6
6
  require 'java'
7
7
  require File.dirname(__FILE__) + '/torquebox-messaging.jar'
8
- require File.dirname(__FILE__) + '/jboss-jms-api_1.1_spec-1.0.0.Final.jar'
9
- require File.dirname(__FILE__) + '/jboss-transaction-api_1.1_spec-1.0.0.Final.jar'
10
- require File.dirname(__FILE__) + '/hornetq-core-2.2.13.Final.jar'
11
- require File.dirname(__FILE__) + '/hornetq-jms-2.2.13.Final.jar'
8
+ require File.dirname(__FILE__) + '/jboss-jms-api_1.1_spec-1.0.1.Final.jar'
9
+ require File.dirname(__FILE__) + '/jboss-transaction-api_1.1_spec-1.0.1.Final.jar'
10
+ require File.dirname(__FILE__) + '/hornetq-core-2.2.18.Final.jar'
11
+ require File.dirname(__FILE__) + '/hornetq-jms-2.2.18.Final.jar'
12
12
  require File.dirname(__FILE__) + '/netty-3.2.6.Final.jar'
13
13
  rescue LoadError
14
14
  puts 'JAR-based gems require JRuby to load. Please visit www.jruby.org.'
@@ -25,7 +25,7 @@ module TorqueBox
25
25
 
26
26
  def initialize(jms_connection)
27
27
  @jms_connection = jms_connection
28
- @tm = inject('transaction-manager')
28
+ @tm = fetch('transaction-manager')
29
29
  end
30
30
 
31
31
  def start
@@ -48,9 +48,10 @@ module TorqueBox
48
48
  end
49
49
 
50
50
  def initialize(destination, connection_factory_or_options = nil)
51
+ raise ArgumentError, "destination cannot be nil" unless destination
51
52
  if connection_factory_or_options.nil? || connection_factory_or_options.is_a?( Hash )
52
53
  options = connection_factory_or_options
53
- connection_factory = __inject__( 'connection-factory' )
54
+ connection_factory = fetch( 'connection-factory' )
54
55
  unless options.nil?
55
56
  # Don't use our internal connection factory if the user
56
57
  # has specified a host or port to connect to
@@ -76,6 +76,10 @@ module TorqueBox
76
76
  @jms_message.send(*args)
77
77
  end
78
78
 
79
+ def respond_to?(symbol, include_private = false)
80
+ super || @jms_message.respond_to?(symbol, include_private)
81
+ end
82
+
79
83
  class << self
80
84
  alias :__new__ :new
81
85
 
@@ -106,6 +106,15 @@ describe TorqueBox::Messaging::Destination do
106
106
  Mockito.verify(server).destroyTopic("my_topic")
107
107
  end
108
108
 
109
+ it "should raise ArgumentError if destination is nil" do
110
+ lambda {
111
+ TorqueBox::Messaging::Queue.new( nil )
112
+ }.should raise_error( ArgumentError )
113
+ lambda {
114
+ TorqueBox::Messaging::Topic.new( nil )
115
+ }.should raise_error( ArgumentError )
116
+ end
117
+
109
118
  describe "publish" do
110
119
  before(:each) do
111
120
  @session = mock('session')
data/spec/message_spec.rb CHANGED
@@ -111,4 +111,25 @@ describe TorqueBox::Messaging::Message do
111
111
  end
112
112
  end
113
113
 
114
+ describe 'delegating to jms_message' do
115
+ before(:each) do
116
+ @jms_msg = mock_message
117
+ @message = Message.new(@jms_msg)
118
+ end
119
+
120
+ it "should pass any missing calls through" do
121
+ @jms_msg.should_receive(:ham).with(:biscuit)
122
+ @message.ham(:biscuit)
123
+ end
124
+
125
+ it "should properly report if the jms_message responds to the method" do
126
+ @jms_msg.should_receive(:ham).never
127
+ @message.respond_to?(:ham).should be_true
128
+ end
129
+
130
+ it "should properly report if the jms_message does not respond to the method" do
131
+ @message.respond_to?(:ham).should_not be_true
132
+ end
133
+ end
134
+
114
135
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: torquebox-messaging
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.0.3
5
+ version: 2.1.0
6
6
  platform: java
7
7
  authors:
8
8
  - The TorqueBox Team
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-05-04 00:00:00 Z
13
+ date: 2012-07-26 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: torquebox-core
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 2.0.3
23
+ version: 2.1.0
24
24
  type: :runtime
25
25
  version_requirements: *id001
26
26
  - !ruby/object:Gem::Dependency
@@ -31,7 +31,7 @@ dependencies:
31
31
  requirements:
32
32
  - - "="
33
33
  - !ruby/object:Gem::Version
34
- version: 2.0.3
34
+ version: 2.1.0
35
35
  type: :runtime
36
36
  version_requirements: *id002
37
37
  - !ruby/object:Gem::Dependency
@@ -80,50 +80,50 @@ files:
80
80
  - licenses/lgpl-2.1.txt
81
81
  - lib/torquebox-messaging.jar
82
82
  - lib/torquebox-messaging.rb
83
- - lib/jboss-jms-api_1.1_spec-1.0.0.Final.jar
84
- - lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar
85
- - lib/hornetq-core-2.2.13.Final.jar
86
- - lib/hornetq-jms-2.2.13.Final.jar
83
+ - lib/jboss-jms-api_1.1_spec-1.0.1.Final.jar
84
+ - lib/jboss-transaction-api_1.1_spec-1.0.1.Final.jar
85
+ - lib/hornetq-core-2.2.18.Final.jar
86
+ - lib/hornetq-jms-2.2.18.Final.jar
87
87
  - lib/netty-3.2.6.Final.jar
88
88
  - lib/gem_hook.rb
89
89
  - lib/org.torquebox.messaging-client.rb
90
90
  - lib/torquebox/messaging.rb
91
+ - lib/torquebox/messaging/clojure_message.rb
92
+ - lib/torquebox/messaging/connection.rb
93
+ - lib/torquebox/messaging/processor_wrapper.rb
94
+ - lib/torquebox/messaging/destination.rb
95
+ - lib/torquebox/messaging/session.rb
91
96
  - lib/torquebox/messaging/connection_factory.rb
92
- - lib/torquebox/messaging/future_status.rb
97
+ - lib/torquebox/messaging/core.rb
93
98
  - lib/torquebox/messaging/xa_session.rb
94
- - lib/torquebox/messaging/topic.rb
95
99
  - lib/torquebox/messaging/message_processor.rb
96
- - lib/torquebox/messaging/backgroundable.rb
97
- - lib/torquebox/messaging/destination.rb
98
- - lib/torquebox/messaging/backgroundable_processor.rb
99
100
  - lib/torquebox/messaging/marshal_message.rb
101
+ - lib/torquebox/messaging/future.rb
102
+ - lib/torquebox/messaging/topic.rb
103
+ - lib/torquebox/messaging/backgroundable_processor.rb
104
+ - lib/torquebox/messaging/queue.rb
100
105
  - lib/torquebox/messaging/xa_connection_factory.rb
101
106
  - lib/torquebox/messaging/future_responder.rb
102
- - lib/torquebox/messaging/connection.rb
103
- - lib/torquebox/messaging/xa_connection.rb
104
- - lib/torquebox/messaging/core.rb
105
- - lib/torquebox/messaging/marshal_base64_message.rb
107
+ - lib/torquebox/messaging/text_message.rb
106
108
  - lib/torquebox/messaging/message.rb
107
109
  - lib/torquebox/messaging/task.rb
108
- - lib/torquebox/messaging/datamapper_marshaling.rb
109
- - lib/torquebox/messaging/queue.rb
110
- - lib/torquebox/messaging/clojure_message.rb
111
- - lib/torquebox/messaging/text_message.rb
112
- - lib/torquebox/messaging/processor_wrapper.rb
113
110
  - lib/torquebox/messaging/json_message.rb
111
+ - lib/torquebox/messaging/backgroundable.rb
114
112
  - lib/torquebox/messaging/const_missing.rb
115
- - lib/torquebox/messaging/session.rb
116
- - lib/torquebox/messaging/future.rb
113
+ - lib/torquebox/messaging/datamapper_marshaling.rb
114
+ - lib/torquebox/messaging/future_status.rb
115
+ - lib/torquebox/messaging/xa_connection.rb
116
+ - lib/torquebox/messaging/marshal_base64_message.rb
117
117
  - lib/torquebox/messaging/ext/javax_jms_queue_browser.rb
118
- - spec/future_responder_spec.rb
119
- - spec/destination_spec.rb
118
+ - spec/task_spec.rb
119
+ - spec/datamapper_marshaling_spec.rb
120
+ - spec/future_spec.rb
121
+ - spec/json_message_spec.rb
120
122
  - spec/message_processor_spec.rb
123
+ - spec/future_responder_spec.rb
121
124
  - spec/backgroundable_spec.rb
122
- - spec/future_spec.rb
123
- - spec/task_spec.rb
124
125
  - spec/message_spec.rb
125
- - spec/json_message_spec.rb
126
- - spec/datamapper_marshaling_spec.rb
126
+ - spec/destination_spec.rb
127
127
  homepage: http://torquebox.org/
128
128
  licenses:
129
129
  - lgpl
@@ -152,12 +152,12 @@ signing_key:
152
152
  specification_version: 3
153
153
  summary: TorqueBox Messaging Client
154
154
  test_files:
155
- - spec/future_responder_spec.rb
156
- - spec/destination_spec.rb
155
+ - spec/task_spec.rb
156
+ - spec/datamapper_marshaling_spec.rb
157
+ - spec/future_spec.rb
158
+ - spec/json_message_spec.rb
157
159
  - spec/message_processor_spec.rb
160
+ - spec/future_responder_spec.rb
158
161
  - spec/backgroundable_spec.rb
159
- - spec/future_spec.rb
160
- - spec/task_spec.rb
161
162
  - spec/message_spec.rb
162
- - spec/json_message_spec.rb
163
- - spec/datamapper_marshaling_spec.rb
163
+ - spec/destination_spec.rb