checkstyle MutableException
checkstyle EmptyBlock checkstyle fixRightCurly Script checkstyle EmptyStatement checkstyle RightCurly checkstyle TailingWhite checkstyle NeedBraces Fix the line separator in the `fixRightCurly.gradle`
This commit is contained in:
committed by
Artem Bilan
parent
c0b19e61b5
commit
842aded9a4
@@ -36,9 +36,9 @@ public class AbstractTcpChannelAdapterTests {
|
||||
|
||||
@Override
|
||||
public void publishEvent(Object event) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
protected HelloWorldInterceptorFactory newInterceptorFactory() {
|
||||
|
||||
@@ -106,7 +106,7 @@ public class TcpReceivingChannelAdapterTests extends AbstractTcpChannelAdapterTe
|
||||
public void run() {
|
||||
try {
|
||||
ServerSocket server = ServerSocketFactory.getDefault().createServerSocket(0, 10);
|
||||
serverSocket.set(server);;
|
||||
serverSocket.set(server);
|
||||
latch1.countDown();
|
||||
Socket socket = server.accept();
|
||||
socket.getOutputStream().write("Test1\r\nTest2\r\n".getBytes());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -242,7 +242,8 @@ public class TcpSendingMessageHandlerTests extends AbstractTcpChannelAdapterTest
|
||||
b = ("Reply" + (++i) + "\r\n").getBytes();
|
||||
socket.getOutputStream().write(b);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
if (!done.get()) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -302,7 +303,8 @@ public class TcpSendingMessageHandlerTests extends AbstractTcpChannelAdapterTest
|
||||
b = ("\u0002Reply" + (++i) + "\u0003").getBytes();
|
||||
socket.getOutputStream().write(b);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
if (!done.get()) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -359,7 +361,8 @@ public class TcpSendingMessageHandlerTests extends AbstractTcpChannelAdapterTest
|
||||
b = ("\u0002Reply" + (++i) + "\u0003").getBytes();
|
||||
socket.getOutputStream().write(b);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
if (!done.get()) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -422,7 +425,8 @@ public class TcpSendingMessageHandlerTests extends AbstractTcpChannelAdapterTest
|
||||
b = ("\u0000\u0000\u0000\u0006Reply" + (++i)).getBytes();
|
||||
socket.getOutputStream().write(b);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
if (!done.get()) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -543,7 +547,8 @@ public class TcpSendingMessageHandlerTests extends AbstractTcpChannelAdapterTest
|
||||
ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
|
||||
oos.writeObject("Reply" + (++i));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
if (!done.get()) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -599,7 +604,8 @@ public class TcpSendingMessageHandlerTests extends AbstractTcpChannelAdapterTest
|
||||
ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
|
||||
oos.writeObject("Reply" + (++i));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
if (!done.get()) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -660,7 +666,8 @@ public class TcpSendingMessageHandlerTests extends AbstractTcpChannelAdapterTest
|
||||
socket.close();
|
||||
}
|
||||
server.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
if (!done.get()) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -711,7 +718,8 @@ public class TcpSendingMessageHandlerTests extends AbstractTcpChannelAdapterTest
|
||||
socket.close();
|
||||
}
|
||||
server.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
if (!done.get()) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -763,7 +771,8 @@ public class TcpSendingMessageHandlerTests extends AbstractTcpChannelAdapterTest
|
||||
socket.close();
|
||||
}
|
||||
server.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
if (!done.get()) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -827,7 +836,8 @@ public class TcpSendingMessageHandlerTests extends AbstractTcpChannelAdapterTest
|
||||
socket.close();
|
||||
}
|
||||
server.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
if (!done.get()) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -942,7 +952,8 @@ public class TcpSendingMessageHandlerTests extends AbstractTcpChannelAdapterTest
|
||||
for (i = 100; i < 200; i++) {
|
||||
handler.handleMessage(MessageBuilder.withPayload("Test" + i).build());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
fail("Exception at " + i);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.springframework.integration.ip.tcp;
|
||||
|
||||
/**
|
||||
* Simple echo service.
|
||||
*
|
||||
*
|
||||
* @author Gary Russell
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -269,7 +269,7 @@ public class ConnectionTimeoutTests {
|
||||
final CountDownLatch clientClosedLatch;
|
||||
clientClosedLatch = new CountDownLatch(1);
|
||||
client.setApplicationEventPublisher(new ApplicationEventPublisher() {
|
||||
|
||||
|
||||
@Override
|
||||
public void publishEvent(ApplicationEvent event) {
|
||||
if (event instanceof TcpConnectionCloseEvent) {
|
||||
@@ -279,9 +279,9 @@ public class ConnectionTimeoutTests {
|
||||
|
||||
@Override
|
||||
public void publishEvent(Object event) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
return clientClosedLatch;
|
||||
}
|
||||
|
||||
@@ -63,9 +63,9 @@ public class TcpNetConnectionTests {
|
||||
|
||||
@Override
|
||||
public void publishEvent(Object event) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
@Test
|
||||
@@ -102,7 +102,7 @@ public class TcpNetConnectionTests {
|
||||
Socket socket = mock(Socket.class);
|
||||
when(socketChannel.socket()).thenReturn(socket);
|
||||
TcpNioConnection connection = new TcpNioConnection(socketChannel, true, false, nullPublisher, null);
|
||||
ChannelInputStream inputStream =
|
||||
ChannelInputStream inputStream =
|
||||
TestUtils.getPropertyValue(connection, "channelInputStream", ChannelInputStream.class);
|
||||
inputStream.write(new byte[] {(byte) 0x80}, 1);
|
||||
assertEquals(0x80, inputStream.read());
|
||||
@@ -155,5 +155,5 @@ public class TcpNetConnectionTests {
|
||||
assertEquals("foo", inboundMessage.get().getPayload());
|
||||
assertEquals("baz", inboundMessage.get().getHeaders().get("bar"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -170,7 +170,8 @@ public class DeserializationTests {
|
||||
try {
|
||||
serializer.deserialize(socket.getInputStream());
|
||||
fail("Expected message length exceeded exception");
|
||||
} catch (IOException e) {
|
||||
}
|
||||
catch (IOException e) {
|
||||
if (!e.getMessage().startsWith("Message length")) {
|
||||
e.printStackTrace();
|
||||
fail("Unexpected IO Error:" + e.getMessage());
|
||||
@@ -192,7 +193,8 @@ public class DeserializationTests {
|
||||
try {
|
||||
serializer.deserialize(socket.getInputStream());
|
||||
fail("Expected timeout exception");
|
||||
} catch (IOException e) {
|
||||
}
|
||||
catch (IOException e) {
|
||||
if (!e.getMessage().startsWith("Read timed out")) {
|
||||
e.printStackTrace();
|
||||
fail("Unexpected IO Error:" + e.getMessage());
|
||||
@@ -215,7 +217,8 @@ public class DeserializationTests {
|
||||
try {
|
||||
serializer.deserialize(socket.getInputStream());
|
||||
fail("Expected message length exceeded exception");
|
||||
} catch (IOException e) {
|
||||
}
|
||||
catch (IOException e) {
|
||||
if (!e.getMessage().startsWith("ETX not found")) {
|
||||
e.printStackTrace();
|
||||
fail("Unexpected IO Error:" + e.getMessage());
|
||||
@@ -237,7 +240,8 @@ public class DeserializationTests {
|
||||
try {
|
||||
serializer.deserialize(socket.getInputStream());
|
||||
fail("Expected timout exception");
|
||||
} catch (IOException e) {
|
||||
}
|
||||
catch (IOException e) {
|
||||
if (!e.getMessage().startsWith("Read timed out")) {
|
||||
e.printStackTrace();
|
||||
fail("Unexpected IO Error:" + e.getMessage());
|
||||
|
||||
@@ -38,10 +38,10 @@ public class LenghtHeaderSerializationTests {
|
||||
private static final String TEST = "Test";
|
||||
private String test255;
|
||||
private String testFFFF;
|
||||
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
char[] chars = new char[255];
|
||||
char[] chars = new char[255];
|
||||
Arrays.fill(chars, 'x');
|
||||
test255 = new String(chars);
|
||||
chars = new char[0xffff];
|
||||
@@ -67,7 +67,8 @@ public class LenghtHeaderSerializationTests {
|
||||
try {
|
||||
bytes = serializer.deserialize(bis);
|
||||
fail("Expected negative length");
|
||||
} catch (IllegalArgumentException e) { }
|
||||
}
|
||||
catch (IllegalArgumentException e) { }
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -85,7 +86,8 @@ public class LenghtHeaderSerializationTests {
|
||||
try {
|
||||
serializer.serialize(test255.getBytes(), bos);
|
||||
fail("Expected overflow");
|
||||
} catch (IllegalArgumentException e) { }
|
||||
}
|
||||
catch (IllegalArgumentException e) { }
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -95,7 +97,7 @@ public class LenghtHeaderSerializationTests {
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
serializer.serialize(test255.getBytes(), bos);
|
||||
byte[] bytes = bos.toByteArray();
|
||||
assertEquals(0, bytes[0]);
|
||||
assertEquals(0, bytes[0]);
|
||||
assertEquals(test255.length(), bytes[1] & 0xff);
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
|
||||
bytes = serializer.deserialize(bis);
|
||||
@@ -119,7 +121,8 @@ public class LenghtHeaderSerializationTests {
|
||||
try {
|
||||
serializer.serialize(testFFFF.getBytes(), bos);
|
||||
fail("Expected overflow");
|
||||
} catch (IllegalArgumentException e) { }
|
||||
}
|
||||
catch (IllegalArgumentException e) { }
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -127,7 +130,8 @@ public class LenghtHeaderSerializationTests {
|
||||
try {
|
||||
new ByteArrayLengthHeaderSerializer(23);
|
||||
fail("Expected illegal argument exception");
|
||||
} catch (IllegalArgumentException e) { }
|
||||
}
|
||||
catch (IllegalArgumentException e) { }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +195,8 @@ public class UdpChannelAdapterTests {
|
||||
socket.receive(answer);
|
||||
theAnswer.set(answer);
|
||||
replyReceivedLatch.countDown();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -127,7 +127,8 @@ public class UdpMulticastEndToEndTests implements Runnable {
|
||||
catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} catch (MessagingException e) {
|
||||
}
|
||||
catch (MessagingException e) {
|
||||
// no multicast this host
|
||||
e.printStackTrace();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user