poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Javen O'Neal" <javenon...@gmail.com>
Subject junit3 / junit4
Date Fri, 06 Nov 2015 16:49:43 GMT
We currently have unit tests written in a mixture of junit3
(junit.framework.*) and junit4 (org.junit.*).

It would make sense to write new unit tests in junit4 since it's:
* more flexible (classes don't need to inherit from TestCase, leaving you
free to have them inherit from some base class that applies to common
interfaces (SS: HSSF/XSSF/SXSSF)
* concise (fail(msg) instead of throw new AssertionRaisedException(msg), no
need to maintain explicit test suites).

I haven't managed to figure out the pattern on why some unit tests are
written in junit3 and others are junit4. I presume it's the age of the
test, with our BIFF8 tests being written before our OOXML tests. Does
anyone have histological insight on this?

Looking forward, do we want to try to convert existing junit3 tests to
junit4 (this would also be a good opportunity to fix the plethora of
whitespace variations in unit tests)? If so, do we want to blitz through
this in a concentrated effort, or just upgrade junit tests as needed when
we need to add a test case to a junit3 file?

For the sed/awk/emacs gurus out there, is there a more time efficient way
of converting junit3 tests to junit4 other than manually opening each
junit3 file, deleting the junit.framework, fixing all the red errors
reported by Eclipse, and annotating every "public void test" method with

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message