On 21/04/2010, Oleg Kalnichevski <[email protected]> wrote:
> On Wed, 2010-04-21 at 00:24 +0100, sebb wrote:
> > Is there any point in having suite() and main() methods in Test classes?
> >
> > IDEs and Maven and Ant allow individual test classes to be run quite
> > easily, so AFAICT there is no need for these methods.
> >
>
>
> All that code is a hangover from the pre-Eclipse days of HttpClient 1.x
> and early 2.x. I was going to migrate core and client to JUnit 4 after
> upgrading core to Java 1.5 and get rid of old stuff in the process.
I've removed the suite() and main() methods.
Interesting result, as now TestBasicHttpProcessor fails.
This is because the main() and suite() were wrong - they referred to a
different class, see below:
- public static void main(String args[]) {
- String[] testCaseName = { TestHttpExecutionContext.class.getName() };
- junit.textui.TestRunner.main(testCaseName);
- }
- public static Test suite() {
- return new TestSuite(TestHttpExecutionContext.class);
- }
So the test class was not being run previously.
[I did a cross-check of the changes, and that seems to have been the
only class for which this was true]
I'm not sure how to fix the test cases - it's not clear whether
indexes which are too large should be rejected or treated as being end
of list. The HttpRequestInterceptorList interface Javadoc probably
needs clarifying.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]