torquebox-messaging 1.0.0.CR1-java

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.
Files changed (51) hide show
  1. data/lib/acl-spi-3.0.0.CR2.jar +0 -0
  2. data/lib/activation-1.1.jar +0 -0
  3. data/lib/authorization-spi-3.0.0.CR2.jar +0 -0
  4. data/lib/dtdparser-1.21.jar +0 -0
  5. data/lib/gem_hook.rb +22 -0
  6. data/lib/hornetq-core-2.1.2.Final.jar +0 -0
  7. data/lib/hornetq-jms-client-2.1.2.Final.jar +0 -0
  8. data/lib/hornetq-logging-2.1.2.Final.jar +0 -0
  9. data/lib/identity-spi-3.0.0.CR2.jar +0 -0
  10. data/lib/jaxb-api-2.1.9.jar +0 -0
  11. data/lib/jboss-common-core-2.2.17.GA.jar +0 -0
  12. data/lib/jboss-jms-api_1.1_spec-1.0.0.Final.jar +0 -0
  13. data/lib/jboss-logging-3.0.0.Beta4.jar +0 -0
  14. data/lib/jboss-reflect-2.2.0.GA.jar +0 -0
  15. data/lib/jbosssx-bare-3.0.0.CR2.jar +0 -0
  16. data/lib/jbossxacml-2.0.5.CR1.jar +0 -0
  17. data/lib/jbossxb-2.0.3.GA.jar +0 -0
  18. data/lib/jnp-client-5.0.5.Final.jar +0 -0
  19. data/lib/jruby-complete-1.6.1.jar +0 -0
  20. data/lib/netty-3.2.1.Final.jar +0 -0
  21. data/lib/org.torquebox.messaging-client.rb +20 -0
  22. data/lib/picketbox-acl-impl-3.0.0.CR2.jar +0 -0
  23. data/lib/picketbox-bare-3.0.0.CR2.jar +0 -0
  24. data/lib/picketbox-identity-impl-3.0.0.CR2.jar +0 -0
  25. data/lib/picketbox-spi-bare-3.0.0.CR2.jar +0 -0
  26. data/lib/torquebox/messaging/backgroundable.rb +134 -0
  27. data/lib/torquebox/messaging/client.rb +74 -0
  28. data/lib/torquebox/messaging/destination.rb +173 -0
  29. data/lib/torquebox/messaging/ext/javax_jms_queue_browser.rb +27 -0
  30. data/lib/torquebox/messaging/ext/javax_jms_session.rb +142 -0
  31. data/lib/torquebox/messaging/task.rb +46 -0
  32. data/lib/torquebox/messaging.rb +6 -0
  33. data/lib/torquebox-base-core.jar +0 -0
  34. data/lib/torquebox-base-metadata.jar +0 -0
  35. data/lib/torquebox-base-spi.jar +0 -0
  36. data/lib/torquebox-mc-support.jar +0 -0
  37. data/lib/torquebox-messaging-core.jar +0 -0
  38. data/lib/torquebox-messaging.jar +0 -0
  39. data/lib/torquebox-messaging.rb +43 -0
  40. data/lib/xercesImpl-2.9.1.jar +0 -0
  41. data/lib/xml-apis-1.3.04.jar +0 -0
  42. data/licenses/lgpl-2.1.txt +504 -0
  43. data/spec/backgroundable_spec.rb +141 -0
  44. data/spec/client_spec.rb +119 -0
  45. data/spec/destination_spec.rb +296 -0
  46. data/spec/dispatcher-queues.yml +4 -0
  47. data/spec/dispatcher_not_running.rb +54 -0
  48. data/spec/ext/java_jmx_session_spec.rb +71 -0
  49. data/spec/queues.yml +6 -0
  50. data/spec/task_spec.rb +66 -0
  51. metadata +163 -0
