jipada wrote:Well they're not arguments that a JUnit runner takes. Doh.
What do you mean the manifest is irrelevent?
I kind of figure out that -jar and jarfile.jar are taken as arguments line (doh)
I was kind of looking for a replacement for the org.junit.runner.JUnitCore that works with jar filesFigure it out for yourself, your sarcasm has bitten you on the @ss. That runner is perfectly adequate for your needs, by the way
jipada wrote:You apparantly do not realize that switches (such as -jar) must be placed before the argument which specifies which class to run.
I'm trying to start a JUnit test from command line.
I've succesfully started it with the java org.junit.runner.JUnitCore MyClass
My problem is that I have my main class in a jar file. The manifest file is pointing to the correct main class but when i use
the java org.junit.runner.JUnitCore -jar myjarfile.jar i get these messages:
Couldn't find class -jar
Couldn;t find class myjarfile.jar
Is there any other way ?
jipada wrote:Really? Then I must have misunderstood you. If so, my apologies.
Sarcasm was the last thing on my mind especially at that moment when I was in need of help
but your message just added to my frustration. I've put the jar file in the classpath and add the main class from the manifest file as the argument for junit runner. It works now. You could of said that cause I kind of suspect you knew. Anyway your messages helped. ThanksI did say that. Apart from the "main class from the manifest" bit, which I have no way of knowing, and, in all honesty, is wrong in all but the most simple of cases. Your jar probably consists of more than just the one class, and a fair number of those would be tested, no?