File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed
src/test/java/com/nerox/client Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 7
7
import java .io .ByteArrayInputStream ;
8
8
9
9
import com .nerox .client .keepalives .UDPKeepAlive ;
10
+ import com .nerox .client .misc .TCPTimeouts ;
10
11
import com .nerox .client .security .Cryptography ;
11
12
import org .junit .Test ;
12
13
@@ -62,21 +63,37 @@ private String joinPaths(String ...paths){
62
63
return sb .toString ();
63
64
}
64
65
65
- // @Test
66
+ @ Test
66
67
public void runAllTests (){
67
68
this .tfprotocolDoesConnect ();
69
+ this .testConnectionWithTimeout ();
68
70
//this.loginCommand();
69
71
//this.setfsidCommand();
70
72
//this.setfspermCommand();
71
- this .supCommand ();
72
- this .statCommand ();
73
+ // this.supCommand();
74
+ // this.statCommand();
73
75
}
74
76
75
77
public void tfprotocolDoesConnect ()
76
78
{
77
79
assertTrue (this .tfprotocol .isConnect ());
78
80
}
79
-
81
+
82
+ public void testConnectionWithTimeout () {
83
+ TCPTimeouts tcptimeouts = TCPTimeouts .getInstance (this .callback );
84
+ tcptimeouts .setConnectTimeout (5 );
85
+ tcptimeouts .setDnsResolutionTimeout (5 );
86
+ Tfprotocol protocol = new Tfprotocol (this .tfprotocol , callback );
87
+ try {
88
+ // protocol.connect();
89
+ protocol .easyreum .getSocket ().setSoTimeout (10 *1000 );
90
+ protocol .echoCommand ("hola mundo" );
91
+ }catch (Exception ex ){
92
+ System .out .println (ex );
93
+ }
94
+ assertTrue ("Tested tcp socket timeout" , protocol .isConnect ());
95
+ }
96
+
80
97
public void loginCommand (){
81
98
this .tfprotocol .loginCommand ("user_your_system_user_here" , "pwd" );
82
99
}
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ private String joinPaths(String ...paths){
62
62
return sb .toString ();
63
63
}
64
64
65
- @ Test
65
+ // @Test
66
66
public void runAllTests (){
67
67
this .proxyDoesConnect ();
68
68
this .testMainProtocol ();
You can’t perform that action at this time.
0 commit comments