Re: Requirement of a new ServletRunner constructor in HttpUnit 1.7

Xiaofeng Guo <[email protected]> Wed, 12 Aug 2009 15:43:03 +0800
Newsgroups gmane.comp.web.httpunit.devel
Message-ID <[email protected]>
BTW, I still can't pass all unit tests for having an failure as below:

     [java] Time: 11.954
     [java] There was 1 failure:
     [java] 1) testSelfReferentialRedirect(com.meterware.httpunit.WebClientTest)junit.framework.AssertionFailedError:
Sh
ould have thrown a RecursiveRedirectionException
     [java]     at
com.meterware.httpunit.WebClientTest.testSelfReferentialRedirect(WebClientTest.java:652)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at
com.meterware.httpunit.HttpUnitSuite.main(HttpUnitSuite.java:49)
     [java]

This failure exists in the truck, I am sorry I can't figure out the
problem, because it can't be reproduced in my Eclipse environment. I
am a bit confusing about this problem, would you take a look at the
same time? Thanks!

Best Regards,
Xiaofeng



On Wed, Aug 12, 2009 at 3:34 PM, Xiaofeng Guo<[email protected]> wrote:
> Hi Wolfgang,
>
> I attached my patch, it includes:
> - META-INF support for servlettest.
> - Unit test error on cookie expiration time.
> - Unit test error of head time conversion.
> - Add/Modify some ServletRunner constructors.
>
> Would you help me to take a look? If OK, would you help me check in
> the code? Thanks!
>
> Best Regards,
> Xiaofeng
>
>
>
> On Sat, Aug 8, 2009 at 5:23 PM, Wolfgang Fahl<[email protected]> wrote:
>> 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