NettyHttpDatabusRelayConnection extends AbstractNettyHttpConnection implements DatabusRelayConnection { @Override public int getMaxEventVersion() { return _maxEventVersion; } NettyHttpDatabusRelayConnection(ServerInfo relay,
                                         ActorMessageQueue callback,
                                         ClientBootstrap bootstrap,
                                         ContainerStatisticsCollector containerStatsCollector,
                                         RemoteExceptionHandler remoteExceptionHandler,
                                         Timer timeoutTimer,
                                         long writeTimeoutMs,
                                         long readTimeoutMs,
                                         int protocolVersion,
                                         int maxEventVersion,
                                         ChannelGroup channelGroup);  NettyHttpDatabusRelayConnection(ServerInfo relay,
                                         ActorMessageQueue callback,
                                         ChannelFactory channelFactory,
                                         ContainerStatisticsCollector containerStatsCollector,
                                         RemoteExceptionHandler remoteExceptionHandler,
                                         Timer timeoutTimer,
                                         long writeTimeoutMs,
                                         long readTimeoutMs,
                                         int protocolVersion,
                                         int maxEventVersion,
                                         ChannelGroup channelGroup); boolean isEnableReadFromLatestSCN(); @Override void requestSources(DatabusRelayConnectionStateMessage stateReuse); @Override void requestRegister(String sourcesIdList, DatabusRelayConnectionStateMessage stateReuse); @Override void requestStream(String sourcesSubsList, DbusKeyCompositeFilter filter,
                            int freeBufferSpace, CheckpointMult cp, Range keyRange,
                            DatabusRelayConnectionStateMessage stateReuse); @Override void enableReadFromLatestScn(boolean enable); @Override int getMaxEventVersion(); static final String MODULE; static final Logger LOG; static final boolean needCompress; }
@Test public void testHappyPath() throws IOException, ScnNotFoundException, OffsetNotFoundException { final Logger log = Logger.getLogger("TestNettyHttpDatabusRelayConnection.testHappyPath"); DbusEventBuffer buf = createSimpleBuffer(); TestingConnectionCallback callback = TestingConnectionCallback.createAndStart("testHappyPath"); DummyRemoteExceptionHandler remoteExceptionHandler = new DummyRemoteExceptionHandler(); final NettyHttpDatabusRelayConnection conn = (NettyHttpDatabusRelayConnection) CONN_FACTORY.createRelayConnection(RELAY_SERVER_INFO, callback, remoteExceptionHandler); conn.getHandler().getLog().setLevel(Level.DEBUG); Assert.assertEquals(MAX_EVENT_VERSION, conn.getMaxEventVersion()); try { runHappyPathIteration(log, buf, callback, remoteExceptionHandler, conn); } finally { conn.close(); callback.shutdown(); } }