Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message')
-rw-r--r--jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/MessageWriterTest.java7
-rw-r--r--jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/TrackingInputStreamSocket.java10
2 files changed, 10 insertions, 7 deletions
diff --git a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/MessageWriterTest.java b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/MessageWriterTest.java
index 43f68ecf00..d65214ec7c 100644
--- a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/MessageWriterTest.java
+++ b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/MessageWriterTest.java
@@ -18,8 +18,6 @@
package org.eclipse.jetty.websocket.common.message;
-import static org.hamcrest.Matchers.is;
-
import java.util.Arrays;
import org.eclipse.jetty.io.MappedByteBufferPool;
@@ -40,6 +38,8 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
+import static org.hamcrest.Matchers.is;
+
public class MessageWriterTest
{
private static final Logger LOG = Log.getLogger(MessageWriterTest.class);
@@ -122,7 +122,8 @@ public class MessageWriterTest
{
int bufsize = (int)(policy.getMaxTextMessageBufferSize() * 2.5);
char buf[] = new char[bufsize];
- LOG.debug("Buffer size: {}",bufsize);
+ if (LOG.isDebugEnabled())
+ LOG.debug("Buffer size: {}",bufsize);
Arrays.fill(buf,'x');
buf[bufsize - 1] = 'o'; // mark last entry for debugging
diff --git a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/TrackingInputStreamSocket.java b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/TrackingInputStreamSocket.java
index e552ab4293..8aa4b09012 100644
--- a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/TrackingInputStreamSocket.java
+++ b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/message/TrackingInputStreamSocket.java
@@ -18,8 +18,6 @@
package org.eclipse.jetty.websocket.common.message;
-import static org.hamcrest.Matchers.is;
-
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.CountDownLatch;
@@ -35,6 +33,8 @@ import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage;
import org.eclipse.jetty.websocket.api.annotations.WebSocket;
import org.junit.Assert;
+import static org.hamcrest.Matchers.is;
+
@WebSocket
public class TrackingInputStreamSocket
{
@@ -76,7 +76,8 @@ public class TrackingInputStreamSocket
@OnWebSocketClose
public void onClose(int statusCode, String reason)
{
- LOG.debug("{} onClose({},{})",id,statusCode,reason);
+ if (LOG.isDebugEnabled())
+ LOG.debug("{} onClose({},{})",id,statusCode,reason);
closeCode = statusCode;
closeMessage.append(reason);
closeLatch.countDown();
@@ -91,7 +92,8 @@ public class TrackingInputStreamSocket
@OnWebSocketMessage
public void onInputStream(InputStream stream)
{
- LOG.debug("{} onInputStream({})",id,stream);
+ if (LOG.isDebugEnabled())
+ LOG.debug("{} onInputStream({})",id,stream);
try
{
String msg = IO.toString(stream);

Back to the top