Skip to content

Commit 131f78d

Browse files
committed
add createSocket() test to verify getSoTimeout() works correctly
1 parent 87cd7fc commit 131f78d

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/test/com/wolfssl/provider/jsse/test/WolfSSLSocketFactoryTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,26 @@ public void testCreateSocket()
280280

281281
/* Socket, String, int, boolean */
282282
s = new Socket(addr, port);
283+
284+
/* Set timeout, to test that createSocket returns it */
285+
int tmpTimeout = 15000;
286+
s.setSoTimeout(tmpTimeout);
287+
283288
ss = (SSLSocket)sf.createSocket(s, addrStr, port, true);
284289
if (ss == null) {
285290
System.out.println("\t\t\t... failed");
286291
fail("SSLSocketFactory.createSocket(SkSib) failed");
287292
return;
288293
}
294+
295+
/* verify getSoTimeout matches set value */
296+
if (ss.getSoTimeout() != tmpTimeout) {
297+
System.out.println("\t\t\t... failed");
298+
fail("SSLSocketFactory.createSocket(SkSib) failed " +
299+
"setSoTimeout check");
300+
return;
301+
}
302+
289303
ss.close();
290304
s.close();
291305

0 commit comments

Comments
 (0)