[Jwebunit-development] java.lang.RuntimeException: java.net.ConnectException: Connection timed out:
Brought to you by:
henryju
From: Manoj D. N. <man...@hc...> - 2005-11-26 13:34:08
|
Dear all I am running a jwebUnit program=20 =20 Code is as below : =20 : =20 =20 import net.sourceforge.jwebunit.WebTestCase; =20 public class ViewInfoTest1 extends WebTestCase { =20 public ViewInfoTest1(String name) { super(name); } =20 public void setUp() { =20 =20 getTestContext().setBaseUrl("http://httpunit.sourceforge.net"); =20 } =20 public void testSearch() { beginAt("/test/First.jsp"); setFormElement("q", "httpunit"); submit("btnG"); clickLinkWithText("HttpUnit"); assertTitleEquals("HttpUnit"); assertLinkPresentWithText("User's Manual"); } =20 } =20 =20 //end of code =20 =20 =20 But its giving error like =20 java.lang.RuntimeException: java.net.ConnectException: Connection timed out: connect at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at java.net.HttpURLConnection.getResponseCode(Unknown Source) at com.meterware.httpunit.HttpWebResponse.readResponseHeader(HttpWebRespons e.java:147) at com.meterware.httpunit.HttpWebResponse.readHeaders(HttpWebResponse.java: 185) at com.meterware.httpunit.HttpWebResponse.<init>(HttpWebResponse.java:53) at com.meterware.httpunit.WebConversation.newResponse(WebConversation.java: 61) at com.meterware.httpunit.WebWindow.getResource(WebWindow.java:162) at com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow.java:125) at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:118) at com.meterware.httpunit.WebClient.getResponse(WebClient.java:112) at net.sourceforge.jwebunit.HttpUnitDialog.<init>(HttpUnitDialog.java:48) at net.sourceforge.jwebunit.WebTester.beginAt(WebTester.java:55) at net.sourceforge.jwebunit.WebTestCase.beginAt(WebTestCase.java:46) at ViewInfoTest1.testSearch(ViewInfoTest1.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe stRunner.java:421) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun ner.java:305) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu nner.java:186) Caused by: java.net.ConnectException: Connection timed out: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at sun.net.NetworkClient.doConnect(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.<init>(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getHeaderFieldKey(Unknown Source) at com.meterware.httpunit.HttpWebResponse.loadHeaders(HttpWebResponse.java: 201) at com.meterware.httpunit.HttpWebResponse.readHeaders(HttpWebResponse.java: 183) ... 25 more =20 at net.sourceforge.jwebunit.HttpUnitDialog.<init>(HttpUnitDialog.java:50) at net.sourceforge.jwebunit.WebTester.beginAt(WebTester.java:55) at net.sourceforge.jwebunit.WebTestCase.beginAt(WebTestCase.java:46) at ViewInfoTest1.testSearch(ViewInfoTest1.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe stRunner.java:421) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun ner.java:305) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu nner.java:186) =20 every time=20 =20 =20 I tried with http://localhost:8080/ =20 Only then it works =20 Otherwise not =20 =20 Can any body help =20 =20 Very Urgent =20 Manoj Dubey =20 =20 |