Skip to content

Conversation

@dscho
Copy link
Contributor

@dscho dscho commented May 23, 2014

The TestUtils class was already forked in ij1-patcher and MiniMaven. The latter also had enhancements that more users might want to benefit from. Let's port them back into scijava-common and drag the TestUtils out of src/test/java/'s shadows into src/main/java/'s lime light.

This addresses #63.

dscho added 3 commits May 23, 2014 12:50
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>
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>
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>
@dscho
Copy link
Contributor Author

dscho commented May 23, 2014

@ctrueden could you give this a quick look-over, please?

@ctrueden
Copy link
Member

Apart from my comment above, looks excellent!

dscho added a commit that referenced this pull request May 23, 2014
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 just throw an Exception in
unknown cases. That way, we can add support for other test scenarios
and call those changes "bug fixes" rather than "backwards-incompatible
changes".

For details, see the pull request corresponding to this topic branch:

	#70

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added 2 commits May 23, 2014 14:24
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:
#70

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
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>
dscho added a commit that referenced this pull request May 23, 2014
Provide a TestUtils class in the main artifact
@dscho dscho merged commit 9fbcad0 into master May 23, 2014
@dscho dscho deleted the test-utils branch May 23, 2014 19:53
@dscho
Copy link
Contributor Author

dscho commented May 23, 2014

Thank you, @ctrueden, for your incredibly helpful comments!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants