You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Sam Berlin <sb...@limepeer.com> on 2004/05/17 19:18:00 UTC
StatusLine IndexOutOfBounds
Hi Folks,
I'm not sure if this problem is still on CVS HEAD, but we're seeing it
against 2.0rc2. In StatusLine (line 139 in my version), when it walks
through the spaces, it is possible that the entire line was spaces (and
thus a malformed response). The code will throw an
StringIndexOutOfBoundsException now instead of the correct
HttpException. See the following bug:
http://bugs.limewire.com/bugs/
searching.jsp?disp1=l&disp2=c&disp3=o&disp4=j&l=151&c=204&m=416_205
Thanks,
Sam
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
Re: StatusLine IndexOutOfBounds
Posted by Oleg Kalnichevski <ol...@apache.org>.
Sam,
That would be a much appreciated contribution. We already have a bunch
of base TestCase classes that encapsulate shared commonalities for
different type of test cases. However, BaseBaseTestCase can still be a
great idea (apart from the name ;-)
Oleg
On Tue, 2004-05-18 at 18:45, Sam Berlin wrote:
> Sure thing. Speaking of JUnit tests -- how do you all feel about a
> class above 'TestCase' that adds more types of assertX methods? For
> our LimeWire tests, we have an AssertComparison class that adds a bunch
> of utility methods (so that we can see the expected/actual values
> easier). We don't have a javadoc built (we don't build them for the
> tests package), but the class, if you want to glance at it, is at:
> http://tests.limewire.org/source/browse/tests/com/limegroup/gnutella/
> util/AssertComparisons.java?rev=1.10&content-type=text/x-cvsweb-markup
> . It adds assertEquals methods for arrays of native types & objects,
> assertContains for collections, assertInstanceof and
> assertNotInstanceof, assertNotEquals, assertGreaterThan,
> assertLessThan, assertGreaterThanOrEquals, assertLessThanOrEquals,
> etc... We also have a class above that one called 'BaseTestCase' that
> adds a fail(Throwable, String) method so we can fail with an
> informative message and the error. If you're really looking for the
> full experience, we also use a LimeTestSuite class that extends
> TestSuite and adds nice features to the tests package, calling a static
> 'globalSetUp' and 'globalTearDown' before/after the first/last test is
> run in each suite, if there's static things that need to be set up &
> torn down once for the whole suite. BaseTestCase also adds some
> features that set up certain directory structures and settings before
> each test, and kills leftover files after the test is finished.
>
> Thanks,
> Sam
>
> On Tuesday, May 18, 2004, at 03:45 AM, Ortwin Glück wrote:
>
> > Sam Berlin wrote:
> >> I'm not sure if this problem is still on CVS HEAD, but we're seeing
> >> it against 2.0rc2.
> >
> > Sam,
> >
> > would you mind writing a JUnit test case exhibiting the problem
> > against CVS HEAD? Thanks.
> >
> > Ortwin Glück
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > commons-httpclient-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > commons-httpclient-dev-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
Re: StatusLine IndexOutOfBounds
Posted by Sam Berlin <sb...@limepeer.com>.
Sure thing. Speaking of JUnit tests -- how do you all feel about a
class above 'TestCase' that adds more types of assertX methods? For
our LimeWire tests, we have an AssertComparison class that adds a bunch
of utility methods (so that we can see the expected/actual values
easier). We don't have a javadoc built (we don't build them for the
tests package), but the class, if you want to glance at it, is at:
http://tests.limewire.org/source/browse/tests/com/limegroup/gnutella/
util/AssertComparisons.java?rev=1.10&content-type=text/x-cvsweb-markup
. It adds assertEquals methods for arrays of native types & objects,
assertContains for collections, assertInstanceof and
assertNotInstanceof, assertNotEquals, assertGreaterThan,
assertLessThan, assertGreaterThanOrEquals, assertLessThanOrEquals,
etc... We also have a class above that one called 'BaseTestCase' that
adds a fail(Throwable, String) method so we can fail with an
informative message and the error. If you're really looking for the
full experience, we also use a LimeTestSuite class that extends
TestSuite and adds nice features to the tests package, calling a static
'globalSetUp' and 'globalTearDown' before/after the first/last test is
run in each suite, if there's static things that need to be set up &
torn down once for the whole suite. BaseTestCase also adds some
features that set up certain directory structures and settings before
each test, and kills leftover files after the test is finished.
Thanks,
Sam
On Tuesday, May 18, 2004, at 03:45 AM, Ortwin Glück wrote:
> Sam Berlin wrote:
>> I'm not sure if this problem is still on CVS HEAD, but we're seeing
>> it against 2.0rc2.
>
> Sam,
>
> would you mind writing a JUnit test case exhibiting the problem
> against CVS HEAD? Thanks.
>
> Ortwin Glück
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-httpclient-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
Re: StatusLine IndexOutOfBounds
Posted by Ortwin Glück <or...@nose.ch>.
Sam Berlin wrote:
> I'm not sure if this problem is still on CVS HEAD, but we're seeing it
> against 2.0rc2.
Sam,
would you mind writing a JUnit test case exhibiting the problem against
CVS HEAD? Thanks.
Ortwin Glück
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org