Here's my code
public class JWebUnitTest extends WebTestCase {
public JWebUnitTest(String name) {
super(name);
}
public void setUp() {
getTestContext().setBaseUrl("http://www.google.com");
}
public void testSearch() {
beginAt("/");
setFormElement("q", "httpunit");
submit("btnG");
clickLinkWithText("HttpUnit");
assertTitleEquals("HttpUnit");
assertLinkPresentWithText("User's Manual");
}
}
In the Failure Trace, I see the following error:
java.lang.RuntimeException: java.io.IOException (moving down..) Caused by: java.net.SocketException: Operation timed out: connect: could be due to invalid address
Why is "http://www.google.com/" an invalid address? Why am I getting this IOException?
I would suggest you to try any of these options
1.) Clean the project once . Project - Clean (in Eclipse) and rebuild
2.) Try updating your eclipse to latest version
3.) Try to hit your localhost server (This will show whether theres really a problem with ur code or with eclipse)
4.) You should be needing a proxy. So configure accordingly