[Jwebunit-development] RE: Problem with TestServer in debug mode
Brought to you by:
henryju
|
From: James E W. <JEW...@th...> - 2004-06-18 15:17:32
|
Heya, Yes, the pseudo-server from httpunit was very good in that it allowed us to write good functional tests for jwebunit, but it does have its downsides. Keep in mind when you are testing this way - through the API against a deployed web application, what you are doing is really more along the lines of acceptance / functional tests rather than unit tests. It may be possible to write true unit tests for some of the engine code. We did not make much of an effort at this in jWebUnit. If I had it to do again, I probably would have more true unit tests in jWebUnit (via mock objects, shunts, other techniques). That doesn't solve the problem though - we still want good functional tests regardless of unit-test coverage, and it makes sense with multiple engines to want to swap out the engine and run the same suite of functional tests. I'm not opposed to trying to transition the api tests to use jetty. It would require some work to get the various fake web pages we declare in the tests separated into an app, and to programatically launch jetty with that app when the tests are run. And it would require us to include jetty as a dependency for developers on the project. I don't think that's too much of a downside. On the upside, using a real container for the app may allow us to test some things we couldn't test against the httpunit pseuoserver. jim |---------+------------------------------------------------> | | Nick Neuberger | | | <Nic...@sn...> | | | Sent by: | | | jwe...@li...| | | ceforge.net | | | | | | | | | 06/18/2004 09:44 AM | | | | |---------+------------------------------------------------> >------------------------------------------------------------------------------------------------------------| | | | To: 'Martijn Dashorst' <ma...@da...>, Nick Neuberger <Nic...@sn...> | | cc: "'jwe...@li...'" <jwe...@li...>| | Subject: RE: [Jwebunit-development] Problem with TestServer in debug mode | >------------------------------------------------------------------------------------------------------------| Yeah thats what I thought. A timing issue. Or a socket issue. I'm getting an IOException on the following from HttpUnitDialog. resp = wc.getResponse(new GetMethodWebRequest(initialURL)); } catch (Exception e) { throw new RuntimeException(ExceptionUtility.stackTraceToString(e)); That is a major bummer.. It hard to debug code in a run mode type of environment. Maybe I'll check the httpunit mailing list. It looks like TestServer uses a HttpUserAgentTest (psuedo server) from httpunit. It may be a config or bug in the httpunit class. I might just have to use something more robust just for testing. ie. tomcat or something a bit smaller. donno. Nick > -----Original Message----- > From: Martijn Dashorst [mailto:ma...@da...] > Sent: Friday, June 18, 2004 9:16 AM > To: Nick Neuberger > Cc: 'jwe...@li...' > Subject: Re: [Jwebunit-development] Problem with TestServer in debug > mode > > > Nick Neuberger wrote: > > >But, when I stick a breakpoint in any test method of a test > case, the test > >always fails.... But in run mode, they work fine. I think > it has something > >to do with the "TestServer" or its httpunit testing classes. > Any thoughts. > > > > > I had the same problem when I tried assessing why the WebCookieTest > didn't work. > > >Any thoughts on the "TestServer" class. I need a psuedo type of mini > >webserver for serving up pages for the jacobie integration. > > > >Anyone else have "debug" mode issues running the test cases? > > > > > Yep, I also have these issues. I guess that some timeout on the rmi > connection goes off. > > I am currently in the process of writing an article concerning the > integration of jwebunit, jetty and your webproject. On our current > project we are able to run the jwebunit tests in the same jvm as the > project. This allows for easy debugging. Perhaps this is also > a nice way > to test jWebUnit itself. > > Martijn > - - - - - - This e-mail message is intended only for the use of the individual or entity identified in the alias address of this message and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution of this e-mail message is strictly prohibited. If you have received this e-mail message in error, please notify the sender immediately by reply e-mail and delete this message from your system. Thank you. ------------------------------------------------------- This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND _______________________________________________ Jwebunit-development mailing list Jwe...@li... https://lists.sourceforge.net/lists/listinfo/jwebunit-development |