Menu

#84 Add support for multiple test source folders

Version 3.0.5
open
None
5
2015-09-18
2015-09-11
No

Hi,

It would be great if you can add support for multiple test source folders. In our new project we are using 2 folders for tests:
src/test/java
src/integrationTest/java

The ideea is to make the Ctrl+J working, and search for the tests in multiple places.

Thanks.

Discussion

  • Nicolas Demengel

    Hi Andrei,

    MoreUnit already supports such setup out of the box. Maybe you project requires a bit of configuration because of some naming conventions? See the attached screenshot for a simple working example. If you're still stuck, don't hesitate to describe your setup so I can help you!

     
  • Nicolas Demengel

    • Group: Version 3.0.4 --> Version 3.0.5
     
  • Andrei Zagorneanu

    I knw about the possibility to configure the tests classes names, but here the problem is in their location. The tests are located in different directories:
    src/test/java
    src/integrationTest/java

    Check the screenshots. As result the Ctrl+J cannot find the tests from src/integrationTest/java

     
  • Nicolas Demengel

    Hi Andrei,

    I did understand your situation. I only put the configuration of the test class names to make my example work, in case you wanted to give it a try. As you can see, the integration tests in my example are named with an "IntegrationTest" suffix.

    Now, as I said previously, regardless of the "src/test/java" global configuration, MoreUnit should be able to see your tests in src/integrationTest/java. I just set-up another project, using src/test/java and src/integrationTest/java, wiht only a "Test" suffix for classes, and it worked perfectly.
    Are you sure you're using the latest version of MoreUnit? Previous versions required you to go the your project properties (rather than the workspace preferences) and specify all you test-to-production source folder mappings (see http://moreunit.sourceforge.net/#doc-projectproperties).

    Regards,
    Nicolas

     
  • Nicolas Demengel

    Sorry, I found the difference: my global settings for the test source folder where "test" and not "src/test/java". Since that folder does not exists, MoreUnit switched to an intelligent guess, which made the scenario work.

    So, in your situation, you do have to define specific settings at the project level, as described here: http://moreunit.sourceforge.net/#doc-projectproperties.

     
  • Nicolas Demengel

    (Or you can put whatever non-existing folder in the default setting and let MoreUnit guess everything, but it's kind of a hack, which may not work in the future.)

    The auto-guess feature is recent and it is not guaranteed that everything will work with such a set-up. It has been added to release the pain of configuring everything rightly at first use, but it would be great if we could allow MoreUnit to generally work without any configuration.

     
  • Andrei Zagorneanu

    Hi Nicolas! Thanks for your quick answer, the auto-guess feature is working pretty well.

    The project level settings is not the best solution for me due to the fact that I'm importing very often new modules to my workspace. I will stay with auto-guess for now.

     
  • Nicolas Demengel

    I'm glad it's working! I let this request open as a reminder to make the auto-guess mode a real default mode.

     

Log in to post a comment.