I am writing my unit test cases for a Java project using Scala (JUnit 4). I am running the tests using Maven.
I have written a src/test/scala/com.xxx.BaseTest
class for the tests to provide some common functionality (@BeforeClass
, etc.), but no actual @Test
cases.
Whenever I run the tests using mvn
on the command line, it insists on trying to look for tests in the BaseTest
class, and gets an error because there are none present.
Other than using an @Ignore
, is there any way to have Maven/Scala/Surefire not try to run the BaseTest
class? Adding the @Ignore
is not a big deal, but my test run shows one more test than I actually have with the label "Skipped: 1".
UPDATE: I found a solution. I renamed BaseTest
to Base
; Maven now ignores it. Is there any other way?