diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandler.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandler.java index 8bc142cb6c..7f88d08c2f 100644 --- a/codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandler.java +++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2ConnectionHandler.java @@ -45,7 +45,7 @@ import java.util.List; * as well as management of connection state and flow control for both inbound and outbound data * frames. *
- * Subclasses need to implement the methods defined by the {@link Http2FrameObserver} interface for + * Subclasses need to implement the methods defined by the {@link Http2FrameListener} interface for * receiving inbound frames. Outbound frames are sent via one of the {@code writeXXX} methods. *
* It should be noted that the connection preface is sent upon either activation or addition of this
@@ -53,9 +53,9 @@ import java.util.List;
* must call this class to write the preface to the remote endpoint.
*/
public abstract class AbstractHttp2ConnectionHandler extends ByteToMessageDecoder implements
- Http2FrameObserver {
+ Http2FrameListener {
- private final Http2FrameObserver internalFrameObserver = new FrameReadObserver();
+ private final Http2FrameListener internalFrameListener = new FrameReadListener();
private final Http2FrameReader frameReader;
private final Http2FrameWriter frameWriter;
private final Http2Connection connection;
@@ -539,7 +539,7 @@ public abstract class AbstractHttp2ConnectionHandler extends ByteToMessageDecode
return;
}
- frameReader.readFrame(ctx, in, internalFrameObserver);
+ frameReader.readFrame(ctx, in, internalFrameListener);
} catch (Http2Exception e) {
onHttp2Exception(ctx, e);
} catch (Throwable e) {
@@ -812,7 +812,7 @@ public abstract class AbstractHttp2ConnectionHandler extends ByteToMessageDecode
/**
* Handles all inbound frames from the network.
*/
- private final class FrameReadObserver implements Http2FrameObserver {
+ private final class FrameReadListener implements Http2FrameListener {
@Override
public void onDataRead(final ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding,
diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Connection.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Connection.java
index ddc4bdf1df..24210e1216 100644
--- a/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Connection.java
+++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/DefaultHttp2Connection.java
@@ -153,7 +153,7 @@ public class DefaultHttp2Connection implements Http2Connection {
}
private void removeStream(DefaultStream stream) {
- // Notify the observers of the event first.
+ // Notify the listeners of the event first.
for (Listener listener : listeners) {
listener.streamRemoved(stream);
}
@@ -724,7 +724,7 @@ public class DefaultHttp2Connection implements Http2Connection {
List
* Exposes all {@code writeXXX} methods as public and delegates all frame read events to a provided
- * {@link Http2FrameObserver}.
+ * {@link Http2FrameListener}.
*
* The {@link #channelActive} and {@link #handlerAdded} should called when appropriate to ensure
* that the initial SETTINGS frame is sent to the remote endpoint.
*/
public class DelegatingHttp2ConnectionHandler extends AbstractHttp2ConnectionHandler {
- private final Http2FrameObserver observer;
+ private final Http2FrameListener listener;
- public DelegatingHttp2ConnectionHandler(boolean server, Http2FrameObserver observer) {
+ public DelegatingHttp2ConnectionHandler(boolean server, Http2FrameListener listener) {
super(server);
- this.observer = observer;
+ this.listener = listener;
}
public DelegatingHttp2ConnectionHandler(Http2Connection connection,
Http2FrameReader frameReader, Http2FrameWriter frameWriter,
Http2InboundFlowController inboundFlow, Http2OutboundFlowController outboundFlow,
- Http2FrameObserver observer) {
+ Http2FrameListener listener) {
super(connection, frameReader, frameWriter, inboundFlow, outboundFlow);
- this.observer = observer;
+ this.listener = listener;
}
- public DelegatingHttp2ConnectionHandler(Http2Connection connection, Http2FrameObserver observer) {
+ public DelegatingHttp2ConnectionHandler(Http2Connection connection, Http2FrameListener listener) {
super(connection);
- this.observer = observer;
+ this.listener = listener;
}
@Override
@@ -103,70 +103,70 @@ public class DelegatingHttp2ConnectionHandler extends AbstractHttp2ConnectionHan
@Override
public void onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding,
boolean endOfStream) throws Http2Exception {
- observer.onDataRead(ctx, streamId, data, padding, endOfStream);
+ listener.onDataRead(ctx, streamId, data, padding, endOfStream);
}
@Override
public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers,
int streamDependency, short weight, boolean exclusive, int padding, boolean endStream)
throws Http2Exception {
- observer.onHeadersRead(ctx, streamId, headers, streamDependency, weight, exclusive,
+ listener.onHeadersRead(ctx, streamId, headers, streamDependency, weight, exclusive,
padding, endStream);
}
@Override
public void onPriorityRead(ChannelHandlerContext ctx, int streamId, int streamDependency,
short weight, boolean exclusive) throws Http2Exception {
- observer.onPriorityRead(ctx, streamId, streamDependency, weight, exclusive);
+ listener.onPriorityRead(ctx, streamId, streamDependency, weight, exclusive);
}
@Override
public void onRstStreamRead(ChannelHandlerContext ctx, int streamId, long errorCode)
throws Http2Exception {
- observer.onRstStreamRead(ctx, streamId, errorCode);
+ listener.onRstStreamRead(ctx, streamId, errorCode);
}
@Override
public void onSettingsAckRead(ChannelHandlerContext ctx) throws Http2Exception {
- observer.onSettingsAckRead(ctx);
+ listener.onSettingsAckRead(ctx);
}
@Override
public void onSettingsRead(ChannelHandlerContext ctx, Http2Settings settings) throws Http2Exception {
- observer.onSettingsRead(ctx, settings);
+ listener.onSettingsRead(ctx, settings);
}
@Override
public void onPingRead(ChannelHandlerContext ctx, ByteBuf data) throws Http2Exception {
- observer.onPingRead(ctx, data);
+ listener.onPingRead(ctx, data);
}
@Override
public void onPingAckRead(ChannelHandlerContext ctx, ByteBuf data) throws Http2Exception {
- observer.onPingAckRead(ctx, data);
+ listener.onPingAckRead(ctx, data);
}
@Override
public void onPushPromiseRead(ChannelHandlerContext ctx, int streamId, int promisedStreamId,
Http2Headers headers, int padding) throws Http2Exception {
- observer.onPushPromiseRead(ctx, streamId, promisedStreamId, headers, padding);
+ listener.onPushPromiseRead(ctx, streamId, promisedStreamId, headers, padding);
}
@Override
public void onGoAwayRead(ChannelHandlerContext ctx, int lastStreamId, long errorCode, ByteBuf debugData)
throws Http2Exception {
- observer.onGoAwayRead(ctx, lastStreamId, errorCode, debugData);
+ listener.onGoAwayRead(ctx, lastStreamId, errorCode, debugData);
}
@Override
public void onWindowUpdateRead(ChannelHandlerContext ctx, int streamId, int windowSizeIncrement)
throws Http2Exception {
- observer.onWindowUpdateRead(ctx, streamId, windowSizeIncrement);
+ listener.onWindowUpdateRead(ctx, streamId, windowSizeIncrement);
}
@Override
public void onUnknownFrame(ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags,
ByteBuf payload) {
- observer.onUnknownFrame(ctx, frameType, streamId, flags, payload);
+ listener.onUnknownFrame(ctx, frameType, streamId, flags, payload);
}
}
diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/DelegatingHttp2HttpConnectionHandler.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/DelegatingHttp2HttpConnectionHandler.java
index 197d3a2a7d..d1778eed3a 100644
--- a/codec-http2/src/main/java/io/netty/handler/codec/http2/DelegatingHttp2HttpConnectionHandler.java
+++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/DelegatingHttp2HttpConnectionHandler.java
@@ -31,18 +31,18 @@ import java.util.Map;
*/
public class DelegatingHttp2HttpConnectionHandler extends DelegatingHttp2ConnectionHandler {
- public DelegatingHttp2HttpConnectionHandler(boolean server, Http2FrameObserver observer) {
- super(server, observer);
+ public DelegatingHttp2HttpConnectionHandler(boolean server, Http2FrameListener listener) {
+ super(server, listener);
}
public DelegatingHttp2HttpConnectionHandler(Http2Connection connection, Http2FrameReader frameReader,
Http2FrameWriter frameWriter, Http2InboundFlowController inboundFlow,
- Http2OutboundFlowController outboundFlow, Http2FrameObserver observer) {
- super(connection, frameReader, frameWriter, inboundFlow, outboundFlow, observer);
+ Http2OutboundFlowController outboundFlow, Http2FrameListener listener) {
+ super(connection, frameReader, frameWriter, inboundFlow, outboundFlow, listener);
}
- public DelegatingHttp2HttpConnectionHandler(Http2Connection connection, Http2FrameObserver observer) {
- super(connection, observer);
+ public DelegatingHttp2HttpConnectionHandler(Http2Connection connection, Http2FrameListener listener) {
+ super(connection, listener);
}
/**
diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2DataObserver.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2DataListener.java
similarity index 92%
rename from codec-http2/src/main/java/io/netty/handler/codec/http2/Http2DataObserver.java
rename to codec-http2/src/main/java/io/netty/handler/codec/http2/Http2DataListener.java
index 6c6f402c24..b32bb2170f 100644
--- a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2DataObserver.java
+++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2DataListener.java
@@ -18,16 +18,16 @@ import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
/**
- * An observer of HTTP/2 {@code DATA} frames.
+ * An listener of HTTP/2 {@code DATA} frames.
*/
-public interface Http2DataObserver {
+public interface Http2DataListener {
/**
* Handles an inbound {@code DATA} frame.
*
* @param ctx the context from the handler where the frame was read.
* @param streamId the subject stream for the frame.
- * @param data payload buffer for the frame. If this buffer needs to be retained by the observer
+ * @param data payload buffer for the frame. If this buffer needs to be retained by the listener
* they must make a copy.
* @param padding the number of padding bytes found at the end of the frame.
* @param endOfStream Indicates whether this is the last frame to be sent from the remote
diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2EventAdapter.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2EventAdapter.java
index 0dc623f93e..db9f5ec438 100644
--- a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2EventAdapter.java
+++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2EventAdapter.java
@@ -18,10 +18,10 @@ import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
/**
- * This class brings {@link Http2Connection.Listener} and {@link Http2FrameObserver} together to provide
+ * This class brings {@link Http2Connection.Listener} and {@link Http2FrameListener} together to provide
* NOOP implementation so inheriting classes can selectively choose which methods to override.
*/
-public class Http2EventAdapter implements Http2Connection.Listener, Http2FrameObserver {
+public class Http2EventAdapter implements Http2Connection.Listener, Http2FrameListener {
@Override
public void onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream)
throws Http2Exception {
diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameAdapter.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameAdapter.java
index ff129c6895..190aa3e267 100644
--- a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameAdapter.java
+++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameAdapter.java
@@ -18,9 +18,9 @@ import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
/**
- * Convenience class that provides no-op implementations for all methods of {@link Http2FrameObserver}.
+ * Convenience class that provides no-op implementations for all methods of {@link Http2FrameListener}.
*/
-public class Http2FrameAdapter implements Http2FrameObserver {
+public class Http2FrameAdapter implements Http2FrameListener {
@Override
public void onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding,
diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameObserver.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameListener.java
similarity index 97%
rename from codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameObserver.java
rename to codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameListener.java
index 5b00b3b5ac..4ade646914 100644
--- a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameObserver.java
+++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameListener.java
@@ -19,9 +19,9 @@ import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
/**
- * An observer of HTTP/2 frames.
+ * An listener of HTTP/2 frames.
*/
-public interface Http2FrameObserver extends Http2DataObserver {
+public interface Http2FrameListener extends Http2DataListener {
/**
* Handles an inbound HEADERS frame.
@@ -117,7 +117,7 @@ public interface Http2FrameObserver extends Http2DataObserver {
* Handles an inbound PING frame.
*
* @param ctx the context from the handler where the frame was read.
- * @param data the payload of the frame. If this buffer needs to be retained by the observer
+ * @param data the payload of the frame. If this buffer needs to be retained by the listener
* they must make a copy.
*/
void onPingRead(ChannelHandlerContext ctx, ByteBuf data) throws Http2Exception;
@@ -126,7 +126,7 @@ public interface Http2FrameObserver extends Http2DataObserver {
* Handles an inbound PING acknowledgment.
*
* @param ctx the context from the handler where the frame was read.
- * @param data the payload of the frame. If this buffer needs to be retained by the observer
+ * @param data the payload of the frame. If this buffer needs to be retained by the listener
* they must make a copy.
*/
void onPingAckRead(ChannelHandlerContext ctx, ByteBuf data) throws Http2Exception;
@@ -162,7 +162,7 @@ public interface Http2FrameObserver extends Http2DataObserver {
* @param lastStreamId the last known stream of the remote endpoint.
* @param errorCode the error code, if abnormal closure.
* @param debugData application-defined debug data. If this buffer needs to be retained by the
- * observer they must make a copy.
+ * listener they must make a copy.
*/
void onGoAwayRead(ChannelHandlerContext ctx, int lastStreamId, long errorCode, ByteBuf debugData)
throws Http2Exception;
diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameReader.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameReader.java
index 414c52c291..716e5980a7 100644
--- a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameReader.java
+++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameReader.java
@@ -22,15 +22,15 @@ import java.io.Closeable;
/**
* Reads HTTP/2 frames from an input {@link ByteBuf} and notifies the specified
- * {@link Http2FrameObserver} when frames are complete.
+ * {@link Http2FrameListener} when frames are complete.
*/
public interface Http2FrameReader extends Closeable {
/**
* Attempts to read the next frame from the input buffer. If enough data is available to fully
- * read the frame, notifies the observer of the read frame.
+ * read the frame, notifies the listener of the read frame.
*/
- void readFrame(ChannelHandlerContext ctx, ByteBuf input, Http2FrameObserver observer)
+ void readFrame(ChannelHandlerContext ctx, ByteBuf input, Http2FrameListener listener)
throws Http2Exception;
/**
diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2InboundFlowController.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2InboundFlowController.java
index 2fc31ebed7..af5c3c24d9 100644
--- a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2InboundFlowController.java
+++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2InboundFlowController.java
@@ -18,7 +18,7 @@ package io.netty.handler.codec.http2;
/**
* Controls the inbound flow of data frames from the remote endpoint.
*/
-public interface Http2InboundFlowController extends Http2DataObserver {
+public interface Http2InboundFlowController extends Http2DataListener {
/**
* Sets the initial inbound flow control window size and updates all stream window sizes by the
diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2InboundFrameLogger.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2InboundFrameLogger.java
index c7699555a6..8a3bea5883 100644
--- a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2InboundFrameLogger.java
+++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2InboundFrameLogger.java
@@ -21,7 +21,7 @@ import io.netty.channel.ChannelHandlerContext;
/**
* Decorator around a {@link Http2FrameReader} that logs all inbound frames before calling
- * back the observer.
+ * back the listener.
*/
public class Http2InboundFrameLogger implements Http2FrameReader {
@@ -40,16 +40,16 @@ public class Http2InboundFrameLogger implements Http2FrameReader {
}
@Override
- public void readFrame(ChannelHandlerContext ctx, ByteBuf input, final Http2FrameObserver observer)
+ public void readFrame(ChannelHandlerContext ctx, ByteBuf input, final Http2FrameListener listener)
throws Http2Exception {
- reader.readFrame(ctx, input, new Http2FrameObserver() {
+ reader.readFrame(ctx, input, new Http2FrameListener() {
@Override
public void onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data,
int padding, boolean endOfStream)
throws Http2Exception {
logger.logData(INBOUND, streamId, data, padding, endOfStream);
- observer.onDataRead(ctx, streamId, data, padding, endOfStream);
+ listener.onDataRead(ctx, streamId, data, padding, endOfStream);
}
@Override
@@ -57,7 +57,7 @@ public class Http2InboundFrameLogger implements Http2FrameReader {
Http2Headers headers, int padding, boolean endStream)
throws Http2Exception {
logger.logHeaders(INBOUND, streamId, headers, padding, endStream);
- observer.onHeadersRead(ctx, streamId, headers, padding, endStream);
+ listener.onHeadersRead(ctx, streamId, headers, padding, endStream);
}
@Override
@@ -66,7 +66,7 @@ public class Http2InboundFrameLogger implements Http2FrameReader {
int padding, boolean endStream) throws Http2Exception {
logger.logHeaders(INBOUND, streamId, headers, streamDependency, weight, exclusive,
padding, endStream);
- observer.onHeadersRead(ctx, streamId, headers, streamDependency, weight, exclusive,
+ listener.onHeadersRead(ctx, streamId, headers, streamDependency, weight, exclusive,
padding, endStream);
}
@@ -74,67 +74,67 @@ public class Http2InboundFrameLogger implements Http2FrameReader {
public void onPriorityRead(ChannelHandlerContext ctx, int streamId,
int streamDependency, short weight, boolean exclusive) throws Http2Exception {
logger.logPriority(INBOUND, streamId, streamDependency, weight, exclusive);
- observer.onPriorityRead(ctx, streamId, streamDependency, weight, exclusive);
+ listener.onPriorityRead(ctx, streamId, streamDependency, weight, exclusive);
}
@Override
public void onRstStreamRead(ChannelHandlerContext ctx, int streamId, long errorCode)
throws Http2Exception {
logger.logRstStream(INBOUND, streamId, errorCode);
- observer.onRstStreamRead(ctx, streamId, errorCode);
+ listener.onRstStreamRead(ctx, streamId, errorCode);
}
@Override
public void onSettingsAckRead(ChannelHandlerContext ctx) throws Http2Exception {
logger.logSettingsAck(INBOUND);
- observer.onSettingsAckRead(ctx);
+ listener.onSettingsAckRead(ctx);
}
@Override
public void onSettingsRead(ChannelHandlerContext ctx, Http2Settings settings)
throws Http2Exception {
logger.logSettings(INBOUND, settings);
- observer.onSettingsRead(ctx, settings);
+ listener.onSettingsRead(ctx, settings);
}
@Override
public void onPingRead(ChannelHandlerContext ctx, ByteBuf data) throws Http2Exception {
logger.logPing(INBOUND, data);
- observer.onPingRead(ctx, data);
+ listener.onPingRead(ctx, data);
}
@Override
public void onPingAckRead(ChannelHandlerContext ctx, ByteBuf data) throws Http2Exception {
logger.logPingAck(INBOUND, data);
- observer.onPingAckRead(ctx, data);
+ listener.onPingAckRead(ctx, data);
}
@Override
public void onPushPromiseRead(ChannelHandlerContext ctx, int streamId,
int promisedStreamId, Http2Headers headers, int padding) throws Http2Exception {
logger.logPushPromise(INBOUND, streamId, promisedStreamId, headers, padding);
- observer.onPushPromiseRead(ctx, streamId, promisedStreamId, headers, padding);
+ listener.onPushPromiseRead(ctx, streamId, promisedStreamId, headers, padding);
}
@Override
public void onGoAwayRead(ChannelHandlerContext ctx, int lastStreamId, long errorCode,
ByteBuf debugData) throws Http2Exception {
logger.logGoAway(INBOUND, lastStreamId, errorCode, debugData);
- observer.onGoAwayRead(ctx, lastStreamId, errorCode, debugData);
+ listener.onGoAwayRead(ctx, lastStreamId, errorCode, debugData);
}
@Override
public void onWindowUpdateRead(ChannelHandlerContext ctx, int streamId, int windowSizeIncrement)
throws Http2Exception {
logger.logWindowsUpdate(INBOUND, streamId, windowSizeIncrement);
- observer.onWindowUpdateRead(ctx, streamId, windowSizeIncrement);
+ listener.onWindowUpdateRead(ctx, streamId, windowSizeIncrement);
}
@Override
public void onUnknownFrame(ChannelHandlerContext ctx, byte frameType, int streamId,
Http2Flags flags, ByteBuf payload) {
logger.logUnknownFrame(INBOUND, frameType, streamId, flags, payload);
- observer.onUnknownFrame(ctx, frameType, streamId, flags, payload);
+ listener.onUnknownFrame(ctx, frameType, streamId, flags, payload);
}
});
}
diff --git a/codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2FrameIOTest.java b/codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2FrameIOTest.java
index 992f8f4b11..ef578b1db2 100644
--- a/codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2FrameIOTest.java
+++ b/codec-http2/src/test/java/io/netty/handler/codec/http2/DefaultHttp2FrameIOTest.java
@@ -47,7 +47,7 @@ public class DefaultHttp2FrameIOTest {
private ChannelHandlerContext ctx;
@Mock
- private Http2FrameObserver observer;
+ private Http2FrameListener listener;
@Mock
private ChannelPromise promise;
@@ -70,8 +70,8 @@ public class DefaultHttp2FrameIOTest {
writer.writeData(ctx, 1000, data, 0, false, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onDataRead(eq(ctx), eq(1000), eq(data), eq(0), eq(false));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onDataRead(eq(ctx), eq(1000), eq(data), eq(0), eq(false));
frame.release();
}
@@ -81,8 +81,8 @@ public class DefaultHttp2FrameIOTest {
writer.writeData(ctx, 1000, data.retain().duplicate(), 0, false, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onDataRead(eq(ctx), eq(1000), eq(data), eq(0), eq(false));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onDataRead(eq(ctx), eq(1000), eq(data), eq(0), eq(false));
frame.release();
}
@@ -92,8 +92,8 @@ public class DefaultHttp2FrameIOTest {
writer.writeData(ctx, 1, data.retain().duplicate(), 0xFF, true, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onDataRead(eq(ctx), eq(1), eq(data), eq(0xFF), eq(true));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onDataRead(eq(ctx), eq(1), eq(data), eq(0xFF), eq(true));
frame.release();
}
@@ -102,8 +102,8 @@ public class DefaultHttp2FrameIOTest {
writer.writePriority(ctx, 1, 2, (short) 255, true, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onPriorityRead(eq(ctx), eq(1), eq(2), eq((short) 255), eq(true));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onPriorityRead(eq(ctx), eq(1), eq(2), eq((short) 255), eq(true));
frame.release();
}
@@ -112,8 +112,8 @@ public class DefaultHttp2FrameIOTest {
writer.writeRstStream(ctx, 1, MAX_UNSIGNED_INT, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onRstStreamRead(eq(ctx), eq(1), eq(MAX_UNSIGNED_INT));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onRstStreamRead(eq(ctx), eq(1), eq(MAX_UNSIGNED_INT));
frame.release();
}
@@ -122,8 +122,8 @@ public class DefaultHttp2FrameIOTest {
writer.writeSettings(ctx, new Http2Settings(), promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onSettingsRead(eq(ctx), eq(new Http2Settings()));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onSettingsRead(eq(ctx), eq(new Http2Settings()));
frame.release();
}
@@ -138,8 +138,8 @@ public class DefaultHttp2FrameIOTest {
writer.writeSettings(ctx, settings, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onSettingsRead(eq(ctx), eq(settings));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onSettingsRead(eq(ctx), eq(settings));
frame.release();
}
@@ -148,8 +148,8 @@ public class DefaultHttp2FrameIOTest {
writer.writeSettingsAck(ctx, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onSettingsAckRead(eq(ctx));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onSettingsAckRead(eq(ctx));
frame.release();
}
@@ -159,8 +159,8 @@ public class DefaultHttp2FrameIOTest {
writer.writePing(ctx, false, data.retain().duplicate(), promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onPingRead(eq(ctx), eq(data));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onPingRead(eq(ctx), eq(data));
frame.release();
}
@@ -170,8 +170,8 @@ public class DefaultHttp2FrameIOTest {
writer.writePing(ctx, true, data.retain().duplicate(), promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onPingAckRead(eq(ctx), eq(data));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onPingAckRead(eq(ctx), eq(data));
frame.release();
}
@@ -180,8 +180,8 @@ public class DefaultHttp2FrameIOTest {
ByteBuf data = dummyData();
writer.writeGoAway(ctx, 1, MAX_UNSIGNED_INT, data.retain().duplicate(), promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onGoAwayRead(eq(ctx), eq(1), eq(MAX_UNSIGNED_INT), eq(data));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onGoAwayRead(eq(ctx), eq(1), eq(MAX_UNSIGNED_INT), eq(data));
frame.release();
}
@@ -189,8 +189,8 @@ public class DefaultHttp2FrameIOTest {
public void windowUpdateShouldRoundtrip() throws Exception {
writer.writeWindowUpdate(ctx, 1, Integer.MAX_VALUE, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onWindowUpdateRead(eq(ctx), eq(1), eq(Integer.MAX_VALUE));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onWindowUpdateRead(eq(ctx), eq(1), eq(Integer.MAX_VALUE));
frame.release();
}
@@ -199,8 +199,8 @@ public class DefaultHttp2FrameIOTest {
Http2Headers headers = Http2Headers.EMPTY_HEADERS;
writer.writeHeaders(ctx, 1, headers, 0, true, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onHeadersRead(eq(ctx), eq(1), eq(headers), eq(0), eq(true));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onHeadersRead(eq(ctx), eq(1), eq(headers), eq(0), eq(true));
frame.release();
}
@@ -209,8 +209,8 @@ public class DefaultHttp2FrameIOTest {
Http2Headers headers = Http2Headers.EMPTY_HEADERS;
writer.writeHeaders(ctx, 1, headers, 0xFF, true, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onHeadersRead(eq(ctx), eq(1), eq(headers), eq(0xFF), eq(true));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onHeadersRead(eq(ctx), eq(1), eq(headers), eq(0xFF), eq(true));
frame.release();
}
@@ -219,8 +219,8 @@ public class DefaultHttp2FrameIOTest {
Http2Headers headers = dummyHeaders();
writer.writeHeaders(ctx, 1, headers, 0, true, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onHeadersRead(eq(ctx), eq(1), eq(headers), eq(0), eq(true));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onHeadersRead(eq(ctx), eq(1), eq(headers), eq(0), eq(true));
frame.release();
}
@@ -229,8 +229,8 @@ public class DefaultHttp2FrameIOTest {
Http2Headers headers = dummyHeaders();
writer.writeHeaders(ctx, 1, headers, 0xFF, true, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onHeadersRead(eq(ctx), eq(1), eq(headers), eq(0xFF), eq(true));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onHeadersRead(eq(ctx), eq(1), eq(headers), eq(0xFF), eq(true));
frame.release();
}
@@ -239,8 +239,8 @@ public class DefaultHttp2FrameIOTest {
Http2Headers headers = dummyHeaders();
writer.writeHeaders(ctx, 1, headers, 2, (short) 3, true, 0, true, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onHeadersRead(eq(ctx), eq(1), eq(headers), eq(2), eq((short) 3), eq(true), eq(0),
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onHeadersRead(eq(ctx), eq(1), eq(headers), eq(2), eq((short) 3), eq(true), eq(0),
eq(true));
frame.release();
}
@@ -250,8 +250,8 @@ public class DefaultHttp2FrameIOTest {
Http2Headers headers = dummyHeaders();
writer.writeHeaders(ctx, 1, headers, 2, (short) 3, true, 0xFF, true, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onHeadersRead(eq(ctx), eq(1), eq(headers), eq(2), eq((short) 3), eq(true), eq(0xFF),
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onHeadersRead(eq(ctx), eq(1), eq(headers), eq(2), eq((short) 3), eq(true), eq(0xFF),
eq(true));
frame.release();
}
@@ -261,8 +261,8 @@ public class DefaultHttp2FrameIOTest {
Http2Headers headers = largeHeaders();
writer.writeHeaders(ctx, 1, headers, 2, (short) 3, true, 0, true, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onHeadersRead(eq(ctx), eq(1), eq(headers), eq(2), eq((short) 3), eq(true), eq(0),
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onHeadersRead(eq(ctx), eq(1), eq(headers), eq(2), eq((short) 3), eq(true), eq(0),
eq(true));
frame.release();
}
@@ -272,8 +272,8 @@ public class DefaultHttp2FrameIOTest {
Http2Headers headers = largeHeaders();
writer.writeHeaders(ctx, 1, headers, 2, (short) 3, true, 0xFF, true, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onHeadersRead(eq(ctx), eq(1), eq(headers), eq(2), eq((short) 3), eq(true), eq(0xFF),
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onHeadersRead(eq(ctx), eq(1), eq(headers), eq(2), eq((short) 3), eq(true), eq(0xFF),
eq(true));
frame.release();
}
@@ -283,8 +283,8 @@ public class DefaultHttp2FrameIOTest {
Http2Headers headers = Http2Headers.EMPTY_HEADERS;
writer.writePushPromise(ctx, 1, 2, headers, 0, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onPushPromiseRead(eq(ctx), eq(1), eq(2), eq(headers), eq(0));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onPushPromiseRead(eq(ctx), eq(1), eq(2), eq(headers), eq(0));
frame.release();
}
@@ -293,8 +293,8 @@ public class DefaultHttp2FrameIOTest {
Http2Headers headers = dummyHeaders();
writer.writePushPromise(ctx, 1, 2, headers, 0, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onPushPromiseRead(eq(ctx), eq(1), eq(2), eq(headers), eq(0));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onPushPromiseRead(eq(ctx), eq(1), eq(2), eq(headers), eq(0));
frame.release();
}
@@ -303,8 +303,8 @@ public class DefaultHttp2FrameIOTest {
Http2Headers headers = dummyHeaders();
writer.writePushPromise(ctx, 1, 2, headers, 0xFF, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onPushPromiseRead(eq(ctx), eq(1), eq(2), eq(headers), eq(0xFF));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onPushPromiseRead(eq(ctx), eq(1), eq(2), eq(headers), eq(0xFF));
frame.release();
}
@@ -313,8 +313,8 @@ public class DefaultHttp2FrameIOTest {
Http2Headers headers = largeHeaders();
writer.writePushPromise(ctx, 1, 2, headers, 0, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onPushPromiseRead(eq(ctx), eq(1), eq(2), eq(headers), eq(0));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onPushPromiseRead(eq(ctx), eq(1), eq(2), eq(headers), eq(0));
frame.release();
}
@@ -323,8 +323,8 @@ public class DefaultHttp2FrameIOTest {
Http2Headers headers = largeHeaders();
writer.writePushPromise(ctx, 1, 2, headers, 0xFF, promise);
ByteBuf frame = captureWrite();
- reader.readFrame(ctx, frame, observer);
- verify(observer).onPushPromiseRead(eq(ctx), eq(1), eq(2), eq(headers), eq(0xFF));
+ reader.readFrame(ctx, frame, listener);
+ verify(listener).onPushPromiseRead(eq(ctx), eq(1), eq(2), eq(headers), eq(0xFF));
frame.release();
}
diff --git a/codec-http2/src/test/java/io/netty/handler/codec/http2/DelegatingHttp2ConnectionHandlerTest.java b/codec-http2/src/test/java/io/netty/handler/codec/http2/DelegatingHttp2ConnectionHandlerTest.java
index 7960da38b4..c113689cc6 100644
--- a/codec-http2/src/test/java/io/netty/handler/codec/http2/DelegatingHttp2ConnectionHandlerTest.java
+++ b/codec-http2/src/test/java/io/netty/handler/codec/http2/DelegatingHttp2ConnectionHandlerTest.java
@@ -104,7 +104,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
private Http2Stream pushStream;
@Mock
- private Http2FrameObserver observer;
+ private Http2FrameListener listener;
@Mock
private Http2FrameReader reader;
@@ -139,7 +139,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
handler =
new DelegatingHttp2ConnectionHandler(connection, reader, writer, inboundFlow,
- outboundFlow, observer);
+ outboundFlow, listener);
// Simulate activation of the handler to force writing the initial settings.
Http2Settings settings = new Http2Settings();
@@ -162,7 +162,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
// Simulate receiving the initial settings from the remote endpoint.
decode().onSettingsRead(ctx, new Http2Settings());
- verify(observer).onSettingsRead(eq(ctx), eq(new Http2Settings()));
+ verify(listener).onSettingsRead(eq(ctx), eq(new Http2Settings()));
verify(writer).writeSettingsAck(eq(ctx), eq(promise));
// Simulate receiving the SETTINGS ACK for the initial settings.
@@ -182,7 +182,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
public void clientShouldSendClientPrefaceStringWhenActive() throws Exception {
when(connection.isServer()).thenReturn(false);
handler = new DelegatingHttp2ConnectionHandler(connection, reader, writer, inboundFlow,
- outboundFlow, observer);
+ outboundFlow, listener);
handler.channelActive(ctx);
verify(ctx).write(eq(connectionPrefaceBuf()));
}
@@ -191,7 +191,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
public void serverShouldNotSendClientPrefaceStringWhenActive() throws Exception {
when(connection.isServer()).thenReturn(true);
handler = new DelegatingHttp2ConnectionHandler(connection, reader, writer, inboundFlow,
- outboundFlow, observer);
+ outboundFlow, listener);
handler.channelActive(ctx);
verify(ctx, never()).write(eq(connectionPrefaceBuf()));
}
@@ -200,21 +200,21 @@ public class DelegatingHttp2ConnectionHandlerTest {
public void serverReceivingInvalidClientPrefaceStringShouldCloseConnection() throws Exception {
when(connection.isServer()).thenReturn(true);
handler = new DelegatingHttp2ConnectionHandler(connection, reader, writer, inboundFlow,
- outboundFlow, observer);
+ outboundFlow, listener);
handler.channelRead(ctx, copiedBuffer("BAD_PREFACE", UTF_8));
verify(ctx).close();
}
@Test
public void serverReceivingValidClientPrefaceStringShouldContinueReadingFrames() throws Exception {
- reset(observer);
+ reset(listener);
when(connection.isServer()).thenReturn(true);
handler = new DelegatingHttp2ConnectionHandler(connection, reader, writer, inboundFlow,
- outboundFlow, observer);
+ outboundFlow, listener);
handler.channelRead(ctx, connectionPrefaceBuf());
verify(ctx, never()).close();
decode().onSettingsRead(ctx, new Http2Settings());
- verify(observer).onSettingsRead(eq(ctx), eq(new Http2Settings()));
+ verify(listener).onSettingsRead(eq(ctx), eq(new Http2Settings()));
}
@Test
@@ -257,7 +257,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
verify(inboundFlow).onDataRead(eq(ctx), eq(STREAM_ID), eq(dummyData()), eq(10), eq(true));
// Verify that the event was absorbed and not propagated to the oberver.
- verify(observer, never()).onDataRead(eq(ctx), anyInt(), any(ByteBuf.class), anyInt(),
+ verify(listener, never()).onDataRead(eq(ctx), anyInt(), any(ByteBuf.class), anyInt(),
anyBoolean());
}
@@ -266,7 +266,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
decode().onDataRead(ctx, STREAM_ID, dummyData(), 10, true);
verify(inboundFlow).onDataRead(eq(ctx), eq(STREAM_ID), eq(dummyData()), eq(10), eq(true));
verify(stream).closeRemoteSide();
- verify(observer).onDataRead(eq(ctx), eq(STREAM_ID), eq(dummyData()), eq(10), eq(true));
+ verify(listener).onDataRead(eq(ctx), eq(STREAM_ID), eq(dummyData()), eq(10), eq(true));
}
@Test
@@ -276,7 +276,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
verify(remote, never()).createStream(eq(STREAM_ID), eq(false));
// Verify that the event was absorbed and not propagated to the oberver.
- verify(observer, never()).onHeadersRead(eq(ctx), anyInt(), any(Http2Headers.class),
+ verify(listener, never()).onHeadersRead(eq(ctx), anyInt(), any(Http2Headers.class),
anyInt(), anyBoolean());
verify(remote, never()).createStream(anyInt(), anyBoolean());
}
@@ -286,7 +286,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
when(remote.createStream(eq(5), eq(false))).thenReturn(stream);
decode().onHeadersRead(ctx, 5, EMPTY_HEADERS, 0, false);
verify(remote).createStream(eq(5), eq(false));
- verify(observer).onHeadersRead(eq(ctx), eq(5), eq(EMPTY_HEADERS), eq(0),
+ verify(listener).onHeadersRead(eq(ctx), eq(5), eq(EMPTY_HEADERS), eq(0),
eq(DEFAULT_PRIORITY_WEIGHT), eq(false), eq(0), eq(false));
}
@@ -295,7 +295,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
when(remote.createStream(eq(5), eq(true))).thenReturn(stream);
decode().onHeadersRead(ctx, 5, EMPTY_HEADERS, 0, true);
verify(remote).createStream(eq(5), eq(true));
- verify(observer).onHeadersRead(eq(ctx), eq(5), eq(EMPTY_HEADERS), eq(0),
+ verify(listener).onHeadersRead(eq(ctx), eq(5), eq(EMPTY_HEADERS), eq(0),
eq(DEFAULT_PRIORITY_WEIGHT), eq(false), eq(0), eq(true));
}
@@ -304,7 +304,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
when(stream.state()).thenReturn(RESERVED_REMOTE);
decode().onHeadersRead(ctx, STREAM_ID, EMPTY_HEADERS, 0, false);
verify(stream).openForPush();
- verify(observer).onHeadersRead(eq(ctx), eq(STREAM_ID), eq(EMPTY_HEADERS), eq(0),
+ verify(listener).onHeadersRead(eq(ctx), eq(STREAM_ID), eq(EMPTY_HEADERS), eq(0),
eq(DEFAULT_PRIORITY_WEIGHT), eq(false), eq(0), eq(false));
}
@@ -314,7 +314,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
decode().onHeadersRead(ctx, STREAM_ID, EMPTY_HEADERS, 0, true);
verify(stream).openForPush();
verify(stream).close();
- verify(observer).onHeadersRead(eq(ctx), eq(STREAM_ID), eq(EMPTY_HEADERS), eq(0),
+ verify(listener).onHeadersRead(eq(ctx), eq(STREAM_ID), eq(EMPTY_HEADERS), eq(0),
eq(DEFAULT_PRIORITY_WEIGHT), eq(false), eq(0), eq(true));
}
@@ -323,7 +323,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
when(remote.isGoAwayReceived()).thenReturn(true);
decode().onPushPromiseRead(ctx, STREAM_ID, PUSH_STREAM_ID, EMPTY_HEADERS, 0);
verify(remote, never()).reservePushStream(anyInt(), any(Http2Stream.class));
- verify(observer, never()).onPushPromiseRead(eq(ctx), anyInt(), anyInt(),
+ verify(listener, never()).onPushPromiseRead(eq(ctx), anyInt(), anyInt(),
any(Http2Headers.class), anyInt());
}
@@ -331,7 +331,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
public void pushPromiseReadShouldSucceed() throws Exception {
decode().onPushPromiseRead(ctx, STREAM_ID, PUSH_STREAM_ID, EMPTY_HEADERS, 0);
verify(remote).reservePushStream(eq(PUSH_STREAM_ID), eq(stream));
- verify(observer).onPushPromiseRead(eq(ctx), eq(STREAM_ID), eq(PUSH_STREAM_ID),
+ verify(listener).onPushPromiseRead(eq(ctx), eq(STREAM_ID), eq(PUSH_STREAM_ID),
eq(EMPTY_HEADERS), eq(0));
}
@@ -340,14 +340,14 @@ public class DelegatingHttp2ConnectionHandlerTest {
when(remote.isGoAwayReceived()).thenReturn(true);
decode().onPriorityRead(ctx, STREAM_ID, 0, (short) 255, true);
verify(stream, never()).setPriority(anyInt(), anyShort(), anyBoolean());
- verify(observer, never()).onPriorityRead(eq(ctx), anyInt(), anyInt(), anyShort(), anyBoolean());
+ verify(listener, never()).onPriorityRead(eq(ctx), anyInt(), anyInt(), anyShort(), anyBoolean());
}
@Test
public void priorityReadShouldSucceed() throws Exception {
decode().onPriorityRead(ctx, STREAM_ID, 0, (short) 255, true);
verify(stream).setPriority(eq(0), eq((short) 255), eq(true));
- verify(observer).onPriorityRead(eq(ctx), eq(STREAM_ID), eq(0), eq((short) 255), eq(true));
+ verify(listener).onPriorityRead(eq(ctx), eq(STREAM_ID), eq(0), eq((short) 255), eq(true));
}
@Test
@@ -355,7 +355,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
when(remote.isGoAwayReceived()).thenReturn(true);
decode().onWindowUpdateRead(ctx, STREAM_ID, 10);
verify(outboundFlow, never()).updateOutboundWindowSize(anyInt(), anyInt());
- verify(observer, never()).onWindowUpdateRead(eq(ctx), anyInt(), anyInt());
+ verify(listener, never()).onWindowUpdateRead(eq(ctx), anyInt(), anyInt());
}
@Test(expected = Http2Exception.class)
@@ -368,7 +368,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
public void windowUpdateReadShouldSucceed() throws Exception {
decode().onWindowUpdateRead(ctx, STREAM_ID, 10);
verify(outboundFlow).updateOutboundWindowSize(eq(STREAM_ID), eq(10));
- verify(observer).onWindowUpdateRead(eq(ctx), eq(STREAM_ID), eq(10));
+ verify(listener).onWindowUpdateRead(eq(ctx), eq(STREAM_ID), eq(10));
}
@Test
@@ -376,7 +376,7 @@ public class DelegatingHttp2ConnectionHandlerTest {
when(remote.isGoAwayReceived()).thenReturn(true);
decode().onRstStreamRead(ctx, STREAM_ID, PROTOCOL_ERROR.code());
verify(stream).close();
- verify(observer).onRstStreamRead(eq(ctx), anyInt(), anyLong());
+ verify(listener).onRstStreamRead(eq(ctx), anyInt(), anyLong());
}
@Test(expected = Http2Exception.class)
@@ -389,27 +389,27 @@ public class DelegatingHttp2ConnectionHandlerTest {
public void rstStreamReadShouldCloseStream() throws Exception {
decode().onRstStreamRead(ctx, STREAM_ID, PROTOCOL_ERROR.code());
verify(stream).close();
- verify(observer).onRstStreamRead(eq(ctx), eq(STREAM_ID), eq((long) PROTOCOL_ERROR.code()));
+ verify(listener).onRstStreamRead(eq(ctx), eq(STREAM_ID), eq((long) PROTOCOL_ERROR.code()));
}
@Test
- public void pingReadWithAckShouldNotifyObserver() throws Exception {
+ public void pingReadWithAckShouldNotifylistener() throws Exception {
decode().onPingAckRead(ctx, emptyPingBuf());
- verify(observer).onPingAckRead(eq(ctx), eq(emptyPingBuf()));
+ verify(listener).onPingAckRead(eq(ctx), eq(emptyPingBuf()));
}
@Test
public void pingReadShouldReplyWithAck() throws Exception {
decode().onPingRead(ctx, emptyPingBuf());
verify(writer).writePing(eq(ctx), eq(true), eq(emptyPingBuf()), eq(promise));
- verify(observer, never()).onPingAckRead(eq(ctx), any(ByteBuf.class));
+ verify(listener, never()).onPingAckRead(eq(ctx), any(ByteBuf.class));
}
@Test
- public void settingsReadWithAckShouldNotifyObserver() throws Exception {
+ public void settingsReadWithAckShouldNotifylistener() throws Exception {
decode().onSettingsAckRead(ctx);
// Take into account the time this was called during setup().
- verify(observer, times(2)).onSettingsAckRead(eq(ctx));
+ verify(listener, times(2)).onSettingsAckRead(eq(ctx));
}
@Test(expected = Http2Exception.class)
@@ -435,14 +435,14 @@ public class DelegatingHttp2ConnectionHandlerTest {
verify(writer).maxHeaderTableSize(789L);
// Take into account the time this was called during setup().
verify(writer, times(2)).writeSettingsAck(eq(ctx), eq(promise));
- verify(observer).onSettingsRead(eq(ctx), eq(settings));
+ verify(listener).onSettingsRead(eq(ctx), eq(settings));
}
@Test
public void goAwayShouldReadShouldUpdateConnectionState() throws Exception {
decode().onGoAwayRead(ctx, 1, 2L, EMPTY_BUFFER);
verify(local).goAwayReceived(1);
- verify(observer).onGoAwayRead(eq(ctx), eq(1), eq(2L), eq(EMPTY_BUFFER));
+ verify(listener).onGoAwayRead(eq(ctx), eq(1), eq(2L), eq(EMPTY_BUFFER));
}
@Test
@@ -608,13 +608,13 @@ public class DelegatingHttp2ConnectionHandlerTest {
}
/**
- * Calls the decode method on the handler and gets back the captured internal observer
+ * Calls the decode method on the handler and gets back the captured internal listener
*/
- private Http2FrameObserver decode() throws Exception {
- ArgumentCaptor