Re: testGZIPDisabled failing randomly

"Wolfgang Fahl" <[email protected]> Thu, 20 Aug 2009 10:18:31 +0200
Newsgroups gmane.comp.web.httpunit.devel
Organization BITPlan GmbH
Message-ID <[email protected]>
Dear Benjamin, 

sorry for not getting back to you any earlier. I have 
been abroad for four months and then very busy for 
another seven. I'm trying to catch up on things.

It is a pitty that I didn't reply to your offer in 
coding/writing for version 2 of httpunit any earlier. 
Would you still be interested? The JavaScript support is 
still the main issue which needs fixing and it looks 
like a few days of work to be done which Russell and me 
couldn't do yet during the past few months.

For your testGZIP disabled problem - could you please 
check out the current trunk version of SVN whether it 
still persists?

Yours
  Wolfgang
> 
> Hello everyone. I just joined downloaded the HttpUnit framework in order 
> to learn and apply unit testing at work (long story short: we don't use 
> it and I'm tired of bugs) so I downloaded HttpUnit and followed the 
> tutorial's part 1 which is a wonderful walk-through by the way. Would 
> love to see part 2 coming up and I would be happy to help coding/writing 
> it.
> 
> Anyways, as no ideas came to mind to start using it, I downloaded it to 
> see the test cases that already came with it to learn from them. 
> Unfortunately, I found that, at least under my environment, many tests 
> (3-5) failed to pass even with the code from SVN trunk. I managed to 
> make almost all of them work, except the testGZIPDisabled in 
> WebClientTest. After some debugging of the test case (didn't see much 
> case in making a test case OF A test case ;-) I managed to see that 
> wc.getResponse( getHostPath() + "/Compressed.html" ); is not executing 
> the CompressedPseudoServlet most of the times (roughly speaking 3 out of 
> 4 test runs). Even worse, when stepping through the test case, the 
> Servlet is indeed executed and therefore the tests pass, but when I 
> leave the rest of the test case run without stepping through, some other 
> tests fail randomly, like testLoopingMalformedRedirect or 
> testGZIPUndefinedLengthHandlin g.
> 
> The error that pops out when running the test case completely is
> 
> Testcase: 
> testGZIPDisabled(com.meterware.httpunit.WebClientTest):FAILED
> Content-Type expected:<text/plai...> but was:<unknown/unknow...>
> junit.framework.ComparisonFailure: Content-Type expected:<text/plai...> 
> but was:<unknown/unknow...>
>  at 
> com.meterware.httpunit.WebClientTest.testGZIPDisabled(WebClientTest.java
> :781)
> 
> I came to the conclusion that CompressedPseudoServlet.getGetResponse() 
> is not executing by simply placing a System.out.println("yes i'm here"); 
> right at the beginning of the method. When the tests fails, that line is 
> not written to stdout, and when it passes i can see it on the junit 
> stdout.
> 
> I subscribed to this mailing list and searched through the archives to 
> see if someone had the same problem and I couldn't find any pointers 
> there, so that's the reason I'm writing this mail.
> 
> Now my environment:
> 
> I'm running
> NetBeans IDE 6.1 (Build 200805300101) running under JDK 1.6.0_07 on 
> Gentoo Linux 2.6.25
> 
> Compiling the HttpUnit code and running the tests with with Sun JDK 
> 1.5.0.15, Ant 1.7.0 and JUnit 3.8.2 included with NB 6.1
> 
> The jars used to compile the code are the same ones included with 
> HttpUnit 1.7
> 
> HttpUnit source code including test cases downloaded from SVN trunk 
> revision as of yesterday (28/09/2008 - Rev. 992)
> 
> Any help will be very much appreciated and I'm of course willing to help 
> with any other information or action that I can give you.
> 
> OTOH, I had to change a lot of ServletAccessTest.testServletParameters() 
> to make it work as with the actual coding it never worked. Modified it 
> to use the invocationContextFactory found on another test case and 
> adding a ServletRunner for it to make the call to the servlet I had to 
> create as well. Don't know if it was absolutely necessary but "it works 
> for me". If interested I could post my code for your review though it 
> might be a little embarrassing ;-)
> 
> Thanks for your attention. 
> --
> Benjamín Ubach Nieto
> "You know you're using the computer too much when you are in a hurry to 
> go to work
> in the morning and you can't find your keys, and you try to grep for 
> them."
>    -- Leunix
> Linux Registered User: 310305 | MSN: [email protected] | 
> http://bubach.blogspot.com
> [email protected] | http://bubach.blogspot.com
> 
> 



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

------------------------------------------------------------------------------
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