Re: Requirement of a new ServletRunner constructor in HttpUnit 1.7
"Wolfgang Fahl" <[email protected]> Sat, 08 Aug 2009 11:23:45 +0200
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Organization | BITPlan GmbH |
| Message-ID | <[email protected]> |
Xiaofeng,
thank you for your mail,
you wrote:
> I am trying to use the servlet unittest framework of httpunit. My case
> is a bit special, I need to read file in the _contextDir, which
> construct in com.meterware.servletunit.WebApplication. However,
> ServletRunner doesn't provide a way for me to set this variable. I am
> wondering whether it is suitable to add constructors as below in
> ServletRunner?
>
> public ServletRunner(InputStream webXml, File contextDir, String
> contextPath) throws SAXException, IOException {
> InputSource inputSource=new InputSource( webXml );
> Document doc=HttpUnitUtils.parse(inputSource);
> _application = new WebApplication( doc, contextDir, contextPath );
> completeInitialization( contextPath );
> }
>
> I both attached a draft change of this file. I am wondering about the
> check-in criteria of HttpUnit, including questions as below:
> - How many unit tests I need to pass before checking the code?
All the ones that passed before your
modifications/additions + at least one test that
uses/checks the modified/added code.
> - How about the coding style of the code?
Please stick to what you find in the existing code. If
we only talk about a few lines I'll do the style-fixing
before checking in.
> I'll follow that and check in the code. Is it OK to you? Thanks for
> your comments!
Yes - adding a constructor won't harm too much.
Beware of the other changes you are suggesting (cleaning
up the code). It takes a lot of time to check such
changes which might hold up the check in for many weeks
or months. Currently there is a backlog of changes of a
few month sincce I don't get to checking in things very
often. The best chances are for small clear patches
which are accompanied by a simple JUnit test.
Thanks for your cooperation! I'm looking forward to your
patch.
Wolfgang
BITPlan - smart solutions
Pater-Delp-Str. 1, D-47877 Willich Schiefbahn
Tel. +49 2154 811-480, Fax +49 2154 811-481
Web: http://www.bitplan.de
bitplan GmbH, Willich - HRB 6820 Krefeld, VAT-ID: 10258040548,
Geschäftsführer: Wolfgang Fahl
The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any other MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.
---- File information -----------
File: ServletRunner.java
Date: 8 Aug 2009, 11:06
Size: 11111 bytes.
Type: Unknown
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Httpunit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/httpunit-develop
ServletRunner.java
(application/octet-stream, 10.9 KB) - not displayed