testGZIPDisabled failing randomly
"BenjamÃn Ubach Nieto" <[email protected]> Tue, 30 Sep 2008 03:39:25 -0500
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Message-ID | <[email protected]> |
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
testGZIPUndefinedLengthHandling.
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
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Httpunit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/httpunit-develop