How to run concordion test with maven?

2019-07-30 12:04发布

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.

2条回答
forever°为你锁心
2楼-- · 2019-07-30 12:28

You can use the maven failsafe plugin to run unit Concordion tests in the integration-test phase. Its similar to the surefire plugin.

查看更多
淡お忘
3楼-- · 2019-07-30 12:29

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>
查看更多
登录 后发表回答