checkstyle fixes.

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
This commit is contained in:
olivier lamy 2019-08-23 13:09:15 +10:00
parent 80d513e979
commit cf592469aa
10 changed files with 38 additions and 39 deletions

View File

@ -107,18 +107,18 @@ public class WriteTimeoutTest
@ServerEndpoint("/logSocket") @ServerEndpoint("/logSocket")
public static class LoggingSocket public static class LoggingSocket
{ {
private final Logger LOG = Log.getLogger(LoggingSocket.class); private final Logger log = Log.getLogger(LoggingSocket.class);
@OnMessage @OnMessage
public void onMessage(String msg) public void onMessage(String msg)
{ {
LOG.debug("onMessage(): {}", msg); log.debug("onMessage(): {}", msg);
} }
@OnError @OnError
public void onError(Throwable t) public void onError(Throwable t)
{ {
LOG.debug("onError(): {}", t); log.debug("onError(): {}", t);
} }
} }
} }

View File

@ -30,7 +30,7 @@ import javax.websocket.EndpointConfig;
*/ */
public class TimeEncoder implements Encoder.Text<Date> public class TimeEncoder implements Encoder.Text<Date>
{ {
private TimeZone GMT = TimeZone.getTimeZone("GMT"); private static final TimeZone GMT = TimeZone.getTimeZone("GMT");
@Override @Override
public String encode(Date object) throws EncodeException public String encode(Date object) throws EncodeException

View File

@ -324,14 +324,14 @@ public class PrimitivesTextEchoTest
addCase(data, LongEchoSocket.class, Long.toString(0), "0"); addCase(data, LongEchoSocket.class, Long.toString(0), "0");
addCase(data, LongEchoSocket.class, Long.toString(100_000), "100000"); addCase(data, LongEchoSocket.class, Long.toString(100_000), "100000");
addCase(data, LongEchoSocket.class, Long.toString(-2_000_000), "-2000000"); addCase(data, LongEchoSocket.class, Long.toString(-2_000_000), "-2000000");
addCase(data, LongEchoSocket.class, Long.toString(300_000_000_000l), "300000000000"); addCase(data, LongEchoSocket.class, Long.toString(300_000_000_000L), "300000000000");
addCase(data, LongEchoSocket.class, Long.toString(Long.MAX_VALUE), Long.toString(Long.MAX_VALUE)); addCase(data, LongEchoSocket.class, Long.toString(Long.MAX_VALUE), Long.toString(Long.MAX_VALUE));
addCase(data, LongEchoSocket.class, Long.toString(Long.MIN_VALUE), Long.toString(Long.MIN_VALUE)); addCase(data, LongEchoSocket.class, Long.toString(Long.MIN_VALUE), Long.toString(Long.MIN_VALUE));
addCase(data, LongObjEchoSocket.class, Long.toString(0), "0"); addCase(data, LongObjEchoSocket.class, Long.toString(0), "0");
addCase(data, LongObjEchoSocket.class, Long.toString(100_000), "100000"); addCase(data, LongObjEchoSocket.class, Long.toString(100_000), "100000");
addCase(data, LongObjEchoSocket.class, Long.toString(-2_000_000), "-2000000"); addCase(data, LongObjEchoSocket.class, Long.toString(-2_000_000), "-2000000");
addCase(data, LongObjEchoSocket.class, Long.toString(300_000_000_000l), "300000000000"); addCase(data, LongObjEchoSocket.class, Long.toString(300_000_000_000L), "300000000000");
addCase(data, LongObjEchoSocket.class, Long.toString(Long.MAX_VALUE), Long.toString(Long.MAX_VALUE)); addCase(data, LongObjEchoSocket.class, Long.toString(Long.MAX_VALUE), Long.toString(Long.MAX_VALUE));
addCase(data, LongObjEchoSocket.class, Long.toString(Long.MIN_VALUE), Long.toString(Long.MIN_VALUE)); addCase(data, LongObjEchoSocket.class, Long.toString(Long.MIN_VALUE), Long.toString(Long.MIN_VALUE));

View File

@ -98,7 +98,7 @@ public class ParserTest
* From Autobahn WebSocket Server Testcase 1.2.2 * From Autobahn WebSocket Server Testcase 1.2.2
*/ */
@Test @Test
public void testParse_Binary_125BytePayload() throws InterruptedException public void testParseBinary125BytePayload() throws InterruptedException
{ {
int length = 125; int length = 125;
@ -128,7 +128,7 @@ public class ParserTest
* From Autobahn WebSocket Server Testcase 1.2.3 * From Autobahn WebSocket Server Testcase 1.2.3
*/ */
@Test @Test
public void testParse_Binary_126BytePayload() throws InterruptedException public void testParseBinary126BytePayload() throws InterruptedException
{ {
int length = 126; int length = 126;
@ -161,7 +161,7 @@ public class ParserTest
* From Autobahn WebSocket Server Testcase 1.2.4 * From Autobahn WebSocket Server Testcase 1.2.4
*/ */
@Test @Test
public void testParse_Binary_127BytePayload() throws InterruptedException public void testParseBinary127BytePayload() throws InterruptedException
{ {
int length = 127; int length = 127;
@ -193,7 +193,7 @@ public class ParserTest
* From Autobahn WebSocket Server Testcase 1.2.5 * From Autobahn WebSocket Server Testcase 1.2.5
*/ */
@Test @Test
public void testParse_Binary_128BytePayload() throws InterruptedException public void testParseBinary128BytePayload() throws InterruptedException
{ {
int length = 128; int length = 128;
@ -225,7 +225,7 @@ public class ParserTest
* From Autobahn WebSocket Server Testcase 1.2.6 * From Autobahn WebSocket Server Testcase 1.2.6
*/ */
@Test @Test
public void testParse_Binary_65535BytePayload() throws InterruptedException public void testParseBinary65535BytePayload() throws InterruptedException
{ {
int length = 65535; int length = 65535;
@ -257,7 +257,7 @@ public class ParserTest
* From Autobahn WebSocket Server Testcase 1.2.7 * From Autobahn WebSocket Server Testcase 1.2.7
*/ */
@Test @Test
public void testParse_Binary_65536BytePayload() throws InterruptedException public void testParseBinary65536BytePayload() throws InterruptedException
{ {
int length = 65536; int length = 65536;

View File

@ -39,7 +39,7 @@ public class RawFrameBuilder
buf.put(b); buf.put(b);
} }
public static void putLengthAndMask(ByteBuffer buf, int length, byte mask[]) public static void putLengthAndMask(ByteBuffer buf, int length, byte[] mask)
{ {
if (mask != null) if (mask != null)
{ {
@ -53,7 +53,7 @@ public class RawFrameBuilder
} }
} }
public static void mask(final byte[] data, final byte mask[]) public static void mask(final byte[] data, final byte[] mask)
{ {
assertThat("Mask.length", mask.length, is(4)); assertThat("Mask.length", mask.length, is(4));
int len = data.length; int len = data.length;
@ -96,7 +96,7 @@ public class RawFrameBuilder
} }
} }
public static void putMask(ByteBuffer buf, byte mask[]) public static void putMask(ByteBuffer buf, byte[] mask)
{ {
assertThat("Mask.length", mask.length, is(4)); assertThat("Mask.length", mask.length, is(4));
buf.put(mask); buf.put(mask);

View File

@ -29,7 +29,7 @@ import org.eclipse.jetty.util.log.Logger;
public class TestMessageHandler extends MessageHandler public class TestMessageHandler extends MessageHandler
{ {
protected final Logger LOG = Log.getLogger(TestMessageHandler.class); protected static final Logger LOG = Log.getLogger(TestMessageHandler.class);
public CoreSession coreSession; public CoreSession coreSession;
public BlockingQueue<String> textMessages = new BlockingArrayQueue<>(); public BlockingQueue<String> textMessages = new BlockingArrayQueue<>();

View File

@ -79,7 +79,7 @@ public class PerMessageDeflateExtensionTest extends AbstractExtensionTest
* Section 8.2.3.1: A message compressed using 1 compressed DEFLATE block * Section 8.2.3.1: A message compressed using 1 compressed DEFLATE block
*/ */
@Test @Test
public void testDraft21_Hello_UnCompressedBlock() public void testDraft21HelloUnCompressedBlock()
{ {
ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate"); ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate");
@ -100,7 +100,7 @@ public class PerMessageDeflateExtensionTest extends AbstractExtensionTest
* Section 8.2.3.1: A message compressed using 1 compressed DEFLATE block (with fragmentation) * Section 8.2.3.1: A message compressed using 1 compressed DEFLATE block (with fragmentation)
*/ */
@Test @Test
public void testDraft21_Hello_UnCompressedBlock_Fragmented() public void testDraft21HelloUnCompressedBlockFragmented()
{ {
ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate"); ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate");
@ -123,7 +123,7 @@ public class PerMessageDeflateExtensionTest extends AbstractExtensionTest
* Section 8.2.3.2: Sharing LZ77 Sliding Window * Section 8.2.3.2: Sharing LZ77 Sliding Window
*/ */
@Test @Test
public void testDraft21_SharingL77SlidingWindow_ContextTakeover() public void testDraft21SharingL77SlidingWindowContextTakeover()
{ {
ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate"); ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate");
@ -146,7 +146,7 @@ public class PerMessageDeflateExtensionTest extends AbstractExtensionTest
* Section 8.2.3.2: Sharing LZ77 Sliding Window * Section 8.2.3.2: Sharing LZ77 Sliding Window
*/ */
@Test @Test
public void testDraft21_SharingL77SlidingWindow_NoContextTakeover() public void testDraft21SharingL77SlidingWindowNoContextTakeover()
{ {
ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate"); ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate");
@ -170,7 +170,7 @@ public class PerMessageDeflateExtensionTest extends AbstractExtensionTest
* Section 8.2.3.3: Using a DEFLATE Block with No Compression * Section 8.2.3.3: Using a DEFLATE Block with No Compression
*/ */
@Test @Test
public void testDraft21_DeflateBlockWithNoCompression() public void testDraft21DeflateBlockWithNoCompression()
{ {
ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate"); ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate");
@ -189,7 +189,7 @@ public class PerMessageDeflateExtensionTest extends AbstractExtensionTest
* Section 8.2.3.4: Using a DEFLATE Block with BFINAL Set to 1 * Section 8.2.3.4: Using a DEFLATE Block with BFINAL Set to 1
*/ */
@Test @Test
public void testDraft21_DeflateBlockWithBFinal1() public void testDraft21DeflateBlockWithBFinal1()
{ {
ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate"); ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate");
@ -209,7 +209,7 @@ public class PerMessageDeflateExtensionTest extends AbstractExtensionTest
* Section 8.2.3.5: Two DEFLATE Blocks in 1 Message * Section 8.2.3.5: Two DEFLATE Blocks in 1 Message
*/ */
@Test @Test
public void testDraft21_TwoDeflateBlocksOneMessage() public void testDraft21TwoDeflateBlocksOneMessage()
{ {
ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate"); ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate");
@ -227,7 +227,7 @@ public class PerMessageDeflateExtensionTest extends AbstractExtensionTest
* Decode fragmented message (3 parts: TEXT, CONTINUATION, CONTINUATION) * Decode fragmented message (3 parts: TEXT, CONTINUATION, CONTINUATION)
*/ */
@Test @Test
public void testParseFragmentedMessage_Good() public void testParseFragmentedMessageGood()
{ {
ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate"); ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate");
@ -256,7 +256,7 @@ public class PerMessageDeflateExtensionTest extends AbstractExtensionTest
* </p> * </p>
*/ */
@Test @Test
public void testParseFragmentedMessage_BadRsv1() public void testParseFragmentedMessageBadRsv1()
{ {
ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate"); ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate");
@ -489,7 +489,7 @@ public class PerMessageDeflateExtensionTest extends AbstractExtensionTest
} }
@Test @Test
public void testPyWebSocket_Client_NoContextTakeover_ThreeOra() public void testPyWebSocketClientNoContextTakeoverThreeOra()
{ {
ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate; client_max_window_bits; client_no_context_takeover"); ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate; client_max_window_bits; client_no_context_takeover");
@ -507,7 +507,7 @@ public class PerMessageDeflateExtensionTest extends AbstractExtensionTest
} }
@Test @Test
public void testPyWebSocket_Client_ToraToraTora() public void testPyWebSocketClientToraToraTora()
{ {
ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate; client_max_window_bits"); ExtensionTool.Tester tester = clientExtensions.newTester("permessage-deflate; client_max_window_bits");
@ -525,7 +525,7 @@ public class PerMessageDeflateExtensionTest extends AbstractExtensionTest
} }
@Test @Test
public void testPyWebSocket_Server_NoContextTakeover_ThreeOra() public void testPyWebSocketServerNoContextTakeoverThreeOra()
{ {
ExtensionTool.Tester tester = serverExtensions.newTester("permessage-deflate; client_max_window_bits; client_no_context_takeover"); ExtensionTool.Tester tester = serverExtensions.newTester("permessage-deflate; client_max_window_bits; client_no_context_takeover");
@ -543,7 +543,7 @@ public class PerMessageDeflateExtensionTest extends AbstractExtensionTest
} }
@Test @Test
public void testPyWebSocket_Server_ToraToraTora() public void testPyWebSocketServerToraToraTora()
{ {
ExtensionTool.Tester tester = serverExtensions.newTester("permessage-deflate; client_max_window_bits"); ExtensionTool.Tester tester = serverExtensions.newTester("permessage-deflate; client_max_window_bits");

View File

@ -221,7 +221,6 @@ public class WebSocketProxyTest
assertThat(closeStatus.getReason(), containsString("Failed to upgrade to websocket: Unexpected HTTP Response Status Code:")); assertThat(closeStatus.getReason(), containsString("Failed to upgrade to websocket: Unexpected HTTP Response Status Code:"));
} }
@Test @Test
public void testClientError() throws Exception public void testClientError() throws Exception
{ {