How can I set defaults for test configurations?

I'd like to set the system property 'run.mode' to 'test' for any test I run in IntelliJ. I know I can create a custom configurations and specify the property in the settings, but I'd like this to be a default any time I click a right-click a test case and press "Run Blah".

Is that possible?

5 comments
Comment actions Permalink

The "Run/Debug" configuration dialog has tree of configurations on the left side.
One of the nodes (the bottom one for me) is called Defaults.

If you expand it, you can edit the defaults for any kind of run configuration type, including "JUnit test".
For example, by adding something to the "VM parameters" field for that run type.

-tt

3
Comment actions Permalink

Brilliant!

I'd never noticed that before. Thank you!

0
Comment actions Permalink

Where are the settings for the Default configurations saved?

I need to change the native library path for the default JUnit configuration.  I can change it in the UI, and the change is persisted somewhere, but I don't know where.

Thanks,
Jon

0
Comment actions Permalink

Try to search by configuration name in .idea and in idea system folder.

best regards, Alex

0
Comment actions Permalink

Turns out it's in workspace.xml in the root of the .idea directory (for directory-based projects).  The default run configurations are marked with "default='true'" attributes.

Thanks,
Jon

0

Please sign in to leave a comment.