Regression : Test code not accessible at runtime from production code Follow
Hello,
I've noticed a big issue in 6733 :
I'm using the project level "Project compiler output" option to have test and production classes compiled in different directories. Now when i run a production class, the classpath doesn't include the various test output directories. It works correctly though in 6.0.4. Maybe it was a design decision for 7.0. In my case, i need this because mocks of services for example aren't located in src directories but in test directories, and hence i can't start my application with mocks (implementation dynamically loaded from some property file).
Gilles
Please sign in to leave a comment.
Should i file a JIRA case for this ?
Gilles
Hello Gilles,
This change was made intentionally, based on a JIRA request asking for the
opposite thing. To me personally, the current behavior looks more logical.
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Dmitry,
Would it be possible to make this optional ? As i explained earlier, it's not uncommon to have mocks (which are classes that never go into production) in test directories...
(can you link to the JIRA you talk about, can't find it...)
Gilles
Hello Gilles,
http://jetbrains.net/jira/browse/IDEADEV-14254
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Thanks Dmitry !
Is it open to discussion :) ?
Gilles
Dmitry, would it be possible to specify on Run/Debug configuration dialog with a checkbox if test classpath should be included/excluded ?
Gilles
Hello Gilles,
I would say there there is such an option already. You can set test output
to the same directory as the production output.
In other words, what is the reason for having a separate test output directory
if you always want it on the classpath along with the production output?
Best regards,
Vladislav Kaznacheev
Project Manager, IntelliJ IDEA
http://www.jetbrains.com
"Develop with Pleasure!"
Vladislav, you're right that would solve my issue. But I liked the option in 6.x of telling the module to inherit project output directory (typically an absolute path outside of versioned directories). This allows to manage globally the output directories.
Another idea comes to mind : you could include an option in Project Structure => Project properties, to specify whether you want separated test/production output directories.
Gilles