Skip to content

Commit 070b544

Browse files
Additional log messages
1 parent e816b50 commit 070b544

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

dd-java-agent/instrumentation/netty-4.1/src/test/groovy/Netty41ServerTest.groovy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ abstract class Netty41ServerTest extends HttpServerTest<EventLoopGroup> {
7878
pipeline.addLast(new WebSocketServerProtocolHandler("/websocket"))
7979
pipeline.addLast([
8080
channelRead0 : { ChannelHandlerContext ctx, msg ->
81+
System.out.println(">> onRead: ${msg}")
8182
if (msg instanceof HttpRequest) {
8283
def request = msg as HttpRequest
8384
if (is100ContinueExpected(request)) {
@@ -177,10 +178,12 @@ abstract class Netty41ServerTest extends HttpServerTest<EventLoopGroup> {
177178
userEventTriggered : { ChannelHandlerContext ctx, Object evt ->
178179
System.out.println("Received event $evt. session is ${WsEndpoint.activeSession}")
179180
if (evt instanceof WebSocketServerProtocolHandler.HandshakeComplete) {
181+
System.out.println(">> onOpen")
180182
WsEndpoint.onOpen(ctx)
181183
}
182184
},
183185
channelInactive : { ChannelHandlerContext ctx ->
186+
System.out.println(">> onClose")
184187
WsEndpoint.onClose()
185188
}
186189
] as SimpleChannelInboundHandler)
@@ -211,6 +214,7 @@ abstract class Netty41ServerTest extends HttpServerTest<EventLoopGroup> {
211214

212215
@Override
213216
void serverSendText(String[] messages) {
217+
System.out.println(">> serverSendText: ${messages.length} messages")
214218
WsEndpoint.activeSession.writeAndFlush(new TextWebSocketFrame(messages.length == 1, 0, messages[0]))
215219
for (def i = 1; i < messages.length; i++) {
216220
WsEndpoint.activeSession.writeAndFlush(new ContinuationWebSocketFrame(messages.length - 1 == i, 0, messages[i]))
@@ -219,6 +223,7 @@ abstract class Netty41ServerTest extends HttpServerTest<EventLoopGroup> {
219223

220224
@Override
221225
void serverSendBinary(byte[][] binaries) {
226+
System.out.println(">> serverSendBinary: ${binaries.length} messages")
222227
WsEndpoint.activeSession.writeAndFlush(new BinaryWebSocketFrame(binaries.length == 1, 0, Unpooled.wrappedBuffer(binaries[0])))
223228
for (def i = 1; i < binaries.length; i++) {
224229
WsEndpoint.activeSession.writeAndFlush(new ContinuationWebSocketFrame(binaries.length - 1 == i, 0, Unpooled.wrappedBuffer(binaries[i])))
@@ -227,6 +232,7 @@ abstract class Netty41ServerTest extends HttpServerTest<EventLoopGroup> {
227232

228233
@Override
229234
void serverClose() {
235+
System.out.println(">> serverClose")
230236
WsEndpoint.activeSession.writeAndFlush(new CloseWebSocketFrame(1000, null)).addListener(ChannelFutureListener.CLOSE)
231237
}
232238

0 commit comments

Comments
 (0)