commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@multitask.com.au
Subject Re: [Fwd: [HttpClient][PATCH] Fix for NPE in PutMethod due to new StatusLine changes]
Date Thu, 05 Sep 2002 12:28:07 GMT
I'm getting these: 


Testcase: testSingletons took 0.01 sec
        Caused an ERROR
junit.framework.Assert.assertEquals(Ljava/lang/String;Ljava/lang/String;)V
        at 
org.apache.commons.httpclient.TestBase64.testSingletons(TestBase64.java:122)

Testcase: testSingletonsTestcase: testTriplets took 0 sec
        Caused an ERROR
junit.framework.Assert.assertEquals(Ljava/lang/String;Ljava/lang/String;)V
        at 
org.apache.commons.httpclient.TestBase64.testTriplets(TestBase64.java:230)

Testcase: testTripletsTestcase: testKnownEncodings took 0.01 sec
        Caused an ERROR
junit.framework.Assert.assertEquals(Ljava/lang/String;Ljava/lang/String;)V
        at 
org.apache.commons.httpclient.TestBase64.testKnownEncodings(TestBase64.java:297)

and many more....I'm dumbing back to 3.7 and seeing what happens. If 
anyone knows why....please let me know...
--
dIon Gillard, Multitask Consulting
Work:      http://www.multitask.com.au
Developers: http://adslgateway.multitask.com.au/developers


Ryan Lubke <Ryan.Lubke@Sun.COM> wrote on 05/09/2002 02:21:17 PM:

> I haven't made the switch yet, but there was a mention about some issues
> with 3.8, I don't know if they are similar to what you're seeing...
> 
> ----------------------------------------------------
> 
> Vincent,
> Thanks for the warning.  We've already moved but have not noticed any
> problems yet.
> 
> Everyone in HttpClient,
> please do not use and new junit features, and watch for problems.
> 
> 
> 
> I'm sorry to disappoint you but JUnit 3.8 has several issues. I tried to
> move Cactus to JUnit 3.8 last week and I had to remove it in the end.
> 
> There are several serious bugs:
> 
> - the assertEquals() with a null parameter is broken, resulting in a
> JUnit error (and it doesn't stop a build)
> - they have introduced the context classloader to load classes. This is
> good but it has been introduced in a disruptive manner that will fail
> some existing tests in some environments.
> 
> BTW, I believe there are already patches for the 2 bugs but they have
> not been included in any release yet.
> 
> The second bug is not too much an issue for HttpClient internal tests
> but it is for Cactus as Cactus users are running cactus/junit tests in
> all
> environments.
> 
> I would suggest to wait for 3.8.1.
> 
> Cheers,
> -Vincent
> 
> -------------------------------------------------------------------
> 
> On Thu, 2002-09-05 at 00:36, dion@multitask.com.au wrote:
> > Ok, reapplying...
> > 
> > I'm having lots of errors related to JUnit 3.8 - is anyone else having 

> > these?
> > --
> > dIon Gillard, Multitask Consulting
> > Work:      http://www.multitask.com.au
> > Developers: http://adslgateway.multitask.com.au/developers
> > 
> > 
> > Ryan Lubke <Ryan.Lubke@Sun.COM> wrote on 05/09/2002 01:57:43 PM:
> > 
> > > Actually the original patch is incorrect.  Use the attached patch
> > > instead.
> > > 
> > > If getStatusLine is null, return false, otherwise continue with the 
rest
> > > of the method body.
> > > 
> > > 
> > > 
> > > -----Forwarded Message-----
> > > 
> > > From: Ryan Lubke <Ryan.Lubke@Sun.COM>
> > > To: commons-dev@jakarta.apache.org
> > > Subject: [HttpClient][PATCH] Fix for NPE in PutMethod due to new 
> > > StatusLine changes
> > > Date: 04 Sep 2002 23:50:00 -0400
> > > 
> > > Had to add an additional check to make sure StatusLine returned from
> > > getStatusLine was not null before attempting to access the 
status-code.
> > > 
> > > Unit tests using the PutMethod now pass.
> > > 
> > > Also a minor update to the log output within HttpMethodBase.
> > > 
> > > 
> > > ----
> > > 
> > > 
> > > Index: HttpMethodBase.java
> > > ===================================================================
> > > RCS file: /home/cvs/jakarta-
> > > 
> > 
commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.
> > > java,v
> > > retrieving revision 1.57
> > > diff -u -r1.57 HttpMethodBase.java
> > > --- HttpMethodBase.java   5 Sep 2002 03:37:55 -0000   1.57
> > > +++ HttpMethodBase.java   5 Sep 2002 03:52:23 -0000
> > > @@ -2041,7 +2041,7 @@
> > >                  bodySent = writeRequestBody(state, connection);
> > >              } else {
> > >                  log.warn("Received status CONTINUE but he body has 
> > > already been"
> > > -                    + "sent");
> > > +                    + " sent");
> > >                  // According to RFC 2616 this respose should be 
ignored
> > >              }
> > >              readResponse(state, connection);
> > > Index: methods/PutMethod.java
> > > ===================================================================
> > > RCS file: /home/cvs/jakarta-
> > > 
> > 
commons/httpclient/src/java/org/apache/commons/httpclient/methods/PutMethod.
> > > java,v
> > > retrieving revision 1.13
> > > diff -u -r1.13 PutMethod.java
> > > --- methods/PutMethod.java   8 Aug 2002 21:51:36 -0000   1.13
> > > +++ methods/PutMethod.java   5 Sep 2002 03:52:23 -0000
> > > @@ -248,7 +248,8 @@
> > >      throws IOException, HttpException {
> > >          log.trace("enter PutMethod.writeRequestBody(HttpState, 
> > > HttpConnection)");
> > > 
> > > -        if(null != getRequestHeader("expect") && getStatusCode() !=
> > > HttpStatus.SC_CONTINUE) {
> > > +        if(null != getRequestHeader("expect") && getStatusLine() !=


> > null &&
> > > +                getStatusLine().getStatusCode() != 
> > HttpStatus.SC_CONTINUE) {
> > >              return false;
> > >          }
> > >          OutputStream out = conn.getRequestOutputStream((isHttp11() 
> > > && (null == getRequestHeader("Content-Length"))));
> > > 
> > > ----
> > > 
> > > 
> > > --
> > > To unsubscribe, e-mail: 
> > <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail: 
> > <mailto:commons-dev-help@jakarta.apache.org>
> > > 
> > > [attachment "patch.txt" removed by dIon Gillard/Multitask 
Consulting/AU] 
> > --
> > > To unsubscribe, e-mail: 
> > <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail: 
> > <mailto:commons-dev-help@jakarta.apache.org>
> > 
> > --
> > To unsubscribe, e-mail: 
<mailto:commons-dev-unsubscribe@jakarta.apache.org
> >
> > For additional commands, e-mail: 
<mailto:commons-dev-help@jakarta.apache.org
> >
> > 
> 
> 
> 
> --
> To unsubscribe, e-mail: 
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
<mailto:commons-dev-help@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message