2

What would be the best approach:

./src/test/app ./src/main/app/MODULE/test

I am "somehow" new to java an its testing environment. This given I would like to follow the maven structure as "ant" is too cryptic for a java beginner (I love make).

Then I would start with testNG and not junit.

My application is somehow monolithic, in the sense it is not separable, except a future change from MVC to something a bit more comfortable: a 2 component system to be decided. Which will never be on the side. They stay as such and within the "monolithic" app.

Then the question: what would be a good starting approach to testing?

  • ./src/test/
  • ./src/main/app/MODULE/test
mariotti
  • 410
  • 1
  • 5
  • 23
  • I am sorry, it looks like I am not used anymore to the stackoverflow editor. I will edit the question asap. – mariotti Sep 25 '14 at 21:30
  • Here I post a generic question, but in principle I would not mind to see the answers in relation to: maven profiles and "git workflow". Pro and cons. I think this is a good generic question. – mariotti Sep 25 '14 at 21:42

1 Answers1

2

For any maven project, src/test/ is always more appropriate.

If you add your classes under directory /src/main/app/MODULE/test, somehow you will be able to execute/debug these classes but these classes will get added in the final artifact which you may not wants to happen.

asg
  • 2,248
  • 3
  • 18
  • 26
  • I accepted the answer, as indeed it should be a mvn standard approach. Which makes indeed the question not relevant. Can we change maven settings? to work for a module based tests? – mariotti Jan 02 '15 at 01:21
  • You can change the directory structure, but I would suggest not to go for it - http://stackoverflow.com/questions/15333964/how-to-edit-the-directory-structure-in-maven. For module based tests, your packaging structure will work well. We have used the same approach. – asg Jan 02 '15 at 05:51