@Test public void onDisconnect() { final Connector connector = createConnector(); connector.pauseMessageScheduler(); pauseScheduler(); newConnection( connector ); final TransportContextImpl context = new TransportContextImpl( connector ); safeAction( () -> connector.setState( ConnectorState.CONNECTED ) ); final TestSpyEventHandler handler = registerTestSpyEventHandler(); context.onDisconnect(); assertEquals( connector.getState(), ConnectorState.DISCONNECTED ); handler.assertEventCount( 1 ); handler.assertNextEvent( DisconnectedEvent.class ); }
@Override public void onDisconnect() { if ( isNotDisposed() ) { _connector.onDisconnection(); } }
TransportContextImpl implements TransportContext, Disposable { @Override public void onDisconnect() { if ( isNotDisposed() ) { _connector.onDisconnection(); } } }
TransportContextImpl implements TransportContext, Disposable { @Override public void onDisconnect() { if ( isNotDisposed() ) { _connector.onDisconnection(); } } TransportContextImpl( @Nonnull final Connector connector ); }
TransportContextImpl implements TransportContext, Disposable { @Override public void onDisconnect() { if ( isNotDisposed() ) { _connector.onDisconnection(); } } TransportContextImpl( @Nonnull final Connector connector ); @Override void dispose(); @Override boolean isDisposed(); @Override int newRequestId( @Nullable final String name, final boolean syncRequest ); @Override void onMessageReceived( @Nonnull final ServerToClientMessage message ); @Override void onError(); @Override void onDisconnect(); }
TransportContextImpl implements TransportContext, Disposable { @Override public void onDisconnect() { if ( isNotDisposed() ) { _connector.onDisconnection(); } } TransportContextImpl( @Nonnull final Connector connector ); @Override void dispose(); @Override boolean isDisposed(); @Override int newRequestId( @Nullable final String name, final boolean syncRequest ); @Override void onMessageReceived( @Nonnull final ServerToClientMessage message ); @Override void onError(); @Override void onDisconnect();  }