Move the TestUtils class into the library

SciJava common is already used by dozens of libraries (and transitively
by hundreds of software components).

Besides being a powerful software library, SciJava common also sets
helpful standards e.g. for unit testing. Following the DRY principle
(Don't Repeat Yourself), let's offer the TestUtils class -- which
turned out useful for testing software in the SciJava ecosystem --
as part of the standard library.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Port TestUtils enhancements from MiniMaven

MiniMaven already used a fork of SciJava common's TestUtils class,
and even enhanced the naming of the temporary directories. Let's
benefit from those improvements everywhere.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Make use of the new createTemporaryDirectory() method in our own tests

The benefits are obvious: should Jenkins report failures in one of
these tests, we can easily inspect those temporary directories because
they are now written into the target/ directory (which Jenkins makes
visible, in contrast to /tmp/).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
TestUtils: never create test directories in /tmp/

Curtis Rueden offered reluctance to fall back to creating tests in
/tmp/ when it was determined that the tests are run in in unknown
location.

This developer agrees. Therefore, let's test carefully that we found
some sensible location close to the .class files, handling unit tests
run via Maven extra nicely.

For details, see the pull request corresponding to this topic branch:
https://github.com/scijava/scijava-common/pull/70

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Be careful in createTemporaryDirectory() when removing existing files

If File.exists() returns true, it might be a regular file being in
the way, after all...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge pull request #70 from scijava/test-utils

Provide a TestUtils class in the main artifact