Here are some tantalizing hints. I'll look at this tomorrow if someone hasn't beaten me to it, but there are better things I can be doing late Friday night than messing around with stupid tests <G>.

From :

Once you have tests, you'll want to run them. JUnit provides tools to define the suite to be run and to display its results. To run tests and see the results on the console, run this from a Java program:

org.junit.runner.JUnitCore.runClasses(TestClass1.class, ...);
or this from the command line, with both your test class and junit on the classpath:
java org.junit.runner.JUnitCore TestClass1.class [...other test classes...]
See JunitCore and Request, especially Request.method.


new, methodName));

I think the still-remaining clumsy part of this is specifying the test class file in the classpath. I can imagine that this could be part of a shell script, but is it worth the effort if things run from the IDE? Alternatively, a small Java program taking two arguments might do the trick. But as I said, it's late and even sleeping would be better than this <G>.....

Siiiiggghhh. Manning has a MEAP for JUnit In Action (herinafter JUIA) that covers up through Junit 4.5. Anybody dare me to spring for the $30 and see what wisdom is in there? I'm frustrated enough with the sparse documentation that it sure seems worth it....


P.S. no Double-Dog-Dares allowed.....

On Fri, Feb 26, 2010 at 6:14 PM, Yonik Seeley <> wrote:
On Fri, Feb 26, 2010 at 3:31 PM, Jason Rutherglen
>> I've never tried to learn a command-line invocation of a test
>> case for a single test method, I've always just used the IDE
>> to run individual methods....
> Right, I've been doing bunches of Solr dev which for me only works
> from the command line... I'm open to suggestions though!

Should work from the IDE provided you've set the working directory to
But I'd love a way to run a single method from the command line too.


To unsubscribe, e-mail:
For additional commands, e-mail: