Community
Participate
Working Groups
Most of my tests require that I specify a jvm system property and the working directory in their launch configurations. So to run tests in one of these classes or all tests in a package that contains one of these classes, I right-click the test in the package explorer > drag mouse to "Run" > drag mouse to "Junit Test" and let the test fail. Then I click the "Run" menu > click "Run..." > and then make the required edits to the Junit Launch Configuration. That's OK for one or two configurations, but I want Eclipse to be my primary testing framework. During active development I would have to edit and maintain upwards of 50 launch configurations. In my ideal world, I would create a "default" launch configuration, and one or two, or more "alternative" "junit" launch configurations. Then to run a test class or package with one of these launch configurations, i would right-click the test in the package explorer > drag mouse to "Run" > drag mouse to "Junit Test" > drag mouse to one of my configured launch configurations. If i wanted to use the "default" junit launch configuration, i would just release the mouse over "Junit Test". If I wanted to create a "new" launch configuration, I could drag the mouse over "New Launch Configuration..." context menu item in the final step. To launch recent tests, I would access a "Junit History" pulldown menu instead of the "Run Configuration" menu. This seems to be an inappropriate use of the "Run Configuration" menu. In my just-less-than-ideal world, I could specify a "default" launch configuration by clicking on the Run Configuration Menu > "Run..." > and the Junit node. Then, all junit launch configs created thereafter would inherit these values.
This similar to the bug that I filed a long time ago: https://bugs.eclipse.org/bugs/show_bug.cgi?id=41353 Please consider this functionality since a lot of users have expressed a desire to have this. Newsgroup posting: news://news.eclipse.org:119/1810e521f3d686e6eea40299716fedc4$1@www.eclipse.org thanks, Vijay
reassigning to markus - he now owns the junit integration
This isn't a JUnit issue, it's a general launch configuration issue. We have the same problem with both our tests and our production code requiring a certain startup directory (which isn't the project root). Every time we want to run something new we either have to clone an existing configuration or have it fail once first (as Mr. Kassis describes for his JUnit case). IDEA's had default launch configurations for donkey's years. Is this really so difficult? Or does everybody on the Eclipse project just set their VM options in the .ini file and use the project root as a startup directory so it doesn't seem like a big deal?
I agree that this is a very big problem for people that work on large projects with many classes. Please implement this or provide a work-around that doesn't involve hand-editing each and every launch configuration.
I have to move back and forth between IDEA and Eclipse, and this is my number one problem with making the switch. All of my unit tests in my project require the same JVM arguments so every time I have to run a new test once to have it fail, then go copy the JVM arguments into the launch configuration from another test. As David Moles said, IDEA has had this functionality for as long as I've been using it, and it is a huge time saver. Any chance that five years later this might get on the roadmap?
All I can do is pushing for bug 41353 even harder for 3.6 (and yes, I'll do that).