DefaultFrontendSession extends AbstractSession implements FrontendSession { @Override protected void doInitialize() throws Exception { super.doInitialize(); onSessionInit(); } DefaultFrontendSession(Tunnel tunnel, Channel channel, long trafficReportIntervalMillis); @Override SESSION_TYPE getSessionType(); @Override SessionState getSessionState(); @Override SessionMonitor getSessionMonitor();  }
@Test public void testDoInitialize() throws Exception { session.addSessionEventHandler(new SessionEventHandler() { @Override public void onInit() { session.markUnReadable(); } @Override public void onEstablished() { } @Override public void onWritable() { } @Override public void onNotWritable() { } }); Assert.assertTrue(channel.config().isAutoRead()); session.doInitialize(); Assert.assertFalse(channel.config().isAutoRead()); }