I just started working on a Java project (as I usually use .net), and one of the first things that seems strange to me is that the Maven project has a directory / src and / test, where obviously the source code and tests must go.
In .net, I preferred having tests in a separate assembly / project, so for example, I would:
Thus, I do not need to inflate my deployed code with any tests, and this simplifies the verification of my code in real isolation, and in many cases I did not write tests for one project, I would just have a solution to unit / integration / acceptance tests, t .e. MySolution.UnitTests, MySolution.IntegrationTests.
However, in Java, this seems to merge together, and I would rather separate it, however I heard that Maven is a cruel lover when you want to treat the default structures differently.
So, to enter this post again, my main questions are:
- Is there a way to separate tests from a project
- Based on the above information, are there any pros for actual testing within the project? (besides, when you check this, you always have tests).
source
share