Fix formatting in channel close test

This commit fixes the indentation in the transport test case for a
channel closing while connecting.
This commit is contained in:
Jason Tedor 2017-10-10 13:39:44 -04:00
parent 4c06b8f1d2
commit 393e73612e
1 changed files with 22 additions and 22 deletions

View File

@ -2616,28 +2616,28 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
}
public void testChannelCloseWhileConnecting() throws IOException {
try (MockTransportService service = build(Settings.builder().put("name", "close").build(), version0, null, true)) {
service.setExecutorName(ThreadPool.Names.SAME); // make sure stuff is executed in a blocking fashion
service.addConnectionListener(new TransportConnectionListener() {
@Override
public void onConnectionOpened(final Transport.Connection connection) {
try {
closeConnectionChannel(service.getOriginalTransport(), connection);
} catch (final IOException e) {
throw new AssertionError(e);
}
}
});
final ConnectionProfile.Builder builder = new ConnectionProfile.Builder();
builder.addConnections(1,
TransportRequestOptions.Type.BULK,
TransportRequestOptions.Type.PING,
TransportRequestOptions.Type.RECOVERY,
TransportRequestOptions.Type.REG,
TransportRequestOptions.Type.STATE);
final ConnectTransportException e =
expectThrows(ConnectTransportException.class, () -> service.openConnection(nodeA, builder.build()));
assertThat(e, hasToString(containsString(("a channel closed while connecting"))));
try (MockTransportService service = build(Settings.builder().put("name", "close").build(), version0, null, true)) {
service.setExecutorName(ThreadPool.Names.SAME); // make sure stuff is executed in a blocking fashion
service.addConnectionListener(new TransportConnectionListener() {
@Override
public void onConnectionOpened(final Transport.Connection connection) {
try {
closeConnectionChannel(service.getOriginalTransport(), connection);
} catch (final IOException e) {
throw new AssertionError(e);
}
}
});
final ConnectionProfile.Builder builder = new ConnectionProfile.Builder();
builder.addConnections(1,
TransportRequestOptions.Type.BULK,
TransportRequestOptions.Type.PING,
TransportRequestOptions.Type.RECOVERY,
TransportRequestOptions.Type.REG,
TransportRequestOptions.Type.STATE);
final ConnectTransportException e =
expectThrows(ConnectTransportException.class, () -> service.openConnection(nodeA, builder.build()));
assertThat(e, hasToString(containsString(("a channel closed while connecting"))));
}
}