Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the 'IT.java' filename Suffix (instead of 'Test.java') for JUnit Integration Tests a convention? [closed]

I was used to naming my JUnit Integration tests with a *Test.java on the end eg DatabaseConnectionTest.java and placing them in their own integration test directory: eg test/integration/com...

On joining a new project I was directed

No, all the Tests go in the one directory, and we distinguish the Unit Tests from the Integration tests by pattern matching on the file name suffix.

So my file above would become DatabaseConnectionIT.java

Now I can see the logic in this. The test runner script can just pattern match for the files it is looking for, and all the tests are in the one location.

But I had never heard of the convention.

My question is: Is the 'IT.java' filename Suffix (instead of 'Test.java') for JUnit Integration Tests a convention?

like image 599
hawkeye Avatar asked May 06 '15 12:05

hawkeye


1 Answers

The IT.java suffix is a convention used by the Maven Failsafe Plugin. All classes in the test directory that have the suffix IT are executed by this plugin in the integragion-test phase. (Tests with suffix Test are exectued by the Maven Surefire Plugin in the test phase.)

like image 129
Stefan Birkner Avatar answered Sep 23 '22 01:09

Stefan Birkner