@Test( timeout = 1000 ) public void testRequestTimeout() throws Exception { session.setConfigProperty( ConfigurationProperties.REQUEST_TIMEOUT, 100 ); ServerSocket server = new ServerSocket( 0 ); newTransporter( "http: try { try { transporter.get( new GetTask( URI.create( "repo/file.txt" ) ) ); fail( "Expected error" ); } catch ( SocketTimeoutException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } finally { server.close(); } }
public int classify( Throwable error ) { if ( error instanceof HttpResponseException && ( (HttpResponseException) error ).getStatusCode() == HttpStatus.SC_NOT_FOUND ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; }
HttpTransporter extends AbstractTransporter { public int classify( Throwable error ) { if ( error instanceof HttpResponseException && ( (HttpResponseException) error ).getStatusCode() == HttpStatus.SC_NOT_FOUND ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; } }
HttpTransporter extends AbstractTransporter { public int classify( Throwable error ) { if ( error instanceof HttpResponseException && ( (HttpResponseException) error ).getStatusCode() == HttpStatus.SC_NOT_FOUND ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; } HttpTransporter( RemoteRepository repository, RepositorySystemSession session, Logger logger ); }
HttpTransporter extends AbstractTransporter { public int classify( Throwable error ) { if ( error instanceof HttpResponseException && ( (HttpResponseException) error ).getStatusCode() == HttpStatus.SC_NOT_FOUND ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; } HttpTransporter( RemoteRepository repository, RepositorySystemSession session, Logger logger ); int classify( Throwable error ); }
HttpTransporter extends AbstractTransporter { public int classify( Throwable error ) { if ( error instanceof HttpResponseException && ( (HttpResponseException) error ).getStatusCode() == HttpStatus.SC_NOT_FOUND ) { return ERROR_NOT_FOUND; } return ERROR_OTHER; } HttpTransporter( RemoteRepository repository, RepositorySystemSession session, Logger logger ); int classify( Throwable error );  }