Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0dc468d

Browse files
committedJun 14, 2016
Order MethodFixtures methods alphabetically
Issue #68 [#119713047]
1 parent 39a18ba commit 0dc468d

File tree

1 file changed

+124
-124
lines changed

1 file changed

+124
-124
lines changed
 

‎RMQClientTests/MethodFixtures.swift

+124-124
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,110 @@ import UIKit
33
class MethodFixtures {
44
static let rmqTrue = RMQBoolean(true)
55

6+
static func basicAck(deliveryTag: UInt64, options: RMQBasicAckOptions) -> RMQBasicAck {
7+
return RMQBasicAck(deliveryTag: RMQLonglong(deliveryTag), options: options)
8+
}
9+
10+
static func basicCancel(consumerTag: String) -> RMQBasicCancel {
11+
return RMQBasicCancel(consumerTag: RMQShortstr(consumerTag), options: [])
12+
}
13+
14+
static func basicCancelOk(consumerTag: String) -> RMQBasicCancelOk {
15+
return RMQBasicCancelOk(consumerTag: RMQShortstr(consumerTag))
16+
}
17+
18+
static func basicConsume(queueName: String, consumerTag: String, options: RMQBasicConsumeOptions) -> RMQBasicConsume {
19+
return RMQBasicConsume(reserved1: RMQShort(0), queue: RMQShortstr(queueName), consumerTag: RMQShortstr(consumerTag), options: options, arguments: RMQTable([:]))
20+
}
21+
22+
static func basicConsumeOk(consumerTag: String) -> RMQBasicConsumeOk {
23+
return RMQBasicConsumeOk(consumerTag: RMQShortstr(consumerTag))
24+
}
25+
26+
static func basicDeliver(consumerTag consumerTag: String = "", deliveryTag: UInt64 = 0, routingKey: String = "", exchange: String = "", options: RMQBasicDeliverOptions = []) -> RMQBasicDeliver {
27+
return RMQBasicDeliver(
28+
consumerTag: RMQShortstr(consumerTag),
29+
deliveryTag: RMQLonglong(deliveryTag),
30+
options: options,
31+
exchange: RMQShortstr(exchange),
32+
routingKey: RMQShortstr(routingKey)
33+
)
34+
}
35+
36+
static func basicGet(queue: String = "my.queue", options: RMQBasicGetOptions = []) -> RMQBasicGet {
37+
return RMQBasicGet(reserved1: RMQShort(0), queue: RMQShortstr(queue), options: options)
38+
}
39+
40+
static func basicGetOk(routingKey routingKey: String, deliveryTag: UInt64 = 0, exchange: String = "", options: RMQBasicGetOkOptions = []) -> RMQBasicGetOk {
41+
return RMQBasicGetOk(deliveryTag: RMQLonglong(deliveryTag),
42+
options: options,
43+
exchange: RMQShortstr(exchange),
44+
routingKey: RMQShortstr(routingKey),
45+
messageCount: RMQLong(0))
46+
}
47+
48+
static func basicNack(deliveryTag: UInt64, options: RMQBasicNackOptions) -> RMQBasicNack {
49+
return RMQBasicNack(deliveryTag: RMQLonglong(deliveryTag), options: options)
50+
}
51+
52+
static func basicPublish(routingKey: String, exchange: String = "", options: RMQBasicPublishOptions = []) -> RMQBasicPublish {
53+
return RMQBasicPublish(reserved1: RMQShort(0), exchange: RMQShortstr(exchange), routingKey: RMQShortstr(routingKey), options: options)
54+
}
55+
56+
static func basicQos(prefetchCount: UInt, options: RMQBasicQosOptions) -> RMQBasicQos {
57+
return RMQBasicQos(prefetchSize: RMQLong(0), prefetchCount: RMQShort(prefetchCount), options: options)
58+
}
59+
60+
static func basicQosOk() -> RMQBasicQosOk {
61+
return RMQBasicQosOk()
62+
}
63+
64+
static func basicReject(deliveryTag: UInt64, options: RMQBasicRejectOptions) -> RMQBasicReject {
65+
return RMQBasicReject(deliveryTag: RMQLonglong(deliveryTag), options: options)
66+
}
67+
68+
static func channelClose() -> RMQChannelClose {
69+
return RMQChannelClose(
70+
replyCode: RMQShort(200),
71+
replyText: RMQShortstr("Goodbye"),
72+
classId: RMQShort(0),
73+
methodId: RMQShort(0)
74+
)
75+
}
76+
77+
static func channelCloseOk() -> RMQChannelCloseOk {
78+
return RMQChannelCloseOk()
79+
}
80+
81+
static func channelOpen() -> RMQChannelOpen {
82+
return RMQChannelOpen(reserved1: RMQShortstr(""))
83+
}
84+
85+
static func channelOpenOk() -> RMQChannelOpenOk {
86+
return RMQChannelOpenOk(reserved1: RMQLongstr(""))
87+
}
88+
89+
static func connectionClose() -> RMQConnectionClose {
90+
return RMQConnectionClose(
91+
replyCode: RMQShort(200),
92+
replyText: RMQShortstr("Goodbye"),
93+
classId: RMQShort(0),
94+
methodId: RMQShort(0)
95+
)
96+
}
97+
98+
static func connectionCloseOk() -> RMQConnectionCloseOk {
99+
return RMQConnectionCloseOk()
100+
}
101+
102+
static func connectionOpen() -> RMQConnectionOpen {
103+
return RMQConnectionOpen(virtualHost: RMQShortstr("/"), reserved1: RMQShortstr(""), options: RMQConnectionOpenOptions.NoOptions)
104+
}
105+
106+
static func connectionOpenOk() -> RMQConnectionOpenOk {
107+
return RMQConnectionOpenOk(reserved1: RMQShortstr(""))
108+
}
109+
6110
static func connectionStart() -> RMQConnectionStart {
7111
let dict: [String: RMQBoolean] = [
8112
"authentication_failure_close" : rmqTrue,
@@ -64,46 +168,40 @@ class MethodFixtures {
64168
return RMQConnectionTuneOk(channelMax: RMQShort(65535), frameMax: RMQLong(RMQFrameMax), heartbeat: RMQShort(60))
65169
}
66170

67-
static func connectionOpen() -> RMQConnectionOpen {
68-
return RMQConnectionOpen(virtualHost: RMQShortstr("/"), reserved1: RMQShortstr(""), options: RMQConnectionOpenOptions.NoOptions)
171+
static func exchangeBind(source: String, destination: String, routingKey: String) -> RMQExchangeBind {
172+
return RMQExchangeBind(reserved1: RMQShort(0), destination: RMQShortstr(destination), source: RMQShortstr(source), routingKey: RMQShortstr(routingKey), options: [], arguments: RMQTable([:]))
69173
}
70174

71-
static func connectionOpenOk() -> RMQConnectionOpenOk {
72-
return RMQConnectionOpenOk(reserved1: RMQShortstr(""))
175+
static func exchangeBindOk() -> RMQExchangeBindOk {
176+
return RMQExchangeBindOk()
73177
}
74178

75-
static func connectionClose() -> RMQConnectionClose {
76-
return RMQConnectionClose(
77-
replyCode: RMQShort(200),
78-
replyText: RMQShortstr("Goodbye"),
79-
classId: RMQShort(0),
80-
methodId: RMQShort(0)
81-
)
179+
static func exchangeDeclare(name: String, type: String, options: RMQExchangeDeclareOptions) -> RMQExchangeDeclare {
180+
return RMQExchangeDeclare(reserved1: RMQShort(0), exchange: RMQShortstr(name), type: RMQShortstr(type), options: options, arguments: RMQTable([:]))
82181
}
83182

84-
static func connectionCloseOk() -> RMQConnectionCloseOk {
85-
return RMQConnectionCloseOk()
183+
static func exchangeDeclareOk() -> RMQExchangeDeclareOk {
184+
return RMQExchangeDeclareOk()
86185
}
87186

88-
static func channelOpen() -> RMQChannelOpen {
89-
return RMQChannelOpen(reserved1: RMQShortstr(""))
187+
static func exchangeDelete(name: String, options: RMQExchangeDeleteOptions) -> RMQExchangeDelete {
188+
return RMQExchangeDelete(reserved1: RMQShort(0), exchange: RMQShortstr(name), options: options)
90189
}
91190

92-
static func channelOpenOk() -> RMQChannelOpenOk {
93-
return RMQChannelOpenOk(reserved1: RMQLongstr(""))
191+
static func exchangeDeleteOk() -> RMQExchangeDeleteOk {
192+
return RMQExchangeDeleteOk()
94193
}
95194

96-
static func channelClose() -> RMQChannelClose {
97-
return RMQChannelClose(
98-
replyCode: RMQShort(200),
99-
replyText: RMQShortstr("Goodbye"),
100-
classId: RMQShort(0),
101-
methodId: RMQShort(0)
102-
)
195+
static func exchangeUnbind(source: String, destination: String, routingKey: String) -> RMQExchangeUnbind {
196+
return RMQExchangeUnbind(reserved1: RMQShort(0), destination: RMQShortstr(destination), source: RMQShortstr(source), routingKey: RMQShortstr(routingKey), options: [], arguments: RMQTable([:]))
103197
}
104198

105-
static func channelCloseOk() -> RMQChannelCloseOk {
106-
return RMQChannelCloseOk()
199+
static func queueBind(name: String, exchangeName: String, routingKey: String) -> RMQQueueBind {
200+
return RMQQueueBind(reserved1: RMQShort(0), queue: RMQShortstr(name), exchange: RMQShortstr(exchangeName), routingKey: RMQShortstr(routingKey), options: [], arguments: RMQTable([:]))
201+
}
202+
203+
static func queueBindOk() -> RMQQueueBindOk {
204+
return RMQQueueBindOk()
107205
}
108206

109207
static func queueDeclare(name: String, options: RMQQueueDeclareOptions) -> RMQQueueDeclare {
@@ -127,109 +225,11 @@ class MethodFixtures {
127225
return RMQQueueDeleteOk(messageCount: RMQLong(messageCount))
128226
}
129227

130-
static func queueBind(name: String, exchangeName: String, routingKey: String) -> RMQQueueBind {
131-
return RMQQueueBind(reserved1: RMQShort(0), queue: RMQShortstr(name), exchange: RMQShortstr(exchangeName), routingKey: RMQShortstr(routingKey), options: [], arguments: RMQTable([:]))
132-
}
133-
134-
static func queueBindOk() -> RMQQueueBindOk {
135-
return RMQQueueBindOk()
136-
}
137-
138228
static func queueUnbind(name: String, exchangeName: String, routingKey: String) -> RMQQueueUnbind {
139229
return RMQQueueUnbind(reserved1: RMQShort(0), queue: RMQShortstr(name), exchange: RMQShortstr(exchangeName), routingKey: RMQShortstr(routingKey), arguments: RMQTable([:]))
140230
}
141231

142232
static func queueUnbindOk() -> RMQQueueUnbindOk {
143233
return RMQQueueUnbindOk()
144234
}
145-
146-
static func basicAck(deliveryTag: UInt64, options: RMQBasicAckOptions) -> RMQBasicAck {
147-
return RMQBasicAck(deliveryTag: RMQLonglong(deliveryTag), options: options)
148-
}
149-
150-
static func basicConsume(queueName: String, consumerTag: String, options: RMQBasicConsumeOptions) -> RMQBasicConsume {
151-
return RMQBasicConsume(reserved1: RMQShort(0), queue: RMQShortstr(queueName), consumerTag: RMQShortstr(consumerTag), options: options, arguments: RMQTable([:]))
152-
}
153-
154-
static func basicConsumeOk(consumerTag: String) -> RMQBasicConsumeOk {
155-
return RMQBasicConsumeOk(consumerTag: RMQShortstr(consumerTag))
156-
}
157-
158-
static func basicCancel(consumerTag: String) -> RMQBasicCancel {
159-
return RMQBasicCancel(consumerTag: RMQShortstr(consumerTag), options: [])
160-
}
161-
162-
static func basicCancelOk(consumerTag: String) -> RMQBasicCancelOk {
163-
return RMQBasicCancelOk(consumerTag: RMQShortstr(consumerTag))
164-
}
165-
166-
static func basicDeliver(consumerTag consumerTag: String = "", deliveryTag: UInt64 = 0, routingKey: String = "", exchange: String = "", options: RMQBasicDeliverOptions = []) -> RMQBasicDeliver {
167-
return RMQBasicDeliver(
168-
consumerTag: RMQShortstr(consumerTag),
169-
deliveryTag: RMQLonglong(deliveryTag),
170-
options: options,
171-
exchange: RMQShortstr(exchange),
172-
routingKey: RMQShortstr(routingKey)
173-
)
174-
}
175-
176-
static func basicGet(queue: String = "my.queue", options: RMQBasicGetOptions = []) -> RMQBasicGet {
177-
return RMQBasicGet(reserved1: RMQShort(0), queue: RMQShortstr(queue), options: options)
178-
}
179-
180-
static func basicGetOk(routingKey routingKey: String, deliveryTag: UInt64 = 0, exchange: String = "", options: RMQBasicGetOkOptions = []) -> RMQBasicGetOk {
181-
return RMQBasicGetOk(deliveryTag: RMQLonglong(deliveryTag),
182-
options: options,
183-
exchange: RMQShortstr(exchange),
184-
routingKey: RMQShortstr(routingKey),
185-
messageCount: RMQLong(0))
186-
}
187-
188-
static func basicNack(deliveryTag: UInt64, options: RMQBasicNackOptions) -> RMQBasicNack {
189-
return RMQBasicNack(deliveryTag: RMQLonglong(deliveryTag), options: options)
190-
}
191-
192-
static func basicPublish(routingKey: String, exchange: String = "", options: RMQBasicPublishOptions = []) -> RMQBasicPublish {
193-
return RMQBasicPublish(reserved1: RMQShort(0), exchange: RMQShortstr(exchange), routingKey: RMQShortstr(routingKey), options: options)
194-
}
195-
196-
static func basicQos(prefetchCount: UInt, options: RMQBasicQosOptions) -> RMQBasicQos {
197-
return RMQBasicQos(prefetchSize: RMQLong(0), prefetchCount: RMQShort(prefetchCount), options: options)
198-
}
199-
200-
static func basicQosOk() -> RMQBasicQosOk {
201-
return RMQBasicQosOk()
202-
}
203-
204-
static func basicReject(deliveryTag: UInt64, options: RMQBasicRejectOptions) -> RMQBasicReject {
205-
return RMQBasicReject(deliveryTag: RMQLonglong(deliveryTag), options: options)
206-
}
207-
208-
static func exchangeDeclare(name: String, type: String, options: RMQExchangeDeclareOptions) -> RMQExchangeDeclare {
209-
return RMQExchangeDeclare(reserved1: RMQShort(0), exchange: RMQShortstr(name), type: RMQShortstr(type), options: options, arguments: RMQTable([:]))
210-
}
211-
212-
static func exchangeDeclareOk() -> RMQExchangeDeclareOk {
213-
return RMQExchangeDeclareOk()
214-
}
215-
216-
static func exchangeBind(source: String, destination: String, routingKey: String) -> RMQExchangeBind {
217-
return RMQExchangeBind(reserved1: RMQShort(0), destination: RMQShortstr(destination), source: RMQShortstr(source), routingKey: RMQShortstr(routingKey), options: [], arguments: RMQTable([:]))
218-
}
219-
220-
static func exchangeBindOk() -> RMQExchangeBindOk {
221-
return RMQExchangeBindOk()
222-
}
223-
224-
static func exchangeUnbind(source: String, destination: String, routingKey: String) -> RMQExchangeUnbind {
225-
return RMQExchangeUnbind(reserved1: RMQShort(0), destination: RMQShortstr(destination), source: RMQShortstr(source), routingKey: RMQShortstr(routingKey), options: [], arguments: RMQTable([:]))
226-
}
227-
228-
static func exchangeDelete(name: String, options: RMQExchangeDeleteOptions) -> RMQExchangeDelete {
229-
return RMQExchangeDelete(reserved1: RMQShort(0), exchange: RMQShortstr(name), options: options)
230-
}
231-
232-
static func exchangeDeleteOk() -> RMQExchangeDeleteOk {
233-
return RMQExchangeDeleteOk()
234-
}
235235
}

0 commit comments

Comments
 (0)
Please sign in to comment.