Running integration tests with surefire in integration-test phase

The Maven Failsafe Plugin is a fork of the Maven Surefire Plugin designed to help when running integration tests. However, sometimes you may want to use Surefire for integration testing. The situation may be even more complicated if have unit tests and integration tests in the same module. The solution isn’t very pretty but it’s still quite short and understandable…

The Maven Failsafe Plugin is a fork of the Maven Surefire Plugin designed to help when running integration tests. However, sometimes you may want to use Surefire for integration testing. The situation may be even more complicated if have unit tests and integration tests in the same module. The solution isn’t very pretty but it’s still quite short and understandable:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
        <skip>true</skip>
    </configuration>
    <executions>
        <!-- run all tests except integration tests -->
        <execution>
            <id>surefire</id>
            <phase>test</phase>
            <goals>
                <goal>test</goal>
            </goals>
            <configuration>
                <skip>false</skip>
                <excludes>
                    <exclude>pl/touk/cc/dao/mybatis/integration/**</exclude>
                </excludes>
            </configuration>
        </execution>
        <!-- run all integration tests -->
        <execution>
            <id>surefire-it</id>
            <phase>integration-test</phase>
            <goals>
                <goal>test</goal>
            </goals>
            <configuration>
                <skip>false</skip>
                <includes>
                    <include>pl/touk/cc/dao/mybatis/integration/**</include>
                </includes>
            </configuration>
        </execution>
    </executions>
</plugin>
You May Also Like

GWT Hosted mode on 64bit linux

GWT for linux is build against 32bit architecture. It contains some SWT/GTK 32bit modules. So if you try to run it with 64bit java it failsException in thread "main" java.lang.UnsatisfiedLinkError: /opt/tools/sdk/gwt/gwt-linux-1.5.3/libswt-pi-gtk-3235....

mount.ntfs high cpu ubuntu

My computer suffers from sudden and continous hard drive load strokes. Sometimes it lasts for a few minutes and hence work is impossible because everything goes very slow.I'm trying to locate the cause because it makes me nervous :)Today I found one of...