Feature infrastructure to support unit tests

fronobulax

Developer
Staff member
Minor nit - the local convention is that the tag "Feature - Implemented" is reserved for feature requests that have been implemented and committed to the SourceForge repository. So only the dev doing the commit or a bidden minion acting appropriately should be using the tag.

Concerning the FR itself, I couldn't get the patch to apply. While you may never want to go back to SVN there are some dinosaurs who have not advanced to GIT and unfortunately for you, some of those dinosaurs have commit access. So you need to make your patch "just work" with SVN or write two or three sentences of instruction.

This FR has not had much discussion and I would be interested in seeing some. Since I didn't implement the patch, I will ask if the jar file size as downloaded by a user remains the same? Since unit and regression tests are of interest to the development community and not the user community, is there any indication that any devs would actually write tests and incorporate such testing into the official build process? I'm not making any statement about the utility of testing but I am saying that implementing this FR only makes sense a "critical mass" of the devs are willing and able to support it.
 

capitol

New member
I'll try to produce svn compatible patches, will need to do some reading on the subject :)

Regarding the size of the downloadable, it should stay the same, if you clean the build directory before you build the jar (if you have run the ant test target). The test target depends on the compilation of the tests, and the jar packaging doesn't.

Regarding the issue of that the dev's need to want to write tests I totally agree, I do it because it helps me write better software, but if other persons doesn't feel the same then it's not really needed, then my tests can live in my branch without disturbing anyone else.

Edit: Adding unit tests might affect the style of the javacode a bit, in order to be able to test functionality it's common to have different parts of the program be more loosely coupled or injected rather than beeing direct dependencies. Don't know how important it is, but it might affect stuff in the long run.

Edit2: here's an improved patch that I almost got working with the patch command: http://frikod.se/~capitol/0002-added-infrastructure-in-order-to-be-able-to-add-unit.patch
The thing that I didn't get to work was the creation of the binary files (junit-4.10.jar and mockito-all-1.9.5-rc1.jar) but those are easy to download from the net, and there is nothing that says that it must be exactly those versions.
 
Last edited:
Top