Steven Feldman
Steven Feldman

Reputation: 841

Automate Runs in Eclipse

I have a main class that takes a series of arguments and I have 10 run configurations. Is there a way to have eclipse run them one after another?

Upvotes: 2

Views: 907

Answers (3)

Bananeweizen
Bananeweizen

Reputation: 22070

The other answers are probably better solutions to your problem. However, if you install the Eclipse CDT into your Eclipse installation (using update manager or market place client), then you get an additional launch configuration type called Launch group.

Those launch groups allow creating a list of other launch configurations to be run one after the other. Make sure to set the Post build action in the dialog to "Wait until terminates" for each included launch configuration.

Upvotes: 2

Nicola Musatti
Nicola Musatti

Reputation: 18218

As @gotuskar suggested, write test cases for your class. If you can afford running your ten configurations each time you build your project put them in its src/test/java directory, otherwise create a sibling project to your original one, make it depend on it, and put your tests there.

Upvotes: 0

devang
devang

Reputation: 5516

@Steven: To do it quick, you can write a JUnit Test case that just calls the intended classes in desired order and execute it. Eclipse already has the necessary jar for JUnit, so you are ready to go. Definitely, writing ANT/MAVEN script is a good practice.

Upvotes: 1

Related Questions