Re: Export JUnit Test Application in Eclipse 3.1
Saturday, October 8, 2005 12:07 PM
just write a static "main" method that runs the tests, and specify that as the entry point for executing the jar, in the META-INF.
Assuming you've written the static "main" method in one of your classes, when you do "Export as Jar" on your Java project, Eclipse will even prompt you if you want a specific class's "main" method to be designated in the META-INF, and will even let you bring up a list of all the classes it finds that have "main" methods, so you can pick one.
At least, IBM Websphere Studio Application Developer does this, and is based on Eclipse 2.X, and I think this is part of the basic Eclipse platform, not something that IBM's added.
Also if you do "New", "JUnit" .... the wizard even asks you if it should auto-generate a static "main" method, in your test runner class.