@Test public void onConnected() throws Exception { final Connection connection = createConnection(); final Connector connector = connection.getConnector(); safeAction( () -> connector.setState( ConnectorState.CONNECTING ) ); assertEquals( connector.getReplicantRuntime().getState(), RuntimeState.CONNECTING ); pauseScheduler(); final Field field = Connector.class.getDeclaredField( "_connection" ); field.setAccessible( true ); field.set( connector, connection ); connector.onConnected(); assertEquals( connector.getState(), ConnectorState.CONNECTED ); assertEquals( connector.getReplicantRuntime().getState(), RuntimeState.CONNECTED ); }
@Action void onConnected() { setState( ConnectorState.CONNECTED ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy().reportSpyEvent( new ConnectedEvent( getSchema().getId(), getSchema().getName() ) ); } }
Connector extends ReplicantService { @Action void onConnected() { setState( ConnectorState.CONNECTED ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy().reportSpyEvent( new ConnectedEvent( getSchema().getId(), getSchema().getName() ) ); } } }
Connector extends ReplicantService { @Action void onConnected() { setState( ConnectorState.CONNECTED ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy().reportSpyEvent( new ConnectedEvent( getSchema().getId(), getSchema().getName() ) ); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); }
Connector extends ReplicantService { @Action void onConnected() { setState( ConnectorState.CONNECTED ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy().reportSpyEvent( new ConnectedEvent( 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 onConnected() { setState( ConnectorState.CONNECTED ); if ( Replicant.areSpiesEnabled() && getReplicantContext().getSpy().willPropagateSpyEvents() ) { getReplicantContext().getSpy().reportSpyEvent( new ConnectedEvent( getSchema().getId(), getSchema().getName() ) ); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString();  }