intellij junit working directory

if the working directory for junit test is not properly set, the resource file might not be able to be loaded if relative path is used.

By default, Intellij uses project path as working directory. However if you have sub-modules which are in the sub directories, the junit test might have problem running locally.

To set it, go to the run/debug config and select the junit, you should be able to see the ‘working directory’ option there.

To set default, go to the run/debug config, click ‘default’ and select junit, in the ‘working directory’,set ‘$MODULE_DIR$


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s