Feature Requests item #1674646, was opened at 2007-03-06 21:45
Message generated for change (Comment added) made by jevonwright
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=497985&aid=1674646&group_id=61302
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core API
Group: Release 2.1
Status: Open
Priority: 7
Private: No
Submitted By: chandra (pydichandra)
Assigned to: Jevon Wright (jevonwright)
Summary: Provide option to specify timeout for http requests made
Initial Comment:
If I make a request to server (using jwebunit) and if the server is
down/doesnot respond, that function never returns. Provide an option to specify
default time-out for methods. If server doesnot respond by that amount of time,
jwebunit methods should return (by throwing some exception).
----------------------------------------------------------------------
Comment By: Jevon Wright (jevonwright)
Date: 2008-12-01 12:55
Message:
This has been implemented in r775. You must set the timeout before the web
client is initialised:
public void setUp() throws Exception {
super.setUp();
setTimeout(2); // 2 seconds
getTestContext().setBaseUrl(HOST_PATH + "/ResponseServletTest");
}
You can then catch the timeout with a RuntimeException:
try {
submit();
fail("should never get here");
} catch (RuntimeException e) {
assertTrue("timeout caused by SocketTimeoutException, but was " +
e.getCause().getClass(), e.getCause() instanceof SocketTimeoutException);
}
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=497985&aid=1674646&group_id=61302
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
JWebUnit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development