Cafe au Lait Home Page |
Books by Elliotte Rusty Harold
| Special Reports
| Java Course Notes
| Java Seminar Slides
| Java FAQ
| Java Tutorial
| Java User Groups
| Java Mailing Lists
| Java Book List
| Java Conferences
| Java Questions
| Java Quotes
| No Frills Version
| RSS Feed

Martin Fowler points out some really weird behavior in JUnit. Apparently JUnit creates a new test object for each test. I understand why it does that, and I agree with the principles behind it. But this has some other implications:

- If this is the case why bother with a
`setUp()`

method? Why not just use the constructor?`tearDown()`

makes a tad more sense, but not much; and I've never actually needed to use it in practice. - If something's going to take a long time to set up, you should make it a local variable in every test that uses it, rather than a field, as long as some tests don't use it.

Several people have now tried to explain this to me, including Bill Venners, and it still doesn't make a lot of sense. The only real difference appears to be that the constructor is called before any tests are run and the `setUp`

method is called immediately before each test is run. I suppose if the fixture did something like iopen a file for writing that only one object could do at a time you might have to use `setUp`

but barring that there's not a whole lot of reason to
use `setUp`

.

SpaceRoots has released Mantissa 5.3, "a collection of various mathematical tools aimed towards for simulation. It is not a complete mathematical library like GSL, NAG or IMSL, but it contains various algorithms useful for dynamics simulation and 3D geometry computation." Its algorithms inlcude:

- a small set of linear algebra classes
- a least squares estimator
- some curve fitting classes
- several ordinary differentials equations integrators, either with fixed steps or adaptive stepsize control (see below)
- vectors and rotations in a three dimensional space
- algebra-related classes like rational and double polynomials
- various orthogonal polynomials:
- Chebyshev
- Hermite
- Laguerre
- Legendre

- some random numbers and vectors generation classes:
- Robert M. Ziff four tap shift register (contributed by Bill Maier)
- Makoto Matsumoto and Takuji Nishimura Mersenne twister
- generators for vectors with correlated components

- some basic (min, max, mean, standard deviation) statistical analysis classes
- some optimization algorithms using direct search methods:
- the Nelder-Mead simplex method
- Virginia Torczon's multi-directional method

André Simon has released Highlight 2.2-3, a free-as-in-speech (GPL) source code formatter that understands 85 programming languages including Java and generates HTML, XHTML, RTF, TeX, LaTeX, and XSL-FO output. Highlight is a command line application written in C++ for Unix and Windows.

Frank Karlstrøm has posted the second beta of JCache 1.0, an open source caching system for Java database-based applications based on the JSR-107 JCache API. This is mostly a bug fix release. JCache is published under the LGPL.