Integration tests not getting executed

I have some junit tests and htmlunit integration tests in one of my maven project. The problem is that my integration tests are not getting executed when I run

mvn clean test

Junit Tests Here:

webstore\src\test\java\com\istore\dao\AddressTest.java

Integration Tests Here:

webstore\src\test\java\com\istore\presentation\htmlunit\PageTests.java

How does mvn determines that AddressTest.java should execute and other one should not?

Answers


http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#includes describes the expected filepatterns.

btw, if you are talking about integration tests, have a look at the maven-failsafe-plugin. It uses *IT.java as file pattern


The problem is suffix Tests, should be Test in your PageTests.java!

By default, the Surefire Plugin will automatically include all test classes with the following wildcard patterns:

  • **/Test*.java - includes all of its subdirectories and all java filenames that start with Test.

  • **/*Test.java - includes all of its subdirectories and all java filenames that end with Test.

  • **/*TestCase.java - includes all of its subdirectories and all java filenames that end with TestCase.

Maven Failsafe Plugin is for integration tests and uses suffix IT. To invoke integration tests with Failsafe Plugin use

mvn verify

References:


Problem resolved after executing following command:

mvn failsafe:integration-test

Need Your Help

SQLAlchemy, eager load postgresql INET/CIDR relationships

python postgresql sqlalchemy

I have two tables in postgresql, one named ip_address, and another named network.

Add Comments column in Windows Explorer on multiple machines

c# registry windows-explorer

I would like to add the "Comments" column to the Details view of Windows Explorer on multiple machines (for everyone at my company). I understand how to do that on a single machine by adding the c...