@Test public void connect() { pauseScheduler(); final Connector connector = createConnector(); assertEquals( connector.getState(), ConnectorState.DISCONNECTED ); safeAction( connector::connect ); verify( connector.getTransport() ).requestConnect( any( TransportContext.class ) ); assertEquals( connector.getState(), ConnectorState.CONNECTING ); }
void connect() { final ConnectorState state = getState(); if ( ConnectorState.CONNECTING != state && ConnectorState.CONNECTED != state ) { ConnectorState newState = ConnectorState.ERROR; try { Disposable.dispose( _context ); _context = new TransportContextImpl( this ); _transport.requestConnect( _context ); newState = ConnectorState.CONNECTING; } finally { setState( newState ); } } }
Connector extends ReplicantService { void connect() { final ConnectorState state = getState(); if ( ConnectorState.CONNECTING != state && ConnectorState.CONNECTED != state ) { ConnectorState newState = ConnectorState.ERROR; try { Disposable.dispose( _context ); _context = new TransportContextImpl( this ); _transport.requestConnect( _context ); newState = ConnectorState.CONNECTING; } finally { setState( newState ); } } } }
Connector extends ReplicantService { void connect() { final ConnectorState state = getState(); if ( ConnectorState.CONNECTING != state && ConnectorState.CONNECTED != state ) { ConnectorState newState = ConnectorState.ERROR; try { Disposable.dispose( _context ); _context = new TransportContextImpl( this ); _transport.requestConnect( _context ); newState = ConnectorState.CONNECTING; } finally { setState( newState ); } } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); }
Connector extends ReplicantService { void connect() { final ConnectorState state = getState(); if ( ConnectorState.CONNECTING != state && ConnectorState.CONNECTED != state ) { ConnectorState newState = ConnectorState.ERROR; try { Disposable.dispose( _context ); _context = new TransportContextImpl( this ); _transport.requestConnect( _context ); newState = ConnectorState.CONNECTING; } finally { setState( newState ); } } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString(); }
Connector extends ReplicantService { void connect() { final ConnectorState state = getState(); if ( ConnectorState.CONNECTING != state && ConnectorState.CONNECTED != state ) { ConnectorState newState = ConnectorState.ERROR; try { Disposable.dispose( _context ); _context = new TransportContextImpl( this ); _transport.requestConnect( _context ); newState = ConnectorState.CONNECTING; } finally { setState( newState ); } } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString();  }