7
7
import org .junit .rules .ExpectedException ;
8
8
9
9
import com .aliyuncs .exceptions .ClientException ;
10
- import com .aliyuncs .http .HttpClientConfig ;
11
10
import com .aliyuncs .http .clients .ApacheHttpClient ;
12
11
13
12
public class TimeoutTest extends BaseTest {
@@ -27,7 +26,7 @@ public void testApacheHttpClientSocketTimeoutException() throws IOException, Cli
27
26
this .getReadTimeoutClientWithRegionId (regionId , 1L ).getCommonResponse (request );
28
27
request .setSysReadTimeout (10000 );
29
28
this .getReadTimeoutClientWithRegionId (regionId , 1L ).getCommonResponse (request );
30
- }
29
+ }
31
30
32
31
@ Test
33
32
public void testApacheHttpClientConnectTimeoutException () throws IOException , ClientException {
@@ -38,13 +37,12 @@ public void testApacheHttpClientConnectTimeoutException() throws IOException, Cl
38
37
this .getClientWithRegionId (regionId ).getCommonResponse (request );
39
38
ApacheHttpClient .getInstance ().close ();
40
39
thrown .expect (ClientException .class );
41
- thrown .expectMessage (
42
- "SDK.ServerUnreachable : Server unreachable" );
40
+ thrown .expectMessage ("SDK.ServerUnreachable : Server unreachable" );
43
41
this .getConnectTimeoutClientWithRegionId (regionId , 1L ).getCommonResponse (request );
44
42
45
43
request .setSysConnectTimeout (5000 );
46
44
this .getConnectTimeoutClientWithRegionId (regionId , 1L ).getCommonResponse (request );
47
- }
45
+ }
48
46
49
47
@ Test
50
48
public void testCompatibleUrlConnClientSocketTimeoutException () throws IOException , ClientException {
@@ -72,6 +70,9 @@ public void testCompatibleUrlConnClientConnectTimeoutException() throws IOExcept
72
70
73
71
thrown .expect (ClientException .class );
74
72
thrown .expectMessage ("SDK.ServerUnreachable : SocketTimeoutException has occurred on a socket read or accept." );
73
+ request .setSysDomain ("rds.aliyuncs.com" );
74
+ request .setSysVersion ("2014-08-15" );
75
+ request .setSysAction ("DescribeRegions" );
75
76
this .getConnectTimeoutCompatibleUrlConnClient (regionId , 1L ).getCommonResponse (request );
76
77
77
78
request .setSysConnectTimeout (5000 );
0 commit comments