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 77import java .io .ByteArrayInputStream ;
88
99import com .nerox .client .keepalives .UDPKeepAlive ;
10+ import com .nerox .client .misc .TCPTimeouts ;
1011import com .nerox .client .security .Cryptography ;
1112import org .junit .Test ;
1213
@@ -62,21 +63,37 @@ private String joinPaths(String ...paths){
6263 return sb .toString ();
6364 }
6465
65- // @Test
66+ @ Test
6667 public void runAllTests (){
6768 this .tfprotocolDoesConnect ();
69+ this .testConnectionWithTimeout ();
6870 //this.loginCommand();
6971 //this.setfsidCommand();
7072 //this.setfspermCommand();
71- this .supCommand ();
72- this .statCommand ();
73+ // this.supCommand();
74+ // this.statCommand();
7375 }
7476
7577 public void tfprotocolDoesConnect ()
7678 {
7779 assertTrue (this .tfprotocol .isConnect ());
7880 }
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+
8097 public void loginCommand (){
8198 this .tfprotocol .loginCommand ("user_your_system_user_here" , "pwd" );
8299 }
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ private String joinPaths(String ...paths){
6262 return sb .toString ();
6363 }
6464
65- @ Test
65+ // @Test
6666 public void runAllTests (){
6767 this .proxyDoesConnect ();
6868 this .testMainProtocol ();
You can’t perform that action at this time.
0 commit comments