james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: svn commit: r1481814
Date Mon, 13 May 2013 18:57:19 GMT
On Mon, 2013-05-13 at 20:37 +0200, Stefano Bagnara wrote:
> 2013/5/13 Oleg Kalnichevski <olegk@apache.org>:
> > On Mon, 2013-05-13 at 15:34 +0200, Stefano Bagnara wrote:
> > Prior to refactoring the test suites in question made no attempts to
> > release file resources allocated by the tests. File backed resource
> > streams were never closed. To me this is quite frivolous, even for test
> > code.
> Make sense. I admit I've never cared about resource management in
> tests (the JVM free them shutting down).

Test cases can be run as a part of a larger test suite inside the same
JVM and impact other tests. Sloppy resource management is simply a bad
idea no matter the context.

> > All other aspects of the test cases remained unchanged. I simply
> > factored out bits of bootstrapping code that was common to all sample
> > message based test cases.
> IIRC the testsuite declaration as a nested class and the code
> duplication was needed in order to be able to run single tests in
> Eclipse (and maybe in maven, but I don't remember the exact scope of
> this statement). So I guess that extracting the common code could have
> broken this feature (unfortunately I don't have eclipse on this
> computer right now).
> I always found very useful to be able to test a single msg file from
> the eclipse testrunner (and other junit testrunners) while I'm
> debugging/fixing an issue in the parser or similar things, but I'm not
> working anymore on mime4j so feel free to do what you prefer. 
> At most I will fix it again if I will have to work again on mime4j.
> Stefano

Still works for me. I can still run the test for individual messages in
Eclipse after refactoring. 


View raw message