Search code examples
mavenconcordion

How to run concordion test with maven?


I am wondering how to set up maven to run concordion tests having a FooFixture.java naming convention. The tests are on the classpath in src/test/specs. I would like to do it in a separate profile.

Thanks for the help.


Solution

  • I finally set the tests up is by creating a different profile to run the acceptance tests.

    An example given here:

            <profile>
            <id>acceptance-test</id>
            <activation>
                <property>
                    <name>type</name>
                    <value>acceptance</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <version>1.7</version>
                        <executions>
                            <execution>
                                <id>add-specs-source</id>
                                <phase>compile</phase>
                                <goals>
                                    <goal>add-test-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>${basedir}/src/test/specs</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>2.3.1</version>
                        <configuration>
                            <encoding>UTF-8</encoding>
                            <source>1.5</source>
                            <target>1.5</target>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.11</version>
                        <configuration>
                            <forkMode>pertest</forkMode>
                            <argLine>-Xms1024m -Xmx1024m</argLine>
                            <testFailureIgnore>false</testFailureIgnore>
                            <skip>false</skip>
                            <testSourceDirectory>src/test/specs</testSourceDirectory>
                            <includes>
                                <include>**/*Fixture.java</include>
                            </includes>
                            <systemPropertyVariables>
                                <propertyName>concordion.output.dir</propertyName>
                                <buildDirectory>target/concordion</buildDirectory>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>