Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jetty-websocket/websocket-common/src/test/java/org/eclipse')
-rw-r--r--jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/events/EventCapture.java11
-rw-r--r--jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/io/LocalWebSocketConnection.java15
-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
4 files changed, 26 insertions, 17 deletions
diff --git a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/events/EventCapture.java b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/events/EventCapture.java
index 38451bb383..64b417dae5 100644
--- a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/events/EventCapture.java
+++ b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/events/EventCapture.java
@@ -18,10 +18,6 @@
package org.eclipse.jetty.websocket.common.events;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.startsWith;
-
import java.util.regex.Pattern;
import org.eclipse.jetty.toolchain.test.EventQueue;
@@ -29,6 +25,10 @@ import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
import org.junit.Assert;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.startsWith;
+
@SuppressWarnings("serial")
public class EventCapture extends EventQueue<String>
{
@@ -67,7 +67,8 @@ public class EventCapture extends EventQueue<String>
public void add(String format, Object... args)
{
String msg = String.format(format,args);
- LOG.debug("EVENT: {}",msg);
+ if (LOG.isDebugEnabled())
+ LOG.debug("EVENT: {}",msg);
super.offer(msg);
}
diff --git a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/io/LocalWebSocketConnection.java b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/io/LocalWebSocketConnection.java
index 2244c93cb5..e3c109b653 100644
--- a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/io/LocalWebSocketConnection.java
+++ b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/io/LocalWebSocketConnection.java
@@ -82,21 +82,24 @@ public class LocalWebSocketConnection implements LogicalConnection, IncomingFram
@Override
public void close(int statusCode, String reason)
{
- LOG.debug("close({}, {})",statusCode,reason);
+ if (LOG.isDebugEnabled())
+ LOG.debug("close({}, {})",statusCode,reason);
CloseInfo close = new CloseInfo(statusCode,reason);
ioState.onCloseLocal(close);
}
public void connect()
{
- LOG.debug("connect()");
+ if (LOG.isDebugEnabled())
+ LOG.debug("connect()");
ioState.onConnected();
}
@Override
public void disconnect()
{
- LOG.debug("disconnect()");
+ if (LOG.isDebugEnabled())
+ LOG.debug("disconnect()");
}
@Override
@@ -179,7 +182,8 @@ public class LocalWebSocketConnection implements LogicalConnection, IncomingFram
@Override
public void onConnectionStateChange(ConnectionState state)
{
- LOG.debug("Connection State Change: {}",state);
+ if (LOG.isDebugEnabled())
+ LOG.debug("Connection State Change: {}",state);
switch (state)
{
case CLOSED:
@@ -200,7 +204,8 @@ public class LocalWebSocketConnection implements LogicalConnection, IncomingFram
public void open()
{
- LOG.debug("open()");
+ if (LOG.isDebugEnabled())
+ LOG.debug("open()");
ioState.onOpened();
}
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