On Wed, 2010-04-21 at 15:20 +0100, sebb wrote: > 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.
Roland had somewhat weird ways of dong things. I remember being unhappy about such uncommonly relaxed use of indices, but not fining the problem severe enough to justify an argument with Roland, given his tendency to take disagreements personally. Probably at some point I changed the behavior of BasicHttpProcessor but overlooked the test cases. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
