Skip to content

Commit ed15a57

Browse files
author
Quintin Willison
committed
Replace tabs with spaces, matching the new house style.
1 parent af88909 commit ed15a57

2 files changed

Lines changed: 55 additions & 55 deletions

File tree

lib/src/main/java/io/ably/lib/rest/AblyBase.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -239,25 +239,25 @@ public void requestAsync(String method, String path, Param[] params, HttpCore.Re
239239
*/
240240
@Experimental
241241
public PublishResponse[] publishBatch(Message.Batch[] pubSpecs, ChannelOptions channelOptions) throws AblyException {
242-
return publishBatchImpl(pubSpecs, channelOptions, null).sync();
243-
}
242+
return publishBatchImpl(pubSpecs, channelOptions, null).sync();
243+
}
244244

245-
@Experimental
246-
public PublishResponse[] publishBatch(Message.Batch[] pubSpecs, ChannelOptions channelOptions, Param[] params) throws AblyException {
247-
return publishBatchImpl(pubSpecs, channelOptions, params).sync();
245+
@Experimental
246+
public PublishResponse[] publishBatch(Message.Batch[] pubSpecs, ChannelOptions channelOptions, Param[] params) throws AblyException {
247+
return publishBatchImpl(pubSpecs, channelOptions, params).sync();
248248
}
249249

250250
@Experimental
251251
public void publishBatchAsync(Message.Batch[] pubSpecs, ChannelOptions channelOptions, final Callback<PublishResponse[]> callback) throws AblyException {
252-
publishBatchImpl(pubSpecs, channelOptions, null).async(callback);
253-
}
252+
publishBatchImpl(pubSpecs, channelOptions, null).async(callback);
253+
}
254254

