torquebox-messaging 2.3.2-java → 3.0.0.beta1-java
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/hornetq-commons-2.3.0.CR1.jar +0 -0
- data/lib/hornetq-core-client-2.3.0.CR1.jar +0 -0
- data/lib/hornetq-jms-client-2.3.0.CR1.jar +0 -0
- data/lib/hornetq-journal-2.3.0.CR1.jar +0 -0
- data/lib/jboss-logging-3.1.2.GA.jar +0 -0
- data/lib/jboss-logmanager-1.4.0.Final.jar +0 -0
- data/lib/netty-3.6.2.Final.jar +0 -0
- data/lib/torquebox/messaging/backgroundable.rb +16 -8
- data/lib/torquebox/messaging/backgroundable_processor.rb +2 -1
- data/lib/torquebox/messaging/connection.rb +21 -74
- data/lib/torquebox/messaging/connection_factory.rb +52 -13
- data/lib/torquebox/messaging/datamapper_marshaling.rb +1 -0
- data/lib/torquebox/messaging/destination.rb +77 -8
- data/lib/torquebox/messaging/echo_processor.rb +1 -0
- data/lib/torquebox/messaging/edn_message.rb +0 -11
- data/lib/torquebox/messaging/future_responder.rb +2 -2
- data/lib/torquebox/messaging/json_message.rb +0 -24
- data/lib/torquebox/messaging/marshal_base64_message.rb +0 -18
- data/lib/torquebox/messaging/marshal_message.rb +4 -5
- data/lib/torquebox/messaging/message.rb +10 -0
- data/lib/torquebox/messaging/message_processor.rb +162 -3
- data/lib/torquebox/messaging/processor_middleware/chain.rb +1 -0
- data/lib/torquebox/messaging/processor_middleware/default_middleware.rb +1 -0
- data/lib/torquebox/messaging/processor_middleware/with_transaction.rb +1 -0
- data/lib/torquebox/messaging/queue.rb +210 -41
- data/lib/torquebox/messaging/session.rb +4 -8
- data/lib/torquebox/messaging/task.rb +8 -6
- data/lib/torquebox/messaging/topic.rb +23 -11
- data/lib/torquebox/messaging/xa_connection.rb +22 -25
- data/lib/torquebox/messaging/xa_connection_factory.rb +2 -17
- data/lib/torquebox/messaging/xa_session.rb +21 -0
- data/lib/torquebox-messaging.jar +0 -0
- data/lib/torquebox-messaging.rb +9 -5
- data/licenses/cc0-1.0.txt +121 -0
- data/spec/backgroundable_spec.rb +21 -0
- data/spec/destination_spec.rb +81 -14
- data/spec/message_processor_spec.rb +151 -1
- data/spec/task_spec.rb +8 -1
- metadata +51 -65
- data/lib/hornetq-core-2.2.21.Final.jar +0 -0
- data/lib/hornetq-jms-2.2.21.Final.jar +0 -0
- data/lib/netty-3.2.6.Final.jar +0 -0
- data/licenses/lgpl-2.1.txt +0 -502
- data/spec/json_message_spec.rb +0 -50
data/spec/json_message_spec.rb
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'torquebox/messaging/message'
|
2
|
-
require 'torquebox/messaging/json_message'
|
3
|
-
|
4
|
-
include TorqueBox::Messaging
|
5
|
-
|
6
|
-
class MockMessage
|
7
|
-
include javax.jms::Message
|
8
|
-
|
9
|
-
attr_accessor :text
|
10
|
-
def get_string_property(_)
|
11
|
-
"json"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def define_JSON
|
16
|
-
klass = Class.new {
|
17
|
-
def self.fast_generate(_)
|
18
|
-
end
|
19
|
-
}
|
20
|
-
Object.const_set(:JSON, klass)
|
21
|
-
end
|
22
|
-
|
23
|
-
|
24
|
-
describe TorqueBox::Messaging::JSONMessage do
|
25
|
-
before(:each) do
|
26
|
-
@message = Message.new( MockMessage.new )
|
27
|
-
end
|
28
|
-
|
29
|
-
after(:each) do
|
30
|
-
Object.send(:remove_const, :JSON) if defined?(JSON)
|
31
|
-
end
|
32
|
-
|
33
|
-
context "requiring json" do
|
34
|
-
it "should raise if json isn't available" do
|
35
|
-
@message.should_receive(:require).with('json').and_raise(LoadError.new)
|
36
|
-
lambda { @message.encode( 'abc' ) }.should raise_error( RuntimeError )
|
37
|
-
end
|
38
|
-
|
39
|
-
it "should not raise if json is available" do
|
40
|
-
@message.should_receive(:require).with('json').and_return { define_JSON }
|
41
|
-
lambda { @message.encode( 'abc' ) }.should_not raise_error
|
42
|
-
end
|
43
|
-
|
44
|
-
it "should only require json once" do
|
45
|
-
@message.should_receive(:require).once.with('json').and_return { define_JSON }
|
46
|
-
@message.encode( 'abc' )
|
47
|
-
@message.encode( 'abc' )
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|