I'm using Selenium Web driver for end to end integration testing and I have 1) refactored my integration tests to a new source folder hierarchy "src/it", 2) set up Failsafe for handling integration tests, 3) installed maven-builder-helper and finally I tried to configure surefire to ignore tests in the integration-test source folder. The latter as the name pattern of the tests didn't seem to be enough for excluding them.
I'm having the problem that all tests run when I build, either automatically via Infinitest or when I use the menu command "Run As Junit test". It would seem the latter runs all tests no matter where. I guess it isn't issuing "mvn test". So why not use the actual maven commands instead?
Ok, so I try mvn test from the menu which succeeds as integration tests does not run my 2 integration tests named "HomeIT.java" and "EntoIntegrationTest.java". That is until Infinitest kicks in again and run them all. So I try with "infinitest.filters" in the root of the project with these patterns:This seems to be working as the integration tests doesn't run now. Yay!Code:**/*IT.* **/*IntegrationTest.*
Now, when I try to run the integration-test goal failsafe runs, but the previously succeeding tests fails. Obviously the server isn't started in process and the already running instance via "Server" isn't called. How can I make the start up of a tomcat instance a part of my integration tests? Perhaps use Jetty instead?
tomcat:run doesn't run the integration tests. I must study goals better I suppose. Any pointers?
Here's my setup of Maven Failsafe:And this is the Surefire exclusion:Code:<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>2.12</version> <configuration> <junitArtifactName> org.junit:com.springsource.org.junit </junitArtifactName> </configuration> <executions> <execution> <id>integration-test</id> <goals> <goal>integration-test</goal> </goals> </execution> <execution> <id>verify</id> <goals> <goal>verify</goal> </goals> </execution> </executions> </plugin>and finally the Maven-Builder-Helper:Code:<exclude>**/it/*</exclude>Code:<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <version>1.5</version> <executions> <execution> <id>add-it-source</id> <goals> <goal>add-test-source</goal> </goals> <configuration> <sources> <source>src/it/java</source> </sources> </configuration> </execution> <execution> <id>add-it-resource</id> <goals> <goal>add-test-resource</goal> </goals> <configuration> <resources> <resource> <directory>src/it/resources</directory> </resource> </resources> </configuration> </execution> </executions> </plugin>


Reply With Quote