255-
@Experimental
256-
public void publishBatchAsync(Message.Batch[] pubSpecs, ChannelOptions channelOptions, Param[] params, final Callback<PublishResponse[]> callback) throws AblyException {
257-
publishBatchImpl(pubSpecs, channelOptions, null).async(callback);
255+
@Experimental
256+
public void publishBatchAsync(Message.Batch[] pubSpecs, ChannelOptions channelOptions, Param[] params, final Callback<PublishResponse[]> callback) throws AblyException {
257+
publishBatchImpl(pubSpecs, channelOptions, null).async(callback);
258258
}
259259

260-
private Http.Request<PublishResponse[]> publishBatchImpl(final Message.Batch[] pubSpecs, ChannelOptions channelOptions, final Param[] params) throws AblyException {
260+
private Http.Request<PublishResponse[]> publishBatchImpl(final Message.Batch[] pubSpecs, ChannelOptions channelOptions, final Param[] params) throws AblyException {
261261
boolean hasClientSuppliedId = false;
262262
for(Message.Batch spec : pubSpecs) {
263263
for(Message message : spec.messages) {
@@ -280,7 +280,7 @@ private Http.Request<PublishResponse[]> publishBatchImpl(final Message.Batch[] p
280280
@Override
281281
public void execute(HttpScheduler http, final Callback<PublishResponse[]> callback) throws AblyException {
282282
HttpCore.RequestBody requestBody = options.useBinaryProtocol ? MessageSerializer.asMsgpackRequest(pubSpecs) : MessageSerializer.asJSONRequest(pubSpecs);
283-
http.post("/messages", HttpUtils.defaultAcceptHeaders(options.useBinaryProtocol), params, requestBody, new HttpCore.ResponseHandler<PublishResponse[]>() {
283+
http.post("/messages", HttpUtils.defaultAcceptHeaders(options.useBinaryProtocol), params, requestBody, new HttpCore.ResponseHandler<PublishResponse[]>() {
284284
@Override
285285
public PublishResponse[] handleResponse(HttpCore.Response response, ErrorInfo error) throws AblyException {
286286
if(error != null && error.code != 40020) {

lib/src/test/java/io/ably/lib/test/rest/RestChannelBulkPublishTest.java

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ public class RestChannelBulkPublishTest extends ParameterizedTest {
1818

1919
/**
2020
* Publish a single message on multiple channels
21-
*
21+
*
2222
* The payload constructed has the form
2323
* [
2424
* {
2525
* channel: [ <channel 0>, <channel 1>, ... ],
2626
* message: [{ data: <message text> }]
2727
* }
2828
* ]
29-
*
29+
*
3030
* It publishes the given message on all of the given channels.
3131
*/
3232
@Test
@@ -69,54 +69,54 @@ public void bulk_publish_multiple_channels_simple() {
6969
}
7070
}
7171

72-
/**
73-
* As above but with the param method
74-
*/
75-
@Test
76-
public void bulk_publish_multiple_channels_param() {
77-
try {
78-
/* setup library instance */
79-
ClientOptions opts = createOptions(testVars.keys[0].keyStr);
80-
AblyRest ably = new AblyRest(opts);
72+
/**
73+
* As above but with the param method
74+
*/
75+
@Test
76+
public void bulk_publish_multiple_channels_param() {
77+
try {
78+
/* setup library instance */
79+
ClientOptions opts = createOptions(testVars.keys[0].keyStr);
80+
AblyRest ably = new AblyRest(opts);
8181

82-
/* first, publish some messages */
83-
int channelCount = 5;
84-
ArrayList<String> channelIds = new ArrayList<String>();
85-
for(int i = 0; i < channelCount; i++) {
86-
channelIds.add("persisted:" + randomString());
87-
}
82+
/* first, publish some messages */
83+
int channelCount = 5;
84+
ArrayList<String> channelIds = new ArrayList<String>();
85+
for (int i = 0; i < channelCount; i++) {
86+
channelIds.add("persisted:" + randomString());
87+
}
8888

89-
Message message = new Message(null, "bulk_publish_multiple_channels_param");
90-
String messageId = message.id = randomString();
91-
Message.Batch payload = new Message.Batch(channelIds, Collections.singleton(message));
89+
Message message = new Message(null, "bulk_publish_multiple_channels_param");
90+
String messageId = message.id = randomString();
91+
Message.Batch payload = new Message.Batch(channelIds, Collections.singleton(message));
9292

93-
Param[] params = new Param[] { new Param("quickAck", "true") };
93+
Param[] params = new Param[]{new Param("quickAck", "true")};
9494

95-
PublishResponse[] result = ably.publishBatch(new Message.Batch[] { payload }, null, params);
96-
for(PublishResponse response : result) {
97-
assertEquals("Verify expected response id", response.messageId, messageId);
98-
assertTrue("Verify expected channel name", channelIds.contains(response.channelId));
99-
assertNull("Verify no publish error", response.error);
100-
}
95+
PublishResponse[] result = ably.publishBatch(new Message.Batch[]{payload}, null, params);
96+
for (PublishResponse response : result) {
97+
assertEquals("Verify expected response id", response.messageId, messageId);
98+
assertTrue("Verify expected channel name", channelIds.contains(response.channelId));
99+
assertNull("Verify no publish error", response.error);
100+
}
101101

102-
/* get the history for this channel */
103-
for(String channel : channelIds) {
104-
PaginatedResult<Message> messages = ably.channels.get(channel).history(null);
105-
assertNotNull("Expected non-null messages", messages);
106-
assertEquals("Expected 1 message", messages.items().length, 1);
107-
/* verify message contents */
108-
assertEquals("Expect message data to be expected String", messages.items()[0].data, message.data);
109-
}
110-
} catch (AblyException e) {
111-
e.printStackTrace();
112-
fail("bulk_publish_multiple_channels_param: Unexpected exception");
113-
return;
114-
}
115-
}
102+
/* get the history for this channel */
103+
for (String channel : channelIds) {
104+
PaginatedResult<Message> messages = ably.channels.get(channel).history(null);
105+
assertNotNull("Expected non-null messages", messages);
106+
assertEquals("Expected 1 message", messages.items().length, 1);
107+
/* verify message contents */
108+
assertEquals("Expect message data to be expected String", messages.items()[0].data, message.data);
109+
}
110+
} catch (AblyException e) {
111+
e.printStackTrace();
112+
fail("bulk_publish_multiple_channels_param: Unexpected exception");
113+
return;
114+
}
115+
}
116116

117117
/**
118118
* Publish a multiple messages on multiple channels
119-
*
119+
*
120120
* The payload constructed has the form
121121
* [
122122
* {
@@ -139,7 +139,7 @@ public void bulk_publish_multiple_channels_param() {
139139
* },
140140
* ...
141141
* ]
142-
*
142+
*
143143
* It publishes the given messages on the associated channels.
144144
*/
145145
@Test

0 commit comments

Comments
 (0)