ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Lalevée <>
Subject Re: Ant JUnit tests
Date Fri, 20 Apr 2018 17:34:50 GMT

> Le 20 avr. 2018 à 18:48, Gintautas Grigelionis <> a écrit
> 2018-04-20 15:26 GMT+00:00 Nicolas Lalevée < <>>:
>>> Le 20 avr. 2018 à 07:09, Gintautas Grigelionis <>
>> a écrit :
>>> I am refactoring Ant JUnit tests with a goal to make them more
>>> "IDE-friendly". I found several tests that are implictly dependent on
>>> ant.home property being set. In these cases, the test should be prevented
>>> from execution by adding an assumption; however, perhaps there might be a
>>> suitable default, like basedir + "/bootstrap" or some other location that
>>> might be suggested in, say, javadoc?
>> Rather than being skipped, it would prefer that such tests fail. I would
>> assume that the test being skipped are only the tests that I cannot run,
>> like the one testing a special feature of Windows while I am on MacOS. If
>> it is just about an incorrect configuration of my IDE, I would want to be
>> clearly notified that I can do something to run the tests, rather than
>> silently skipping such tests. Because in the end I would want to run such
>> tests.
> I think I was clear that assumptions are not silent; here's an example of
> assumptions from Ant build log
> Testsuite:
> Tests run: 6, Failures: 0, Errors: 0, Skipped: 3, Time elapsed: 0,01 sec
> Testcase: java10IsDetectedProperly(
> got: <false>, expected: is <true>
> Testcase: testGetExecutableWindows(
> Test only runs on windows
> Testcase: testGetExecutableNetware(
> Test only runs on netware
> The first SKIPPED line is emitted by a messageless assumption
> assumeTrue("10".equals(System.getProperty("java.specification.version")));
> Now, I don't see a point why a system property "ant.home" should be treated
> differently from a system property "java.specification.version ».

The property ‘ant.home’ is about how the test runner is setup, which is controlled by
the end user.
The other one is about which jvm is running. The end user can certainly change it, but he
is then shooting himself in the foot.

The ‘ant.home’ is not an unchangeable property like the jvm or the OS.

> An
> assumption should inform you that the test won't run unless the property is
> set, and that's what you wanted: a notification that you can (and must) do
> something to run the test.

I still need to make the distinction between the thing I cannot change to make the test pass,
like the OS, and the things that I can and should fix in the config of my IDE.


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