1

I'm looking for some way to switch between default VM arguments. I've got a workspace with a bunch of projects and created run configurations for running JUnit tests. I'm able to switch between run configurations easily.

In order to run any test correctly, I need to pass some arguments to JVM. This is problem whenever I want to run a specific test method SHIFT+ALT+X,T. Since it creates a whole new Run Configuration, it doesn't pass any VM arguments to it.

I figured out how to set default VM arguments using Window -> Preferences -> Java -> Installed JREs -> Edit -> Default VM arguments. This, however, means that whenever I need to switch to different VM arguments, I'd have to do it manually.

What I'd need in the most optimal case is some select box visible on the toolbar, where I could switch between global run configurations from which all newly created ones would "inherit".

I'd also like to see a way to make automatically created run configurations destroy themselves as soon as I switch to a different one, because at this point, I have 36 run configurations (which I manually created) and I don't want to see a "garbage" from each test method I executed. Over the time, there might be thousands of Run Configurations in between which I'd have to search. I don't want to spent few minutes a day deleting them.

So, the recapitulation:

  1. Is there a way to easily switch between default VM arguments?
  2. Is it possible to keep the list of Run Configurations clear, meaning it will only contain run configurations I created?
Community
  • 1
  • 1
tzima
  • 1,285
  • 1
  • 10
  • 23
  • aren't you talking about Project->Properties->Run/Debug Settings? You can select a resource and provide the custom configuration. – Jama Djafarov Mar 27 '15 at 12:56
  • Well, yeah. But when I run specific method directly from the code, it creates new run configuration and I don't know how to make it use specific VM arguments (which I can easily change / switch - I don't want to edit it manually). – tzima Mar 27 '15 at 15:19
  • I see. I've never done this before, but I think you can right click on method and chose "Run As" and select Configuration of your choice. You can pass the selected method as a parameter.... – Jama Djafarov Mar 27 '15 at 16:07
  • Yes, it's possible, but it'd take too long for my use-case / work-flow. Basically, I know how to get the task done, but I need to do it more efficiently. So far, I didn't find a better solution than to develop a plugin to do that. – tzima Mar 27 '15 at 16:16

0 Answers0