ap4r 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,51 @@
1
+ require File.join(File.dirname(__FILE__), "../spec_helper")
2
+
3
+ require "reliable-msg"
4
+ require "ap4r/mongrel"
5
+
6
+ describe Ap4r::Mongrel::Ap4rSubscribeMessageHandler, " on subscribing a simple message" do
7
+
8
+ def start_queue_manager
9
+ @manager = ::ReliableMsg::QueueManager.new(:config => "config/queues_disk.cfg")
10
+ @manager.start_original
11
+ end
12
+
13
+ before(:each) do
14
+ start_queue_manager
15
+
16
+ q = ::ReliableMsg::Queue.new "queue.test"
17
+ while q.get; end
18
+ q.put "hgoe"
19
+
20
+ params = {
21
+ Mongrel::Const::PATH_INFO => "/queue.test",
22
+ Mongrel::Const::REQUEST_METHOD => "POST",
23
+ }
24
+ class << params
25
+ def http_body
26
+ "hoge"
27
+ end
28
+ end
29
+
30
+ class MockSocket
31
+ def initialize;end
32
+ def closed?;false;end
33
+ end
34
+
35
+ @handler = Ap4r::Mongrel::Ap4rSubscribeMessageHandler.new(nil)
36
+ @request = Mongrel::HttpRequest.new(params, nil, nil)
37
+ @response = Mongrel::HttpResponse.new(MockSocket.new)
38
+ @handler.process(@request, @response)
39
+ end
40
+
41
+ after(:each)do
42
+ @manager.stop_original
43
+ end
44
+
45
+ it "should have no message in the queue" do
46
+ q = ReliableMsg::Queue.new "queue.test"
47
+ q.get.should be_nil
48
+ end
49
+
50
+ end
51
+
metadata CHANGED
@@ -1,34 +1,64 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: ap4r
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.3.5
7
- date: 2007-11-29 00:00:00 +09:00
8
- summary: Asynchronous Processing for Ruby.
9
- require_paths:
10
- - lib
11
- email: shinohara.shunichi@future.co.jp, kato.kiwamu@future.co.jp
12
- homepage: http://ap4r.rubyforge.org/wiki/wiki.pl?HomePage
13
- rubyforge_project: ap4r
14
- description: Asynchronous Processing for Ruby.
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 0.3.6
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Shunichi Shinohara
31
8
  - Kiwamu Kato
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2008-02-06 00:00:00 +09:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: reliable-msg
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - "="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.1.0
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: activesupport
27
+ version_requirement:
28
+ version_requirements: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: "0"
33
+ version:
34
+ - !ruby/object:Gem::Dependency
35
+ name: mongrel
36
+ version_requirement:
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: "0"
42
+ version:
43
+ - !ruby/object:Gem::Dependency
44
+ name: rake
45
+ version_requirement:
46
+ version_requirements: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: "0"
51
+ version:
52
+ description: Asynchronous Processing for Ruby.
53
+ email: shinohara.shunichi@future.co.jp, kato.kiwamu@future.co.jp
54
+ executables:
55
+ - ap4r_setup
56
+ extensions: []
57
+
58
+ extra_rdoc_files:
59
+ - History.txt
60
+ - Manifest.txt
61
+ - README.txt
32
62
  files:
33
63
  - History.txt
34
64
  - MIT-LICENSE
@@ -47,6 +77,7 @@ files:
47
77
  - lib/ap4r/carrier.rb
48
78
  - lib/ap4r/db/migrate/001_reliable_msg_queue_and_topic.rb
49
79
  - lib/ap4r/dispatcher.rb
80
+ - lib/ap4r/message_builder.rb
50
81
  - lib/ap4r/message_store_ext.rb
51
82
  - lib/ap4r/mongrel.rb
52
83
  - lib/ap4r/mongrel_ap4r.rb
@@ -75,63 +106,45 @@ files:
75
106
  - rails_plugin/ap4r/lib/ap4r/service_handler.rb
76
107
  - rails_plugin/ap4r/lib/ap4r_client.rb
77
108
  - rails_plugin/ap4r/lib/async_helper.rb
78
- - rails_plugin/ap4r/lib/message_builder.rb
79
109
  - rails_plugin/ap4r/tasks/ap4r.rake
80
110
  - script/irm
81
111
  - script/mongrel_ap4r
82
112
  - script/start
83
113
  - script/stop
84
114
  - spec/local/dispatcher_base_spec.rb
115
+ - spec/local/message_builder_spec.rb
116
+ - spec/local/send_message_handler_spec.rb
117
+ - spec/local/subscribe_message_handler_spec.rb
85
118
  - spec/spec_helper.rb
86
- test_files:
87
- - spec/local/dispatcher_base_spec.rb
119
+ has_rdoc: true
120
+ homepage: http://ap4r.rubyforge.org/wiki/wiki.pl?HomePage
121
+ post_install_message:
88
122
  rdoc_options:
89
123
  - --main
90
124
  - README.txt
91
- extra_rdoc_files:
92
- - History.txt
93
- - Manifest.txt
94
- - README.txt
95
- executables:
96
- - ap4r_setup
97
- extensions: []
98
-
125
+ require_paths:
126
+ - lib
127
+ required_ruby_version: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: "0"
132
+ version:
133
+ required_rubygems_version: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: "0"
138
+ version:
99
139
  requirements: []
100
140
 
101
- dependencies:
102
- - !ruby/object:Gem::Dependency
103
- name: reliable-msg
104
- version_requirement:
105
- version_requirements: !ruby/object:Gem::Version::Requirement
106
- requirements:
107
- - - "="
108
- - !ruby/object:Gem::Version
109
- version: 1.1.0
110
- version:
111
- - !ruby/object:Gem::Dependency
112
- name: activesupport
113
- version_requirement:
114
- version_requirements: !ruby/object:Gem::Version::Requirement
115
- requirements:
116
- - - ">"
117
- - !ruby/object:Gem::Version
118
- version: 0.0.0
119
- version:
120
- - !ruby/object:Gem::Dependency
121
- name: mongrel
122
- version_requirement:
123
- version_requirements: !ruby/object:Gem::Version::Requirement
124
- requirements:
125
- - - ">"
126
- - !ruby/object:Gem::Version
127
- version: 0.0.0
128
- version:
129
- - !ruby/object:Gem::Dependency
130
- name: rake
131
- version_requirement:
132
- version_requirements: !ruby/object:Gem::Version::Requirement
133
- requirements:
134
- - - ">"
135
- - !ruby/object:Gem::Version
136
- version: 0.0.0
137
- version:
141
+ rubyforge_project: ap4r
142
+ rubygems_version: 1.0.0
143
+ signing_key:
144
+ specification_version: 2
145
+ summary: Asynchronous Processing for Ruby.
146
+ test_files:
147
+ - spec/local/dispatcher_base_spec.rb
148
+ - spec/local/message_builder_spec.rb
149
+ - spec/local/send_message_handler_spec.rb
150
+ - spec/local/subscribe_message_handler_spec.rb