amq-protocol 0.0.1.pre → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -1
- data/.travis.yml +7 -0
- data/CONTRIBUTORS +2 -0
- data/Gemfile +16 -0
- data/Gemfile.lock +31 -0
- data/LICENSE +1 -1
- data/PROFILING.md +81 -0
- data/README.textile +34 -17
- data/TODO.todo +24 -0
- data/__init__.py +0 -0
- data/amq-protocol.gemspec +16 -11
- data/amqp_0.9.1_changes.json +1 -1
- data/bin/jenkins.sh +23 -0
- data/codegen.py +50 -16
- data/codegen_helpers.py +81 -26
- data/examples/00_manual_test.rb +117 -38
- data/irb.rb +76 -4
- data/lib/amq/hacks.rb +33 -0
- data/lib/amq/protocol.rb +3 -1472
- data/lib/amq/protocol/client.rb +2230 -0
- data/lib/amq/protocol/frame.rb +111 -38
- data/lib/amq/protocol/table.rb +89 -42
- data/lib/amq/protocol/version.rb +5 -0
- data/post-processing.rb +1 -0
- data/protocol.rb.pytemplate +217 -63
- data/spec/amq/hacks_spec.rb +39 -0
- data/spec/amq/protocol/basic_spec.rb +320 -0
- data/spec/amq/protocol/channel_spec.rb +117 -0
- data/spec/amq/protocol/confirm_spec.rb +44 -0
- data/spec/amq/protocol/connection_spec.rb +149 -0
- data/spec/amq/protocol/exchange_spec.rb +95 -0
- data/spec/amq/protocol/frame_spec.rb +93 -78
- data/spec/amq/protocol/method_spec.rb +40 -0
- data/spec/amq/protocol/queue_spec.rb +129 -0
- data/spec/amq/protocol/table_spec.rb +59 -36
- data/spec/amq/protocol/tx_spec.rb +58 -0
- data/spec/amq/protocol_spec.rb +572 -643
- data/spec/spec_helper.rb +25 -2
- data/tasks.rb +13 -8
- metadata +44 -25
- data/amq-protocol.pre.gemspec +0 -6
- data/examples/01_basics.rb +0 -14
- data/examples/02_eventmachine.rb +0 -4
@@ -0,0 +1,40 @@
|
|
1
|
+
# encoding: binary
|
2
|
+
|
3
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
4
|
+
|
5
|
+
|
6
|
+
module AMQ
|
7
|
+
module Protocol
|
8
|
+
describe Method do
|
9
|
+
describe '.split_headers' do
|
10
|
+
it 'splits user defined headers into properties and headers' do
|
11
|
+
input = {:delivery_mode => 2, :content_type => 'application/octet-stream', :foo => 'bar'}
|
12
|
+
properties, headers = Method.split_headers(input)
|
13
|
+
properties.should == {:delivery_mode => 2, :content_type => 'application/octet-stream'}
|
14
|
+
headers.should == {:foo => 'bar'}
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe '.encode_body' do
|
19
|
+
context 'when the body fits in a single frame' do
|
20
|
+
it 'encodes a body into a BodyFrame' do
|
21
|
+
body_frames = Method.encode_body('Hello world', 1, 131072)
|
22
|
+
body_frames.first.payload.should == 'Hello world'
|
23
|
+
body_frames.first.channel.should == 1
|
24
|
+
body_frames.should have(1).item
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
context 'when the body is to big to fit in a single frame' do
|
29
|
+
it 'encodes a body into a list of BodyFrames that each fit within the frame size' do
|
30
|
+
lipsum = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
|
31
|
+
frame_size = 100
|
32
|
+
expected_payload_size = 93
|
33
|
+
body_frames = Method.encode_body(lipsum, 1, frame_size)
|
34
|
+
body_frames.map(&:payload).should == lipsum.split('').each_slice(expected_payload_size).map(&:join)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,129 @@
|
|
1
|
+
# encoding: binary
|
2
|
+
|
3
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
4
|
+
|
5
|
+
|
6
|
+
module AMQ
|
7
|
+
module Protocol
|
8
|
+
class Queue
|
9
|
+
describe Declare do
|
10
|
+
describe '.encode' do
|
11
|
+
it 'encodes the parameters into a MethodFrame' do
|
12
|
+
channel = 1
|
13
|
+
queue = 'hello.world'
|
14
|
+
passive = false
|
15
|
+
durable = true
|
16
|
+
exclusive = true
|
17
|
+
auto_delete = true
|
18
|
+
nowait = false
|
19
|
+
arguments = nil
|
20
|
+
method_frame = Declare.encode(channel, queue, passive, durable, exclusive, auto_delete, nowait, arguments)
|
21
|
+
method_frame.payload.should == "\x002\x00\n\x00\x00\vhello.world\x0E\x00\x00\x00\x00"
|
22
|
+
method_frame.channel.should == 1
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe DeclareOk do
|
28
|
+
describe '.decode' do
|
29
|
+
subject do
|
30
|
+
DeclareOk.decode(" amq.gen-KduGSqQrpeUo1otnU0TWSA==\x00\x00\x00\x00\x00\x00\x00\x00")
|
31
|
+
end
|
32
|
+
|
33
|
+
its(:queue) { should == 'amq.gen-KduGSqQrpeUo1otnU0TWSA==' }
|
34
|
+
its(:message_count) { should == 0 }
|
35
|
+
its(:consumer_count) { should == 0 }
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
describe Bind do
|
40
|
+
describe '.encode' do
|
41
|
+
it 'encodes the parameters into a MethodFrame' do
|
42
|
+
channel = 1
|
43
|
+
queue = 'hello.world'
|
44
|
+
exchange = 'foo.bar'
|
45
|
+
routing_key = 'xyz'
|
46
|
+
nowait = false
|
47
|
+
arguments = nil
|
48
|
+
method_frame = Bind.encode(channel, queue, exchange, routing_key, nowait, arguments)
|
49
|
+
method_frame.payload.should == "\x002\x00\x14\x00\x00\vhello.world\afoo.bar\x03xyz\x00\x00\x00\x00\x00"
|
50
|
+
method_frame.channel.should == 1
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# describe BindOk do
|
56
|
+
# describe '.decode' do
|
57
|
+
# end
|
58
|
+
# end
|
59
|
+
|
60
|
+
describe Purge do
|
61
|
+
describe '.encode' do
|
62
|
+
it 'encodes the parameters into a MethodFrame' do
|
63
|
+
channel = 1
|
64
|
+
queue = 'hello.world'
|
65
|
+
nowait = false
|
66
|
+
method_frame = Purge.encode(channel, queue, nowait)
|
67
|
+
method_frame.payload.should == "\x002\x00\x1E\x00\x00\vhello.world\x00"
|
68
|
+
method_frame.channel.should == 1
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
describe PurgeOk do
|
74
|
+
describe '.decode' do
|
75
|
+
subject do
|
76
|
+
PurgeOk.decode("\x00\x00\x00\x02")
|
77
|
+
end
|
78
|
+
|
79
|
+
its(:message_count) { should == 2 }
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
describe Delete do
|
84
|
+
describe '.encode' do
|
85
|
+
it 'encodes the parameters into a MethodFrame' do
|
86
|
+
channel = 1
|
87
|
+
queue = 'hello.world'
|
88
|
+
if_unused = false
|
89
|
+
if_empty = false
|
90
|
+
nowait = false
|
91
|
+
method_frame = Delete.encode(channel, queue, if_unused, if_empty, nowait)
|
92
|
+
method_frame.payload.should == "\x002\x00(\x00\x00\vhello.world\x00"
|
93
|
+
method_frame.channel.should == 1
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
describe DeleteOk do
|
99
|
+
describe '.decode' do
|
100
|
+
subject do
|
101
|
+
DeleteOk.decode("\x00\x00\x00\x02")
|
102
|
+
end
|
103
|
+
|
104
|
+
its(:message_count) { should == 2 }
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
describe Unbind do
|
109
|
+
describe '.encode' do
|
110
|
+
it 'encodes the parameters into a MethodFrame' do
|
111
|
+
channel = 1
|
112
|
+
queue = 'hello.world'
|
113
|
+
exchange = 'foo.bar'
|
114
|
+
routing_key = 'xyz'
|
115
|
+
arguments = nil
|
116
|
+
method_frame = Unbind.encode(channel, queue, exchange, routing_key, arguments)
|
117
|
+
method_frame.payload.should == "\x002\x002\x00\x00\vhello.world\afoo.bar\x03xyz\x00\x00\x00\x00"
|
118
|
+
method_frame.channel.should == 1
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
# describe UnbindOk do
|
124
|
+
# describe '.decode' do
|
125
|
+
# end
|
126
|
+
# end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
@@ -1,46 +1,69 @@
|
|
1
|
-
# encoding:
|
1
|
+
# encoding: binary
|
2
2
|
|
3
|
-
|
3
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
4
|
+
require 'bigdecimal'
|
4
5
|
|
5
|
-
describe AMQ::Protocol::Table do
|
6
|
-
DATA = {
|
7
|
-
Hash.new => "\x00\x00\x00\x00",
|
8
|
-
{"test" => 1} => "\x00\x00\x00\n\x04testI\x00\x00\x00\x01",
|
9
|
-
{"test" => "string"} => "\x00\x00\x00\x10\x04testS\x00\x00\x00\x06string",
|
10
|
-
{"test" => Hash.new} => "\x00\x00\x00\n\x04testF\x00\x00\x00\x00",
|
11
|
-
}
|
12
6
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
7
|
+
module AMQ
|
8
|
+
module Protocol
|
9
|
+
describe Table do
|
10
|
+
timestamp = Time.utc(2010, 12, 31, 23, 58, 59)
|
11
|
+
bigdecimal_1 = BigDecimal.new("1.0")
|
12
|
+
bigdecimal_2 = BigDecimal.new("5E-3")
|
13
|
+
bigdecimal_3 = BigDecimal.new("-0.01")
|
17
14
|
|
18
|
-
it "should return \"\x00\x00\x00\n\x04testI\x00\x00\x00\x01\" for {test: true}" do
|
19
|
-
Table.encode(test: true).should eql("\x00\x00\x00\n\x04testI\x00\x00\x00\x01")
|
20
|
-
end
|
21
15
|
|
22
|
-
|
23
|
-
|
24
|
-
|
16
|
+
DATA = if one_point_eight?
|
17
|
+
{
|
18
|
+
{} => "\000\000\000\000",
|
19
|
+
{"test" => 1} => "\000\000\000\n\004testI\000\000\000\001",
|
20
|
+
{"test" => "string"} => "\000\000\000\020\004testS\000\000\000\006string",
|
21
|
+
{"test" => {}} => "\000\000\000\n\004testF\000\000\000\000",
|
22
|
+
{"test" => bigdecimal_1} => "\000\000\000\v\004testD\000\000\000\000\001",
|
23
|
+
{"test" => bigdecimal_2} => "\000\000\000\v\004testD\003\000\000\000\005",
|
24
|
+
{"test" => timestamp} => "\000\000\000\016\004testT\000\000\000\000M\036nC"
|
25
|
+
}
|
26
|
+
else
|
27
|
+
{
|
28
|
+
{} => "\x00\x00\x00\x00",
|
29
|
+
{"test" => 1} => "\x00\x00\x00\n\x04testI\x00\x00\x00\x01",
|
30
|
+
{"test" => "string"} => "\x00\x00\x00\x10\x04testS\x00\x00\x00\x06string",
|
31
|
+
{"test" => {}} => "\x00\x00\x00\n\x04testF\x00\x00\x00\x00",
|
32
|
+
{"test" => bigdecimal_1} => "\x00\x00\x00\v\x04testD\x00\x00\x00\x00\x01",
|
33
|
+
{"test" => bigdecimal_2} => "\x00\x00\x00\v\x04testD\x03\x00\x00\x00\x05",
|
34
|
+
{"test" => timestamp} => "\x00\x00\x00\x0e\x04testT\x00\x00\x00\x00M\x1enC"
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
describe ".encode" do
|
39
|
+
it "should return \"\x00\x00\x00\x00\" for nil" do
|
40
|
+
encoded_value = if one_point_eight?
|
41
|
+
"\000\000\000\000"
|
42
|
+
else
|
43
|
+
"\x00\x00\x00\x00"
|
44
|
+
end
|
45
|
+
|
46
|
+
Table.encode(nil).should eql(encoded_value)
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should return \"\x00\x00\x00\n\x04testI\x00\x00\x00\x01\" for {test: true}" do
|
50
|
+
Table.encode(:test => true).should eql("\x00\x00\x00\n\x04testI\x00\x00\x00\x01")
|
51
|
+
end
|
52
|
+
|
53
|
+
DATA.each do |data, encoded|
|
54
|
+
it "should return #{encoded.inspect} for #{data.inspect}" do
|
55
|
+
Table.encode(data).should eql(encoded)
|
56
|
+
end
|
57
|
+
end
|
25
58
|
end
|
26
|
-
end
|
27
|
-
end
|
28
59
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
60
|
+
describe ".decode" do
|
61
|
+
DATA.each do |data, encoded|
|
62
|
+
it "should return #{data.inspect} for #{encoded.inspect}" do
|
63
|
+
Table.decode(encoded).should eql(data)
|
64
|
+
end
|
65
|
+
end
|
33
66
|
end
|
34
67
|
end
|
35
68
|
end
|
36
|
-
end
|
37
|
-
|
38
|
-
__END__
|
39
|
-
# encode({"a":decimal.Decimal("1.0")})
|
40
|
-
# "\x00\x00\x00\x07\x01aD\x00\x00\x00\x00\x01"
|
41
|
-
#
|
42
|
-
# encode({"a":decimal.Decimal("5E-3")})
|
43
|
-
# "\x00\x00\x00\x07\x01aD\x03\x00\x00\x00\x05"
|
44
|
-
#
|
45
|
-
# encode({"a":datetime.datetime(2010,12,31,23,58,59)})
|
46
|
-
# "\x00\x00\x00\x0b\x01aT\x00\x00\x00\x00M\x1enC"
|
69
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# encoding: binary
|
2
|
+
|
3
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
4
|
+
|
5
|
+
|
6
|
+
module AMQ
|
7
|
+
module Protocol
|
8
|
+
class Tx
|
9
|
+
describe Select do
|
10
|
+
describe '.encode' do
|
11
|
+
it 'encodes the parameters into a MethodFrame' do
|
12
|
+
channel = 1
|
13
|
+
method_frame = Select.encode(channel)
|
14
|
+
method_frame.payload.should == "\000Z\000\n"
|
15
|
+
method_frame.channel.should == 1
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# describe SelectOk do
|
21
|
+
# describe '.decode' do
|
22
|
+
# end
|
23
|
+
# end
|
24
|
+
|
25
|
+
describe Commit do
|
26
|
+
describe '.encode' do
|
27
|
+
it 'encodes the parameters into a MethodFrame' do
|
28
|
+
channel = 1
|
29
|
+
method_frame = Commit.encode(channel)
|
30
|
+
method_frame.payload.should == "\000Z\000\024"
|
31
|
+
method_frame.channel.should == 1
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# describe CommitOk do
|
37
|
+
# describe '.decode' do
|
38
|
+
# end
|
39
|
+
# end
|
40
|
+
|
41
|
+
describe Rollback do
|
42
|
+
describe '.encode' do
|
43
|
+
it 'encodes the parameters into a MethodFrame' do
|
44
|
+
channel = 1
|
45
|
+
method_frame = Rollback.encode(channel)
|
46
|
+
method_frame.payload.should == "\000Z\000\036"
|
47
|
+
method_frame.channel.should == 1
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# describe RollbackOk do
|
53
|
+
# describe '.decode' do
|
54
|
+
# end
|
55
|
+
# end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
data/spec/amq/protocol_spec.rb
CHANGED
@@ -1,888 +1,817 @@
|
|
1
|
-
# encoding:
|
1
|
+
# encoding: binary
|
2
2
|
|
3
|
-
|
3
|
+
require File.expand_path('../../spec_helper', __FILE__)
|
4
4
|
|
5
|
-
describe AMQ::Protocol do
|
6
|
-
it "should have PROTOCOL_VERSION constant" do
|
7
|
-
AMQ::Protocol::PROTOCOL_VERSION.should match(/^\d+\.\d+\.\d$/)
|
8
|
-
end
|
9
|
-
|
10
|
-
it "should have DEFAULT_PORT constant" do
|
11
|
-
AMQ::Protocol::DEFAULT_PORT.should be_kind_of(Integer)
|
12
|
-
end
|
13
5
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
describe ".classes" do
|
19
|
-
it "should include all the AMQP classes" do
|
20
|
-
AMQ::Protocol.classes.should include(Queue)
|
6
|
+
module AMQ
|
7
|
+
describe Protocol do
|
8
|
+
it "should have PROTOCOL_VERSION constant" do
|
9
|
+
Protocol::PROTOCOL_VERSION.should match(/^\d+\.\d+\.\d$/)
|
21
10
|
end
|
22
|
-
end
|
23
11
|
|
24
|
-
|
25
|
-
|
26
|
-
AMQ::Protocol.methods.should include(Queue::DeclareOk)
|
12
|
+
it "should have DEFAULT_PORT constant" do
|
13
|
+
Protocol::DEFAULT_PORT.should be_kind_of(Integer)
|
27
14
|
end
|
28
|
-
end
|
29
15
|
|
30
|
-
|
31
|
-
|
32
|
-
AMQ::Protocol::Error.should < Exception
|
16
|
+
it "should have PREAMBLE constant" do
|
17
|
+
Protocol::PREAMBLE.should be_kind_of(String)
|
33
18
|
end
|
34
|
-
end
|
35
19
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
it "should have name equal to connection" do
|
42
|
-
Connection.name.should eql("connection")
|
43
|
-
end
|
44
|
-
|
45
|
-
it "should have method equal to TODO" do
|
46
|
-
pending
|
47
|
-
Connection.method.should eql("TODO")
|
48
|
-
end
|
49
|
-
|
50
|
-
describe AMQ::Protocol::Connection::Start do
|
51
|
-
it "should be a subclass of Method" do
|
52
|
-
Connection::Start.should < Method
|
20
|
+
describe Protocol::Error do
|
21
|
+
it "should be an exception class" do
|
22
|
+
Protocol::Error.should < Exception
|
53
23
|
end
|
24
|
+
end
|
54
25
|
|
55
|
-
|
56
|
-
|
26
|
+
describe Protocol::Connection do
|
27
|
+
it "should be a subclass of Class" do
|
28
|
+
Protocol::Connection.superclass.should == Protocol::Class
|
57
29
|
end
|
58
30
|
|
59
|
-
it "should have
|
60
|
-
|
61
|
-
Connection::Start.method.should eql("TODO")
|
31
|
+
it "should have name equal to connection" do
|
32
|
+
Protocol::Connection.name.should eql("connection")
|
62
33
|
end
|
63
|
-
end
|
64
34
|
|
65
|
-
|
66
|
-
|
67
|
-
Connection::StartOk.should < Method
|
35
|
+
it "should have method id equal to 10" do
|
36
|
+
Protocol::Connection.method_id.should == 10
|
68
37
|
end
|
69
38
|
|
70
|
-
|
71
|
-
|
72
|
-
|
39
|
+
describe Protocol::Connection::Start do
|
40
|
+
it "should be a subclass of Method" do
|
41
|
+
Protocol::Connection::Start.superclass.should == Protocol::Method
|
42
|
+
end
|
73
43
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
end
|
44
|
+
it "should have method name equal to connection.start" do
|
45
|
+
Protocol::Connection::Start.name.should eql("connection.start")
|
46
|
+
end
|
78
47
|
|
79
|
-
|
80
|
-
|
81
|
-
result = Connection::StartOk.encode({client: "AMQ Protocol"}, "PLAIN", "LOGINSguesPASSWORDSguest", "en_GB")
|
82
|
-
result.should eql("\x00\n\x00\v\x00\x00\x00\x18\x06clientS\x00\x00\x00\fAMQ Protocol\x05PLAIN\x00\x00\x00\x18LOGINSguesPASSWORDSguest\x05en_GB")
|
48
|
+
it "should have method id equal to 10" do
|
49
|
+
Protocol::Connection::Start.method_id.should == 10
|
83
50
|
end
|
84
51
|
end
|
85
|
-
end
|
86
52
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
53
|
+
describe Protocol::Connection::StartOk do
|
54
|
+
it "should be a subclass of Method" do
|
55
|
+
Protocol::Connection::StartOk.superclass.should == Protocol::Method
|
56
|
+
end
|
91
57
|
|
92
|
-
|
93
|
-
|
94
|
-
|
58
|
+
it "should have method name equal to connection.start-ok" do
|
59
|
+
Protocol::Connection::StartOk.name.should eql("connection.start-ok")
|
60
|
+
end
|
95
61
|
|
96
|
-
|
97
|
-
|
98
|
-
|
62
|
+
it "has method id equal to 11" do
|
63
|
+
Protocol::Connection::StartOk.method_id.should == 11
|
64
|
+
end
|
99
65
|
end
|
100
|
-
end
|
101
66
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
67
|
+
describe Protocol::Connection::Secure do
|
68
|
+
it "should be a subclass of Method" do
|
69
|
+
Protocol::Connection::Secure.superclass.should == Protocol::Method
|
70
|
+
end
|
106
71
|
|
107
|
-
|
108
|
-
|
109
|
-
|
72
|
+
it "should have method name equal to connection.secure" do
|
73
|
+
Protocol::Connection::Secure.name.should eql("connection.secure")
|
74
|
+
end
|
110
75
|
|
111
|
-
|
112
|
-
|
113
|
-
|
76
|
+
it "has method id equal to 20" do
|
77
|
+
Protocol::Connection::Secure.method_id.should == 20
|
78
|
+
end
|
114
79
|
end
|
115
|
-
end
|
116
80
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
81
|
+
describe Protocol::Connection::SecureOk do
|
82
|
+
it "should be a subclass of Method" do
|
83
|
+
Protocol::Connection::SecureOk.superclass.should == Protocol::Method
|
84
|
+
end
|
121
85
|
|
122
|
-
|
123
|
-
|
124
|
-
|
86
|
+
it "should have method name equal to connection.secure-ok" do
|
87
|
+
Protocol::Connection::SecureOk.name.should eql("connection.secure-ok")
|
88
|
+
end
|
125
89
|
|
126
|
-
|
127
|
-
|
128
|
-
|
90
|
+
it "has method id equal to 21" do
|
91
|
+
Protocol::Connection::SecureOk.method_id.should == 21
|
92
|
+
end
|
129
93
|
end
|
130
|
-
end
|
131
94
|
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
95
|
+
describe Protocol::Connection::Tune do
|
96
|
+
it "should be a subclass of Method" do
|
97
|
+
Protocol::Connection::Tune.superclass.should == Protocol::Method
|
98
|
+
end
|
136
99
|
|
137
|
-
|
138
|
-
|
139
|
-
|
100
|
+
it "should have method name equal to connection.tune" do
|
101
|
+
Protocol::Connection::Tune.name.should eql("connection.tune")
|
102
|
+
end
|
140
103
|
|
141
|
-
|
142
|
-
|
143
|
-
|
104
|
+
it "has method id equal to 30" do
|
105
|
+
Protocol::Connection::Tune.method_id.should == 30
|
106
|
+
end
|
144
107
|
end
|
145
108
|
|
146
|
-
describe
|
147
|
-
it do
|
148
|
-
|
149
|
-
result.should eql("\x00\n\x00\x1F\x00\x00\x00\x02\x00\x00\x00\x00")
|
109
|
+
describe Protocol::Connection::TuneOk do
|
110
|
+
it "should be a subclass of Method" do
|
111
|
+
Protocol::Connection::TuneOk.superclass.should == Protocol::Method
|
150
112
|
end
|
151
|
-
end
|
152
|
-
end
|
153
113
|
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
end
|
114
|
+
it "should have method name equal to connection.tune-ok" do
|
115
|
+
Protocol::Connection::TuneOk.name.should eql("connection.tune-ok")
|
116
|
+
end
|
158
117
|
|
159
|
-
|
160
|
-
|
161
|
-
|
118
|
+
it "has method id equal to 31" do
|
119
|
+
Protocol::Connection::TuneOk.method_id.should == 31
|
120
|
+
end
|
162
121
|
|
163
|
-
|
164
|
-
|
165
|
-
|
122
|
+
describe ".encode" do
|
123
|
+
it do
|
124
|
+
frame = Protocol::Connection::TuneOk.encode(0, 131072, 0)
|
125
|
+
frame.payload.should eql("\x00\n\x00\x1F\x00\x00\x00\x02\x00\x00\x00\x00")
|
126
|
+
end
|
127
|
+
end
|
166
128
|
end
|
167
|
-
end
|
168
129
|
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
130
|
+
describe Protocol::Connection::Open do
|
131
|
+
it "should be a subclass of Method" do
|
132
|
+
Protocol::Connection::Open.superclass.should == Protocol::Method
|
133
|
+
end
|
173
134
|
|
174
|
-
|
175
|
-
|
176
|
-
|
135
|
+
it "should have method name equal to connection.open" do
|
136
|
+
Protocol::Connection::Open.name.should eql("connection.open")
|
137
|
+
end
|
177
138
|
|
178
|
-
|
179
|
-
|
180
|
-
|
139
|
+
it "has method id equal to 40" do
|
140
|
+
Protocol::Connection::Open.method_id.should == 40
|
141
|
+
end
|
181
142
|
end
|
182
|
-
end
|
183
143
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
144
|
+
describe Protocol::Connection::OpenOk do
|
145
|
+
it "should be a subclass of Method" do
|
146
|
+
Protocol::Connection::OpenOk.superclass.should == Protocol::Method
|
147
|
+
end
|
188
148
|
|
189
|
-
|
190
|
-
|
191
|
-
|
149
|
+
it "should have method name equal to connection.open-ok" do
|
150
|
+
Protocol::Connection::OpenOk.name.should eql("connection.open-ok")
|
151
|
+
end
|
192
152
|
|
193
|
-
|
194
|
-
|
195
|
-
|
153
|
+
it "has method id equal to 41" do
|
154
|
+
Protocol::Connection::OpenOk.method_id.should == 41
|
155
|
+
end
|
196
156
|
end
|
197
|
-
end
|
198
157
|
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
158
|
+
describe Protocol::Connection::Close do
|
159
|
+
it "should be a subclass of Method" do
|
160
|
+
Protocol::Connection::Close.superclass.should == Protocol::Method
|
161
|
+
end
|
203
162
|
|
204
|
-
|
205
|
-
|
206
|
-
|
163
|
+
it "should have method name equal to connection.close" do
|
164
|
+
Protocol::Connection::Close.name.should eql("connection.close")
|
165
|
+
end
|
207
166
|
|
208
|
-
|
209
|
-
|
210
|
-
|
167
|
+
it "has method id equal to 50" do
|
168
|
+
Protocol::Connection::Close.method_id.should == 50
|
169
|
+
end
|
211
170
|
end
|
212
|
-
end
|
213
|
-
end
|
214
171
|
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
172
|
+
describe Protocol::Connection::CloseOk do
|
173
|
+
it "should be a subclass of Method" do
|
174
|
+
Protocol::Connection::CloseOk.superclass.should == Protocol::Method
|
175
|
+
end
|
219
176
|
|
220
|
-
|
221
|
-
|
222
|
-
|
177
|
+
it "should have method name equal to connection.close-ok" do
|
178
|
+
Protocol::Connection::CloseOk.name.should eql("connection.close-ok")
|
179
|
+
end
|
223
180
|
|
224
|
-
|
225
|
-
|
226
|
-
|
181
|
+
it "has method id equal to 51" do
|
182
|
+
Protocol::Connection::CloseOk.method_id.should == 51
|
183
|
+
end
|
184
|
+
end
|
227
185
|
end
|
228
186
|
|
229
|
-
describe
|
230
|
-
it "should be a subclass of
|
231
|
-
Channel
|
187
|
+
describe Protocol::Channel do
|
188
|
+
it "should be a subclass of Class" do
|
189
|
+
Protocol::Channel.superclass.should == Protocol::Class
|
232
190
|
end
|
233
191
|
|
234
|
-
it "should have
|
235
|
-
Channel
|
192
|
+
it "should have name equal to channel" do
|
193
|
+
Protocol::Channel.name.should eql("channel")
|
236
194
|
end
|
237
195
|
|
238
|
-
it "
|
239
|
-
|
240
|
-
Channel::Open.method.should eql("TODO")
|
196
|
+
it "has method id equal to 20" do
|
197
|
+
Protocol::Channel.method_id.should == 20
|
241
198
|
end
|
242
|
-
end
|
243
199
|
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
200
|
+
describe Protocol::Channel::Open do
|
201
|
+
it "should be a subclass of Method" do
|
202
|
+
Protocol::Channel::Open.superclass.should == Protocol::Method
|
203
|
+
end
|
248
204
|
|
249
|
-
|
250
|
-
|
251
|
-
|
205
|
+
it "should have method name equal to channel.open" do
|
206
|
+
Protocol::Channel::Open.name.should eql("channel.open")
|
207
|
+
end
|
252
208
|
|
253
|
-
|
254
|
-
|
255
|
-
|
209
|
+
it "has method id equal to 10" do
|
210
|
+
Protocol::Channel::Open.method_id.should == 10
|
211
|
+
end
|
256
212
|
end
|
257
|
-
end
|
258
213
|
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
214
|
+
describe Protocol::Channel::OpenOk do
|
215
|
+
it "should be a subclass of Method" do
|
216
|
+
Protocol::Channel::OpenOk.superclass.should == Protocol::Method
|
217
|
+
end
|
263
218
|
|
264
|
-
|
265
|
-
|
266
|
-
|
219
|
+
it "should have method name equal to channel.open-ok" do
|
220
|
+
Protocol::Channel::OpenOk.name.should eql("channel.open-ok")
|
221
|
+
end
|
267
222
|
|
268
|
-
|
269
|
-
|
270
|
-
|
223
|
+
it "has method id equal to 11" do
|
224
|
+
Protocol::Channel::OpenOk.method_id.should == 11
|
225
|
+
end
|
271
226
|
end
|
272
|
-
end
|
273
227
|
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
228
|
+
describe Protocol::Channel::Flow do
|
229
|
+
it "should be a subclass of Method" do
|
230
|
+
Protocol::Channel::Flow.superclass.should == Protocol::Method
|
231
|
+
end
|
278
232
|
|
279
|
-
|
280
|
-
|
281
|
-
|
233
|
+
it "should have method name equal to channel.flow" do
|
234
|
+
Protocol::Channel::Flow.name.should eql("channel.flow")
|
235
|
+
end
|
282
236
|
|
283
|
-
|
284
|
-
|
285
|
-
|
237
|
+
it "has method id equal to 20" do
|
238
|
+
Protocol::Channel::Flow.method_id.should == 20
|
239
|
+
end
|
286
240
|
end
|
287
|
-
end
|
288
241
|
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
242
|
+
describe Protocol::Channel::FlowOk do
|
243
|
+
it "should be a subclass of Method" do
|
244
|
+
Protocol::Channel::FlowOk.superclass.should == Protocol::Method
|
245
|
+
end
|
293
246
|
|
294
|
-
|
295
|
-
|
296
|
-
|
247
|
+
it "should have method name equal to channel.flow-ok" do
|
248
|
+
Protocol::Channel::FlowOk.name.should eql("channel.flow-ok")
|
249
|
+
end
|
297
250
|
|
298
|
-
|
299
|
-
|
300
|
-
|
251
|
+
it "has method id equal to 21" do
|
252
|
+
Protocol::Channel::FlowOk.method_id.should == 21
|
253
|
+
end
|
301
254
|
end
|
302
|
-
end
|
303
255
|
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
256
|
+
describe Protocol::Channel::Close do
|
257
|
+
it "should be a subclass of Method" do
|
258
|
+
Protocol::Channel::Close.superclass.should == Protocol::Method
|
259
|
+
end
|
308
260
|
|
309
|
-
|
310
|
-
|
311
|
-
|
261
|
+
it "should have method name equal to channel.close" do
|
262
|
+
Protocol::Channel::Close.name.should eql("channel.close")
|
263
|
+
end
|
312
264
|
|
313
|
-
|
314
|
-
|
315
|
-
|
265
|
+
it "has method id equal to 40" do
|
266
|
+
Protocol::Channel::Close.method_id.should == 40
|
267
|
+
end
|
316
268
|
end
|
317
|
-
end
|
318
|
-
end
|
319
269
|
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
270
|
+
describe Protocol::Channel::CloseOk do
|
271
|
+
it "should be a subclass of Method" do
|
272
|
+
Protocol::Channel::CloseOk.superclass.should == Protocol::Method
|
273
|
+
end
|
324
274
|
|
325
|
-
|
326
|
-
|
327
|
-
|
275
|
+
it "should have method name equal to channel.close-ok" do
|
276
|
+
Protocol::Channel::CloseOk.name.should eql("channel.close-ok")
|
277
|
+
end
|
328
278
|
|
329
|
-
|
330
|
-
|
331
|
-
|
279
|
+
it "has method id equal to 41" do
|
280
|
+
Protocol::Channel::CloseOk.method_id.should == 41
|
281
|
+
end
|
282
|
+
end
|
332
283
|
end
|
333
284
|
|
334
|
-
describe
|
335
|
-
it "should be a subclass of
|
336
|
-
Exchange
|
285
|
+
describe Protocol::Exchange do
|
286
|
+
it "should be a subclass of Class" do
|
287
|
+
Protocol::Exchange.superclass.should == Protocol::Class
|
337
288
|
end
|
338
289
|
|
339
|
-
it "should have
|
340
|
-
Exchange
|
290
|
+
it "should have name equal to exchange" do
|
291
|
+
Protocol::Exchange.name.should eql("exchange")
|
341
292
|
end
|
342
293
|
|
343
|
-
it "
|
344
|
-
|
345
|
-
Exchange::Declare.method.should eql("TODO")
|
294
|
+
it "has method id equal to 40" do
|
295
|
+
Protocol::Exchange.method_id.should == 40
|
346
296
|
end
|
347
|
-
end
|
348
297
|
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
298
|
+
describe Protocol::Exchange::Declare do
|
299
|
+
it "should be a subclass of Method" do
|
300
|
+
Protocol::Exchange::Declare.superclass.should == Protocol::Method
|
301
|
+
end
|
353
302
|
|
354
|
-
|
355
|
-
|
356
|
-
|
303
|
+
it "should have method name equal to exchange.declare" do
|
304
|
+
Protocol::Exchange::Declare.name.should eql("exchange.declare")
|
305
|
+
end
|
357
306
|
|
358
|
-
|
359
|
-
|
360
|
-
|
307
|
+
it "has method id equal to 10" do
|
308
|
+
Protocol::Exchange::Declare.method_id.should == 10
|
309
|
+
end
|
361
310
|
end
|
362
|
-
end
|
363
311
|
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
312
|
+
describe Protocol::Exchange::DeclareOk do
|
313
|
+
it "should be a subclass of Method" do
|
314
|
+
Protocol::Exchange::DeclareOk.superclass.should == Protocol::Method
|
315
|
+
end
|
368
316
|
|
369
|
-
|
370
|
-
|
371
|
-
|
317
|
+
it "should have method name equal to exchange.declare-ok" do
|
318
|
+
Protocol::Exchange::DeclareOk.name.should eql("exchange.declare-ok")
|
319
|
+
end
|
372
320
|
|
373
|
-
|
374
|
-
|
375
|
-
|
321
|
+
it "has method id equal to 11" do
|
322
|
+
Protocol::Exchange::DeclareOk.method_id.should == 11
|
323
|
+
end
|
376
324
|
end
|
377
|
-
end
|
378
325
|
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
326
|
+
describe Protocol::Exchange::Delete do
|
327
|
+
it "should be a subclass of Method" do
|
328
|
+
Protocol::Exchange::Delete.superclass.should == Protocol::Method
|
329
|
+
end
|
383
330
|
|
384
|
-
|
385
|
-
|
386
|
-
|
331
|
+
it "should have method name equal to exchange.delete" do
|
332
|
+
Protocol::Exchange::Delete.name.should eql("exchange.delete")
|
333
|
+
end
|
387
334
|
|
388
|
-
|
389
|
-
|
390
|
-
|
335
|
+
it "has method id equal to 20" do
|
336
|
+
Protocol::Exchange::Delete.method_id.should == 20
|
337
|
+
end
|
391
338
|
end
|
392
|
-
end
|
393
339
|
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
340
|
+
describe Protocol::Exchange::DeleteOk do
|
341
|
+
it "should be a subclass of Method" do
|
342
|
+
Protocol::Exchange::DeleteOk.superclass.should == Protocol::Method
|
343
|
+
end
|
398
344
|
|
399
|
-
|
400
|
-
|
401
|
-
|
345
|
+
it "should have method name equal to exchange.delete-ok" do
|
346
|
+
Protocol::Exchange::DeleteOk.name.should eql("exchange.delete-ok")
|
347
|
+
end
|
402
348
|
|
403
|
-
|
404
|
-
|
405
|
-
|
349
|
+
it "has method id equal to 21" do
|
350
|
+
Protocol::Exchange::DeleteOk.method_id.should == 21
|
351
|
+
end
|
406
352
|
end
|
407
|
-
end
|
408
353
|
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
354
|
+
describe Protocol::Exchange::Bind do
|
355
|
+
it "should be a subclass of Method" do
|
356
|
+
Protocol::Exchange::Bind.superclass.should == Protocol::Method
|
357
|
+
end
|
413
358
|
|
414
|
-
|
415
|
-
|
416
|
-
|
359
|
+
it "should have method name equal to exchange.bind" do
|
360
|
+
Protocol::Exchange::Bind.name.should eql("exchange.bind")
|
361
|
+
end
|
417
362
|
|
418
|
-
|
419
|
-
|
420
|
-
|
363
|
+
it "has method id equal to 30" do
|
364
|
+
Protocol::Exchange::Bind.method_id.should == 30
|
365
|
+
end
|
421
366
|
end
|
422
|
-
end
|
423
367
|
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
368
|
+
describe Protocol::Exchange::BindOk do
|
369
|
+
it "should be a subclass of Method" do
|
370
|
+
Protocol::Exchange::BindOk.superclass.should == Protocol::Method
|
371
|
+
end
|
428
372
|
|
429
|
-
|
430
|
-
|
431
|
-
|
373
|
+
it "should have method name equal to exchange.bind-ok" do
|
374
|
+
Protocol::Exchange::BindOk.name.should eql("exchange.bind-ok")
|
375
|
+
end
|
432
376
|
|
433
|
-
|
434
|
-
|
435
|
-
|
377
|
+
it "has method id equal to 31" do
|
378
|
+
Protocol::Exchange::BindOk.method_id.should == 31
|
379
|
+
end
|
436
380
|
end
|
437
|
-
end
|
438
381
|
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
382
|
+
describe Protocol::Exchange::Unbind do
|
383
|
+
it "should be a subclass of Method" do
|
384
|
+
Protocol::Exchange::Unbind.superclass.should == Protocol::Method
|
385
|
+
end
|
443
386
|
|
444
|
-
|
445
|
-
|
446
|
-
|
387
|
+
it "should have method name equal to exchange.unbind" do
|
388
|
+
Protocol::Exchange::Unbind.name.should eql("exchange.unbind")
|
389
|
+
end
|
447
390
|
|
448
|
-
|
449
|
-
|
450
|
-
|
391
|
+
it "has method id equal to 40" do
|
392
|
+
Protocol::Exchange::Unbind.method_id.should == 40
|
393
|
+
end
|
451
394
|
end
|
452
|
-
end
|
453
|
-
end
|
454
395
|
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
396
|
+
describe Protocol::Exchange::UnbindOk do
|
397
|
+
it "should be a subclass of Method" do
|
398
|
+
Protocol::Exchange::UnbindOk.superclass.should == Protocol::Method
|
399
|
+
end
|
459
400
|
|
460
|
-
|
461
|
-
|
462
|
-
|
401
|
+
it "should have method name equal to exchange.unbind-ok" do
|
402
|
+
Protocol::Exchange::UnbindOk.name.should eql("exchange.unbind-ok")
|
403
|
+
end
|
463
404
|
|
464
|
-
|
465
|
-
|
466
|
-
|
405
|
+
it "has method id equal to 51" do
|
406
|
+
Protocol::Exchange::UnbindOk.method_id.should == 51
|
407
|
+
end
|
408
|
+
end
|
467
409
|
end
|
468
410
|
|
469
|
-
describe
|
470
|
-
it "should be a subclass of
|
471
|
-
Queue
|
411
|
+
describe Protocol::Queue do
|
412
|
+
it "should be a subclass of Class" do
|
413
|
+
Protocol::Queue.superclass.should == Protocol::Class
|
472
414
|
end
|
473
415
|
|
474
|
-
it "should have
|
475
|
-
Queue
|
416
|
+
it "should have name equal to queue" do
|
417
|
+
Protocol::Queue.name.should eql("queue")
|
476
418
|
end
|
477
419
|
|
478
|
-
it "
|
479
|
-
|
480
|
-
Queue::Declare.method.should eql("TODO")
|
420
|
+
it "has method id equal to 50" do
|
421
|
+
Protocol::Queue.method_id.should == 50
|
481
422
|
end
|
482
|
-
end
|
483
423
|
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
424
|
+
describe Protocol::Queue::Declare do
|
425
|
+
it "should be a subclass of Method" do
|
426
|
+
Protocol::Queue::Declare.superclass.should == Protocol::Method
|
427
|
+
end
|
488
428
|
|
489
|
-
|
490
|
-
|
491
|
-
|
429
|
+
it "should have method name equal to queue.declare" do
|
430
|
+
Protocol::Queue::Declare.name.should eql("queue.declare")
|
431
|
+
end
|
492
432
|
|
493
|
-
|
494
|
-
|
495
|
-
|
433
|
+
it "has method id equal to 10" do
|
434
|
+
Protocol::Queue::Declare.method_id.should == 10
|
435
|
+
end
|
496
436
|
end
|
497
|
-
end
|
498
437
|
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
438
|
+
describe Protocol::Queue::DeclareOk do
|
439
|
+
it "should be a subclass of Method" do
|
440
|
+
Protocol::Queue::DeclareOk.superclass.should == Protocol::Method
|
441
|
+
end
|
503
442
|
|
504
|
-
|
505
|
-
|
506
|
-
|
443
|
+
it "should have method name equal to queue.declare-ok" do
|
444
|
+
Protocol::Queue::DeclareOk.name.should eql("queue.declare-ok")
|
445
|
+
end
|
507
446
|
|
508
|
-
|
509
|
-
|
510
|
-
|
447
|
+
it "has method id equal to 11" do
|
448
|
+
Protocol::Queue::DeclareOk.method_id.should == 11
|
449
|
+
end
|
511
450
|
end
|
512
|
-
end
|
513
451
|
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
452
|
+
describe Protocol::Queue::Bind do
|
453
|
+
it "should be a subclass of Method" do
|
454
|
+
Protocol::Queue::Bind.superclass.should == Protocol::Method
|
455
|
+
end
|
518
456
|
|
519
|
-
|
520
|
-
|
521
|
-
|
457
|
+
it "should have method name equal to queue.bind" do
|
458
|
+
Protocol::Queue::Bind.name.should eql("queue.bind")
|
459
|
+
end
|
522
460
|
|
523
|
-
|
524
|
-
|
525
|
-
|
461
|
+
it "has method id equal to 20" do
|
462
|
+
Protocol::Queue::Bind.method_id.should == 20
|
463
|
+
end
|
526
464
|
end
|
527
|
-
end
|
528
465
|
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
466
|
+
describe Protocol::Queue::BindOk do
|
467
|
+
it "should be a subclass of Method" do
|
468
|
+
Protocol::Queue::BindOk.superclass.should == Protocol::Method
|
469
|
+
end
|
533
470
|
|
534
|
-
|
535
|
-
|
536
|
-
|
471
|
+
it "should have method name equal to queue.bind-ok" do
|
472
|
+
Protocol::Queue::BindOk.name.should eql("queue.bind-ok")
|
473
|
+
end
|
537
474
|
|
538
|
-
|
539
|
-
|
540
|
-
|
475
|
+
it "has method id equal to 21" do
|
476
|
+
Protocol::Queue::BindOk.method_id.should == 21
|
477
|
+
end
|
541
478
|
end
|
542
|
-
end
|
543
479
|
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
480
|
+
describe Protocol::Queue::Purge do
|
481
|
+
it "should be a subclass of Method" do
|
482
|
+
Protocol::Queue::Purge.superclass.should == Protocol::Method
|
483
|
+
end
|
548
484
|
|
549
|
-
|
550
|
-
|
551
|
-
|
485
|
+
it "should have method name equal to queue.purge" do
|
486
|
+
Protocol::Queue::Purge.name.should eql("queue.purge")
|
487
|
+
end
|
552
488
|
|
553
|
-
|
554
|
-
|
555
|
-
|
489
|
+
it "has method id equal to 30" do
|
490
|
+
Protocol::Queue::Purge.method_id.should == 30
|
491
|
+
end
|
556
492
|
end
|
557
|
-
end
|
558
493
|
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
494
|
+
describe Protocol::Queue::PurgeOk do
|
495
|
+
it "should be a subclass of Method" do
|
496
|
+
Protocol::Queue::PurgeOk.superclass.should == Protocol::Method
|
497
|
+
end
|
563
498
|
|
564
|
-
|
565
|
-
|
566
|
-
|
499
|
+
it "should have method name equal to queue.purge-ok" do
|
500
|
+
Protocol::Queue::PurgeOk.name.should eql("queue.purge-ok")
|
501
|
+
end
|
567
502
|
|
568
|
-
|
569
|
-
|
570
|
-
|
503
|
+
it "has method id equal to 31" do
|
504
|
+
Protocol::Queue::PurgeOk.method_id.should == 31
|
505
|
+
end
|
571
506
|
end
|
572
|
-
end
|
573
507
|
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
508
|
+
describe Protocol::Queue::Delete do
|
509
|
+
it "should be a subclass of Method" do
|
510
|
+
Protocol::Queue::Delete.superclass.should == Protocol::Method
|
511
|
+
end
|
578
512
|
|
579
|
-
|
580
|
-
|
581
|
-
|
513
|
+
it "should have method name equal to queue.delete" do
|
514
|
+
Protocol::Queue::Delete.name.should eql("queue.delete")
|
515
|
+
end
|
582
516
|
|
583
|
-
|
584
|
-
|
585
|
-
|
517
|
+
it "has method id equal to 40" do
|
518
|
+
Protocol::Queue::Delete.method_id.should == 40
|
519
|
+
end
|
586
520
|
end
|
587
|
-
end
|
588
521
|
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
522
|
+
describe Protocol::Queue::DeleteOk do
|
523
|
+
it "should be a subclass of Method" do
|
524
|
+
Protocol::Queue::DeleteOk.superclass.should == Protocol::Method
|
525
|
+
end
|
593
526
|
|
594
|
-
|
595
|
-
|
596
|
-
|
527
|
+
it "should have method name equal to queue.delete-ok" do
|
528
|
+
Protocol::Queue::DeleteOk.name.should eql("queue.delete-ok")
|
529
|
+
end
|
597
530
|
|
598
|
-
|
599
|
-
|
600
|
-
|
531
|
+
it "has method id equal to 41" do
|
532
|
+
Protocol::Queue::DeleteOk.method_id.should == 41
|
533
|
+
end
|
601
534
|
end
|
602
|
-
end
|
603
535
|
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
536
|
+
describe Protocol::Queue::Unbind do
|
537
|
+
it "should be a subclass of Method" do
|
538
|
+
Protocol::Queue::Unbind.superclass.should == Protocol::Method
|
539
|
+
end
|
608
540
|
|
609
|
-
|
610
|
-
|
611
|
-
|
541
|
+
it "should have method name equal to queue.unbind" do
|
542
|
+
Protocol::Queue::Unbind.name.should eql("queue.unbind")
|
543
|
+
end
|
612
544
|
|
613
|
-
|
614
|
-
|
615
|
-
|
545
|
+
it "has method id equal to 50" do
|
546
|
+
Protocol::Queue::Unbind.method_id.should == 50
|
547
|
+
end
|
616
548
|
end
|
617
|
-
end
|
618
|
-
end
|
619
549
|
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
550
|
+
describe Protocol::Queue::UnbindOk do
|
551
|
+
it "should be a subclass of Method" do
|
552
|
+
Protocol::Queue::UnbindOk.superclass.should == Protocol::Method
|
553
|
+
end
|
624
554
|
|
625
|
-
|
626
|
-
|
627
|
-
|
555
|
+
it "should have method name equal to queue.unbind-ok" do
|
556
|
+
Protocol::Queue::UnbindOk.name.should eql("queue.unbind-ok")
|
557
|
+
end
|
628
558
|
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
end
|
633
|
-
describe AMQ::Protocol::Basic::Qos do
|
634
|
-
it "should be a subclass of Method" do
|
635
|
-
Basic::Qos.should < Method
|
559
|
+
it "has method id equal to 51" do
|
560
|
+
Protocol::Queue::UnbindOk.method_id.should == 51
|
561
|
+
end
|
636
562
|
end
|
563
|
+
end
|
637
564
|
|
638
|
-
|
639
|
-
|
565
|
+
describe Protocol::Basic do
|
566
|
+
it "should be a subclass of Class" do
|
567
|
+
Protocol::Basic.superclass.should == Protocol::Class
|
640
568
|
end
|
641
569
|
|
642
|
-
it "should have
|
643
|
-
|
644
|
-
Basic::Qos.method.should eql("TODO")
|
570
|
+
it "should have name equal to basic" do
|
571
|
+
Protocol::Basic.name.should eql("basic")
|
645
572
|
end
|
646
|
-
end
|
647
573
|
|
648
|
-
|
649
|
-
|
650
|
-
Basic::QosOk.should < Method
|
574
|
+
it "has method id equal to 60" do
|
575
|
+
Protocol::Basic.method_id.should == 60
|
651
576
|
end
|
652
577
|
|
653
|
-
|
654
|
-
|
655
|
-
|
578
|
+
describe Protocol::Basic::Qos do
|
579
|
+
it "should be a subclass of Method" do
|
580
|
+
Protocol::Basic::Qos.superclass.should == Protocol::Method
|
581
|
+
end
|
656
582
|
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
end
|
661
|
-
end
|
583
|
+
it "should have method name equal to basic.qos" do
|
584
|
+
Protocol::Basic::Qos.name.should eql("basic.qos")
|
585
|
+
end
|
662
586
|
|
663
|
-
|
664
|
-
|
665
|
-
|
587
|
+
it "has method id equal to 10" do
|
588
|
+
Protocol::Basic::Qos.method_id.should == 10
|
589
|
+
end
|
666
590
|
end
|
667
591
|
|
668
|
-
|
669
|
-
|
670
|
-
|
592
|
+
describe Protocol::Basic::QosOk do
|
593
|
+
it "should be a subclass of Method" do
|
594
|
+
Protocol::Basic::QosOk.superclass.should == Protocol::Method
|
595
|
+
end
|
671
596
|
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
end
|
676
|
-
end
|
597
|
+
it "should have method name equal to basic.qos-ok" do
|
598
|
+
Protocol::Basic::QosOk.name.should eql("basic.qos-ok")
|
599
|
+
end
|
677
600
|
|
678
|
-
|
679
|
-
|
680
|
-
|
601
|
+
it "has method id equal to 11" do
|
602
|
+
Protocol::Basic::QosOk.method_id.should == 11
|
603
|
+
end
|
681
604
|
end
|
682
605
|
|
683
|
-
|
684
|
-
|
685
|
-
|
606
|
+
describe Protocol::Basic::Consume do
|
607
|
+
it "should be a subclass of Method" do
|
608
|
+
Protocol::Basic::Consume.superclass.should == Protocol::Method
|
609
|
+
end
|
686
610
|
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
end
|
691
|
-
end
|
611
|
+
it "should have method name equal to basic.consume" do
|
612
|
+
Protocol::Basic::Consume.name.should eql("basic.consume")
|
613
|
+
end
|
692
614
|
|
693
|
-
|
694
|
-
|
695
|
-
|
615
|
+
it "has method id equal to 20" do
|
616
|
+
Protocol::Basic::Consume.method_id.should == 20
|
617
|
+
end
|
696
618
|
end
|
697
619
|
|
698
|
-
|
699
|
-
|
700
|
-
|
620
|
+
describe Protocol::Basic::ConsumeOk do
|
621
|
+
it "should be a subclass of Method" do
|
622
|
+
Protocol::Basic::ConsumeOk.superclass.should == Protocol::Method
|
623
|
+
end
|
701
624
|
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
end
|
706
|
-
end
|
625
|
+
it "should have method name equal to basic.consume-ok" do
|
626
|
+
Protocol::Basic::ConsumeOk.name.should eql("basic.consume-ok")
|
627
|
+
end
|
707
628
|
|
708
|
-
|
709
|
-
|
710
|
-
|
629
|
+
it "has method id equal to 21" do
|
630
|
+
Protocol::Basic::ConsumeOk.method_id.should == 21
|
631
|
+
end
|
711
632
|
end
|
712
633
|
|
713
|
-
|
714
|
-
|
715
|
-
|
634
|
+
describe Protocol::Basic::Cancel do
|
635
|
+
it "should be a subclass of Method" do
|
636
|
+
Protocol::Basic::Cancel.superclass.should == Protocol::Method
|
637
|
+
end
|
716
638
|
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
end
|
721
|
-
end
|
639
|
+
it "should have method name equal to basic.cancel" do
|
640
|
+
Protocol::Basic::Cancel.name.should eql("basic.cancel")
|
641
|
+
end
|
722
642
|
|
723
|
-
|
724
|
-
|
725
|
-
|
643
|
+
it "has method id equal to 30" do
|
644
|
+
Protocol::Basic::Cancel.method_id.should == 30
|
645
|
+
end
|
726
646
|
end
|
727
647
|
|
728
|
-
|
729
|
-
|
730
|
-
|
648
|
+
describe Protocol::Basic::CancelOk do
|
649
|
+
it "should be a subclass of Method" do
|
650
|
+
Protocol::Basic::CancelOk.superclass.should == Protocol::Method
|
651
|
+
end
|
731
652
|
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
end
|
736
|
-
end
|
653
|
+
it "should have method name equal to basic.cancel-ok" do
|
654
|
+
Protocol::Basic::CancelOk.name.should eql("basic.cancel-ok")
|
655
|
+
end
|
737
656
|
|
738
|
-
|
739
|
-
|
740
|
-
|
657
|
+
it "has method id equal to 31" do
|
658
|
+
Protocol::Basic::CancelOk.method_id.should == 31
|
659
|
+
end
|
741
660
|
end
|
742
661
|
|
743
|
-
|
744
|
-
|
745
|
-
|
662
|
+
describe Protocol::Basic::Publish do
|
663
|
+
it "should be a subclass of Method" do
|
664
|
+
Protocol::Basic::Publish.superclass.should == Protocol::Method
|
665
|
+
end
|
746
666
|
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
end
|
751
|
-
end
|
667
|
+
it "should have method name equal to basic.publish" do
|
668
|
+
Protocol::Basic::Publish.name.should eql("basic.publish")
|
669
|
+
end
|
752
670
|
|
753
|
-
|
754
|
-
|
755
|
-
|
671
|
+
it "has method id equal to 40" do
|
672
|
+
Protocol::Basic::Publish.method_id.should == 40
|
673
|
+
end
|
756
674
|
end
|
757
675
|
|
758
|
-
|
759
|
-
|
760
|
-
|
676
|
+
describe Protocol::Basic::Return do
|
677
|
+
it "should be a subclass of Method" do
|
678
|
+
Protocol::Basic::Return.superclass.should == Protocol::Method
|
679
|
+
end
|
761
680
|
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
end
|
766
|
-
end
|
681
|
+
it "should have method name equal to basic.return" do
|
682
|
+
Protocol::Basic::Return.name.should eql("basic.return")
|
683
|
+
end
|
767
684
|
|
768
|
-
|
769
|
-
|
770
|
-
|
685
|
+
it "has method id equal to 50" do
|
686
|
+
Protocol::Basic::Return.method_id.should == 50
|
687
|
+
end
|
771
688
|
end
|
772
689
|
|
773
|
-
|
774
|
-
|
775
|
-
|
690
|
+
describe Protocol::Basic::Deliver do
|
691
|
+
it "should be a subclass of Method" do
|
692
|
+
Protocol::Basic::Deliver.superclass.should == Protocol::Method
|
693
|
+
end
|
776
694
|
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
end
|
781
|
-
end
|
695
|
+
it "should have method name equal to basic.deliver" do
|
696
|
+
Protocol::Basic::Deliver.name.should eql("basic.deliver")
|
697
|
+
end
|
782
698
|
|
783
|
-
|
784
|
-
|
785
|
-
|
699
|
+
it "has method id equal to 60" do
|
700
|
+
Protocol::Basic::Deliver.method_id.should == 60
|
701
|
+
end
|
786
702
|
end
|
787
703
|
|
788
|
-
|
789
|
-
|
790
|
-
|
704
|
+
describe Protocol::Basic::Get do
|
705
|
+
it "should be a subclass of Method" do
|
706
|
+
Protocol::Basic::Get.superclass.should == Protocol::Method
|
707
|
+
end
|
791
708
|
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
end
|
796
|
-
end
|
709
|
+
it "should have method name equal to basic.get" do
|
710
|
+
Protocol::Basic::Get.name.should eql("basic.get")
|
711
|
+
end
|
797
712
|
|
798
|
-
|
799
|
-
|
800
|
-
|
713
|
+
it "has method id equal to 70" do
|
714
|
+
Protocol::Basic::Get.method_id.should == 70
|
715
|
+
end
|
801
716
|
end
|
802
717
|
|
803
|
-
|
804
|
-
|
805
|
-
|
718
|
+
describe Protocol::Basic::GetOk do
|
719
|
+
it "should be a subclass of Method" do
|
720
|
+
Protocol::Basic::GetOk.superclass.should == Protocol::Method
|
721
|
+
end
|
806
722
|
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
end
|
811
|
-
end
|
723
|
+
it "should have method name equal to basic.get-ok" do
|
724
|
+
Protocol::Basic::GetOk.name.should eql("basic.get-ok")
|
725
|
+
end
|
812
726
|
|
813
|
-
|
814
|
-
|
815
|
-
|
727
|
+
it "has method id equal to 71" do
|
728
|
+
Protocol::Basic::GetOk.method_id.should == 71
|
729
|
+
end
|
816
730
|
end
|
817
731
|
|
818
|
-
|
819
|
-
|
820
|
-
|
732
|
+
describe Protocol::Basic::GetEmpty do
|
733
|
+
it "should be a subclass of Method" do
|
734
|
+
Protocol::Basic::GetEmpty.superclass.should == Protocol::Method
|
735
|
+
end
|
821
736
|
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
end
|
826
|
-
end
|
737
|
+
it "should have method name equal to basic.get-empty" do
|
738
|
+
Protocol::Basic::GetEmpty.name.should eql("basic.get-empty")
|
739
|
+
end
|
827
740
|
|
828
|
-
|
829
|
-
|
830
|
-
|
741
|
+
it "has method id equal to 72" do
|
742
|
+
Protocol::Basic::GetEmpty.method_id.should == 72
|
743
|
+
end
|
831
744
|
end
|
832
745
|
|
833
|
-
|
834
|
-
|
835
|
-
|
746
|
+
describe Protocol::Basic::Ack do
|
747
|
+
it "should be a subclass of Method" do
|
748
|
+
Protocol::Basic::Ack.superclass.should == Protocol::Method
|
749
|
+
end
|
836
750
|
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
end
|
841
|
-
end
|
751
|
+
it "should have method name equal to basic.ack" do
|
752
|
+
Protocol::Basic::Ack.name.should eql("basic.ack")
|
753
|
+
end
|
842
754
|
|
843
|
-
|
844
|
-
|
845
|
-
|
755
|
+
it "has method id equal to 80" do
|
756
|
+
Protocol::Basic::Ack.method_id.should == 80
|
757
|
+
end
|
846
758
|
end
|
847
759
|
|
848
|
-
|
849
|
-
|
850
|
-
|
760
|
+
describe Protocol::Basic::Reject do
|
761
|
+
it "should be a subclass of Method" do
|
762
|
+
Protocol::Basic::Reject.superclass.should == Protocol::Method
|
763
|
+
end
|
851
764
|
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
end
|
856
|
-
end
|
765
|
+
it "should have method name equal to basic.reject" do
|
766
|
+
Protocol::Basic::Reject.name.should eql("basic.reject")
|
767
|
+
end
|
857
768
|
|
858
|
-
|
859
|
-
|
860
|
-
|
769
|
+
it "has method id equal to 90" do
|
770
|
+
Protocol::Basic::Reject.method_id.should == 90
|
771
|
+
end
|
861
772
|
end
|
862
773
|
|
863
|
-
|
864
|
-
|
865
|
-
|
774
|
+
describe Protocol::Basic::RecoverAsync do
|
775
|
+
it "should be a subclass of Method" do
|
776
|
+
Protocol::Basic::RecoverAsync.superclass.should == Protocol::Method
|
777
|
+
end
|
866
778
|
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
end
|
871
|
-
end
|
779
|
+
it "should have method name equal to basic.recover-async" do
|
780
|
+
Protocol::Basic::RecoverAsync.name.should eql("basic.recover-async")
|
781
|
+
end
|
872
782
|
|
873
|
-
|
874
|
-
|
875
|
-
|
783
|
+
it "has method id equal to 100" do
|
784
|
+
Protocol::Basic::RecoverAsync.method_id.should == 100
|
785
|
+
end
|
876
786
|
end
|
877
787
|
|
878
|
-
|
879
|
-
|
788
|
+
describe Protocol::Basic::Recover do
|
789
|
+
it "should be a subclass of Method" do
|
790
|
+
Protocol::Basic::Recover.superclass.should == Protocol::Method
|
791
|
+
end
|
792
|
+
|
793
|
+
it "should have method name equal to basic.recover" do
|
794
|
+
Protocol::Basic::Recover.name.should eql("basic.recover")
|
795
|
+
end
|
796
|
+
|
797
|
+
it "has method id equal to 110" do
|
798
|
+
Protocol::Basic::Recover.method_id.should == 110
|
799
|
+
end
|
880
800
|
end
|
881
801
|
|
882
|
-
|
883
|
-
|
884
|
-
|
802
|
+
describe Protocol::Basic::RecoverOk do
|
803
|
+
it "should be a subclass of Method" do
|
804
|
+
Protocol::Basic::RecoverOk.superclass.should == Protocol::Method
|
805
|
+
end
|
806
|
+
|
807
|
+
it "should have method name equal to basic.recover-ok" do
|
808
|
+
Protocol::Basic::RecoverOk.name.should eql("basic.recover-ok")
|
809
|
+
end
|
810
|
+
|
811
|
+
it "has method id equal to 111" do
|
812
|
+
Protocol::Basic::RecoverOk.method_id.should == 111
|
813
|
+
end
|
885
814
|
end
|
886
815
|
end
|
887
816
|
end
|
888
|
-
end
|
817
|
+
end
|