data/spec/task_spec.rb ADDED
@@ -0,0 +1,66 @@
1
+
2
+ require 'torquebox/messaging/task'
3
+
4
+ class MyTestTask < TorqueBox::Messaging::Task
5
+ attr_accessor :payload
6
+ end
7
+
8
+ describe TorqueBox::Messaging::Task do
9
+
10
+ it "should send payload correctly" do
11
+ expectation = [{:method => :payload=, :payload => {:foo => 'bar'}}, { }]
12
+ queue = mock("queue")
13
+ queue.should_receive(:publish).with(*expectation)
14
+ TorqueBox::Messaging::Queue.should_receive(:new).with(MyTestTask.queue_name).and_return(queue)
15
+
16
+ MyTestTask.async(:payload=, :foo => 'bar')
17
+ end
18
+
19
+ it "should process payload correctly" do
20
+ expectation = {:method => :payload=, :payload => {:foo => 'bar'}}
21
+ message = mock("message")
22
+ message.should_receive(:decode).and_return(expectation)
23
+
24
+ task = MyTestTask.new
25
+ task.process! message
26
+ task.payload[:foo].should == 'bar'
27
+ end
28
+
29
+ it "should handle nil payload as empty hash" do
30
+ queue = mock("queue")
31
+ queue.should_receive(:publish).with(hash_including(:payload => {}), {})
32
+ TorqueBox::Messaging::Queue.should_receive(:new).with(MyTestTask.queue_name).and_return(queue)
33
+ MyTestTask.async(:payload=)
34
+ end
35
+
36
+
37
+ describe "queue_name" do
38
+ before(:each) do
39
+ ENV['TORQUEBOX_APP_NAME'] = 'app_name'
40
+ end
41
+
42
+ after(:each) do
43
+ ENV.delete('TORQUEBOX_APP_NAME')
44
+ end
45
+
46
+ it "should derive the queue name from the class name" do
47
+ MyTestTask.queue_name.should =~ %r{/my_test$}
48
+ end
49
+
50
+ it "should include the app name in the queue name" do
51
+ MyTestTask.queue_name.should =~ %r{/app_name/}
52
+ end
53
+
54
+ {
55
+ 'FooTask' => 'foo',
56
+ 'FooBarTask' => 'foo_bar',
57
+ 'Foo::BarBazTask' => 'foo/bar_baz'
58
+ }.each do |given, expected|
59
+ it "should generate the proper queue name for #{given}" do
60
+ MyTestTask.stub(:name).and_return(given)
61
+ MyTestTask.queue_name.should == "/queues/torquebox/app_name/tasks/#{expected}"
62
+ end
63
+ end
64
+
65
+ end
66
+ end
metadata ADDED
@@ -0,0 +1,163 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: torquebox-messaging
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: 6
5
+ version: 1.0.0.CR1
6
+ platform: java
7
+ authors: []
8
+
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-04-15 00:00:00 -04:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: torquebox-naming
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - "="
23
+ - !ruby/object:Gem::Version
24
+ version: 1.0.0.CR1
25
+ type: :runtime
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: torquebox-naming-container
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - "="
34
+ - !ruby/object:Gem::Version
35
+ version: 1.0.0.CR1
36
+ type: :development
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: torquebox-messaging-container
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - "="
45
+ - !ruby/object:Gem::Version
46
+ version: 1.0.0.CR1
47
+ type: :development
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
50
+ name: torquebox-base
51
+ prerelease: false
52
+ requirement: &id004 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - "="
56
+ - !ruby/object:Gem::Version
57
+ version: 1.0.0.CR1
58
+ type: :runtime
59
+ version_requirements: *id004
60
+ - !ruby/object:Gem::Dependency
61
+ name: rspec
62
+ prerelease: false
63
+ requirement: &id005 !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - "="
67
+ - !ruby/object:Gem::Version
68
+ version: 2.3.0
69
+ type: :development
70
+ version_requirements: *id005
71
+ description: ""
72
+ email:
73
+ executables: []
74
+
75
+ extensions: []
76
+
77
+ extra_rdoc_files: []
78
+
79
+ files:
80
+ - licenses/lgpl-2.1.txt
81
+ - lib/torquebox-messaging.jar
82
+ - lib/torquebox-messaging.rb
83
+ - lib/jboss-jms-api_1.1_spec-1.0.0.Final.jar
84
+ - lib/hornetq-core-2.1.2.Final.jar
85
+ - lib/hornetq-jms-client-2.1.2.Final.jar
86
+ - lib/netty-3.2.1.Final.jar
87
+ - lib/hornetq-logging-2.1.2.Final.jar
88
+ - lib/jboss-logging-3.0.0.Beta4.jar
89
+ - lib/jnp-client-5.0.5.Final.jar
90
+ - lib/jboss-common-core-2.2.17.GA.jar
91
+ - lib/jboss-reflect-2.2.0.GA.jar
92
+ - lib/jbossxb-2.0.3.GA.jar
93
+ - lib/xml-apis-1.3.04.jar
94
+ - lib/xercesImpl-2.9.1.jar
95
+ - lib/dtdparser-1.21.jar
96
+ - lib/activation-1.1.jar
97
+ - lib/jaxb-api-2.1.9.jar
98
+ - lib/torquebox-base-spi.jar
99
+ - lib/jruby-complete-1.6.1.jar
100
+ - lib/torquebox-base-metadata.jar
101
+ - lib/torquebox-base-core.jar
102
+ - lib/picketbox-bare-3.0.0.CR2.jar
103
+ - lib/identity-spi-3.0.0.CR2.jar
104
+ - lib/authorization-spi-3.0.0.CR2.jar
105
+ - lib/acl-spi-3.0.0.CR2.jar
106
+ - lib/jbosssx-bare-3.0.0.CR2.jar
107
+ - lib/picketbox-identity-impl-3.0.0.CR2.jar
108
+ - lib/picketbox-spi-bare-3.0.0.CR2.jar
109
+ - lib/picketbox-acl-impl-3.0.0.CR2.jar
110
+ - lib/jbossxacml-2.0.5.CR1.jar
111
+ - lib/torquebox-mc-support.jar
112
+ - lib/torquebox-messaging-core.jar
113
+ - lib/gem_hook.rb
114
+ - lib/org.torquebox.messaging-client.rb
115
+ - lib/torquebox/messaging.rb
116
+ - lib/torquebox/messaging/backgroundable.rb
117
+ - lib/torquebox/messaging/client.rb
118
+ - lib/torquebox/messaging/destination.rb
119
+ - lib/torquebox/messaging/task.rb
120
+ - lib/torquebox/messaging/ext/javax_jms_queue_browser.rb
121
+ - lib/torquebox/messaging/ext/javax_jms_session.rb
122
+ - spec/backgroundable_spec.rb
123
+ - spec/client_spec.rb
124
+ - spec/destination_spec.rb
125
+ - spec/dispatcher-queues.yml
126
+ - spec/dispatcher_not_running.rb
127
+ - spec/queues.yml
128
+ - spec/task_spec.rb
129
+ - spec/ext/java_jmx_session_spec.rb
130
+ has_rdoc: true
131
+ homepage: http://www.torquebox.org/client-parent/torquebox-messaging/
132
+ licenses:
133
+ - lgpl
134
+ post_install_message:
135
+ rdoc_options: []
136
+
137
+ require_paths:
138
+ - lib
139
+ required_ruby_version: !ruby/object:Gem::Requirement
140
+ none: false
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: "0"
145
+ required_rubygems_version: !ruby/object:Gem::Requirement
146
+ none: false
147
+ requirements:
148
+ - - ">"
149
+ - !ruby/object:Gem::Version
150
+ version: 1.3.1
151
+ requirements: []
152
+
153
+ rubyforge_project:
154
+ rubygems_version: 1.5.1
155
+ signing_key:
156
+ specification_version: 3
157
+ summary: TorqueBox Messaging Client
158
+ test_files:
159
+ - spec/backgroundable_spec.rb
160
+ - spec/client_spec.rb
161
+ - spec/destination_spec.rb
162
+ - spec/task_spec.rb
163
+ - spec/ext/java_jmx_session_spec.rb