@Test public void onDisconnected() { final Connector connector = createConnector(); newConnection( connector ); safeAction( () -> connector.setState( ConnectorState.CONNECTING ) ); assertEquals( connector.getReplicantRuntime().getState(), RuntimeState.CONNECTING ); pauseScheduler(); reset( connector.getTransport() ); connector.onDisconnected(); assertEquals( connector.getState(), ConnectorState.DISCONNECTED ); assertEquals( connector.getReplicantRuntime().getState(), RuntimeState.DISCONNECTED ); verify( connector.getTransport() ).unbind(); }
@Action void onDisconnected() { setState( ConnectorState.DISCONNECTED ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new DisconnectedEvent( getSchema().getId(), getSchema().getName() ) ); } }
Connector extends ReplicantService { @Action void onDisconnected() { setState( ConnectorState.DISCONNECTED ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new DisconnectedEvent( getSchema().getId(), getSchema().getName() ) ); } } }
Connector extends ReplicantService { @Action void onDisconnected() { setState( ConnectorState.DISCONNECTED ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new DisconnectedEvent( getSchema().getId(), getSchema().getName() ) ); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); }
Connector extends ReplicantService { @Action void onDisconnected() { setState( ConnectorState.DISCONNECTED ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new DisconnectedEvent( getSchema().getId(), getSchema().getName() ) ); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString(); }
Connector extends ReplicantService { @Action void onDisconnected() { setState( ConnectorState.DISCONNECTED ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy() .reportSpyEvent( new DisconnectedEvent( getSchema().getId(), getSchema().getName() ) ); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString();  }