[rfc][icedtea-web] dont expect junit have hamcrest included
Jiri Vanek
jvanek at redhat.com
Tue Jan 27 15:30:25 UTC 2015
On 01/26/2015 04:25 PM, Omair Majid wrote:
> Hi,
>
> * Jiri Vanek <jvanek at redhat.com> [2015-01-26 06:12]:
>> The fix is to make sure that the hamcrest jar is available on the
>> classpath next to junit.jar too. The attached patch (for icedtea-web)
>> does that and works on my machine with an upstream junit 4.12 jar.
>
> A couple of thoughts:
>
> Upstream clearly states that you need to put junit.jar and hamcrest.jar
> in your classpath in one place [1] but only mentions junit.jar in
> another [2].
>
> Some distributions somehow transitively include hamcrest.jar in the
> claspath of junit.jar (such as debian [3]) and some distributions
> include the hamcrest classes in junit.jar (such as current release of
> Fedora). And a third type include a junit.jar which needs hamcrest.jar
> on the user-provied classpath to work.
>
> Maybe we should add more extensive configure tests to detect and handle
> all these cases correctly? The current patch assumes that the hamcrest
> jar, if present, is both needed by and compatible with junit.
>
> Thanks,
> Omair
>
> [1] https://github.com/junit-team/junit/wiki/Download-and-Install#plain-old-jar
> [2] https://github.com/junit-team/junit/wiki/Getting-started
> [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=527308
>
Simple approach - try to detect hamcrest, and if it is avaiable, add it behind junit jar.
If it is not avaible, then print warning and simply continue. (it is what you have done) (just
maybe warning output may be better)
Or really try if hammercest is included in junit - if so then dont add it, If is not, then proceed
with simple approach. May actually any "distributions somehow transitively include hamcrest.jar in
the claspath of junit.jar" work in our makefile-based cslasspath settings approach? I doubt a bit,
And from this point of view, I would vote for "simple approach"
ty!
J.
More information about the distro-pkg-dev
mailing list