Example usage for java.net SocketTimeoutException SocketTimeoutException

List of usage examples for java.net SocketTimeoutException SocketTimeoutException

Introduction

In this page you can find the example usage for java.net SocketTimeoutException SocketTimeoutException.

Prototype

public SocketTimeoutException() 

Source Link

Document

Construct a new SocketTimeoutException with no detailed message.

Usage

From source file:org.sonar.batch.bootstrap.DryRunDatabaseTest.java

@Test
public void should_fail_on_read_timeout() {
    doThrow(new SonarException(new SocketTimeoutException())).when(server)
            .download("/batch_bootstrap/db?project=group:project", databaseFile, 60000);

    thrown.expect(SonarException.class);
    thrown.expectMessage(//  www  . jav a  2 s. c  o m
            "DryRun database read timed out after 60000 ms. You can try to increase read timeout with property -Dsonar.dryRun.readTimeout (in seconds)");

    new DryRunDatabase(settings, server, tempDirectories).start();
}

From source file:org.sonar.batch.bootstrap.PreviewDatabaseTest.java

@Test
public void should_fail_on_read_timeout() {
    doThrow(new SonarException(new SocketTimeoutException())).when(server)
            .download("/batch_bootstrap/db?project=group:project", databaseFile, 60000);

    thrown.expect(SonarException.class);
    thrown.expectMessage(//w  w w. j  av  a2  s .  c o  m
            "Preview database read timed out after 60000 ms. You can try to increase read timeout with property -Dsonar.preview.readTimeout (in seconds)");

    new PreviewDatabase(settings, server, tempUtils, mode).start();
}