Canonical way to add junit.jar to classpath? [message #765328] |
Tue, 13 December 2011 21:05 |
|
By "canonical", I mean that in Eclipse we add JUnit testing to a project
via Build Path -> Configure Build Path -> Libraries -> Add Library ->
JUnit, etc.
You code your JUnit tests up in test as a Source Folder, right-click
them, choose Run or Debug and there you are, simple as can be.
This works perfectly until you throw ant into the mix.
Now, create build.xml in the project and code it up to do a build,
either from Eclipse's Ant view or outside from the command line.
Eclipse's JUnit-in-your-project approach doesn't put a copy of junit.jar
anywhere build.xml can easily get its hands on it. (Or, I just don't
know where that would be.)
Therefore, I'm obliged to accomplish this "non-canonically" by fetching
my own copy of junit.jar and putting somewhere in my project as if any
other third-party, Eclipse-unmanaged JAR. No problem, this is what I've
always done.
But I wanted to know if there is a "right" or "canonical" way to do this
that I just haven't discovered yet. (I always like to know the right way
to do a thing in order to give the right answer to people who ask
questions in forums.)
Secondarily, if there isn't a "right" way, then what might have been the
point to Eclipse handling JUnit for me in the first place?
Much thanks to anyone who comments and/or helps me here.
Russ
|
|
|
Powered by
FUDForum. Page generated in 0.08589 seconds