How to setup multiple fitnesse suites in pom file using maven-antrun-plugin ? and how to call the specific suite run among the configured suits?

耗尽温柔 提交于 2019-12-11 08:44:13

问题


I am able to run the FitNesse suite from maven build with the following setup.

<properties>
    <fitnesse.version>20160618</fitnesse.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.fitnesse</groupId>
        <artifactId>fitnesse</artifactId>
        <version>${fitnesse.version}</version>
        <scope>runtime</scope>
    </dependency>

    <dependency>
        <groupId>org.fitnesse.plugins</groupId>
        <artifactId>maven-classpath-plugin</artifactId>
        <version>1.6</version>
        <scope>runtime</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.6</version>
            <executions>
                <execution>
                    <id>start-fitnesse-integration</id>
                    <phase>integration-test</phase>
                    <configuration>
                        <tasks>
                            <echo taskname="fitnesse" message="Starting FitNesse..." />
                            <java classname="fitnesseMain.FitNesseMain" classpathref="maven.runtime.classpath"
                                fork="true" failonerror="true">
                                <jvmarg value="-Xmx1024m" />
                                <arg line="-p 9000" />
                                <arg line="-c FrontPage.TestSuite?suite&amp;amp;format=text" />
                                <arg line="-e 0" />
                                <!-- <arg line="-d ." /> -->
                            </java>
                        </tasks>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

I am running the FitNesse suite using the below command.

mvn clean install

Now I want to configure execution of multiple FitNesse suites as part of pom.xml and want to run specific suite as part of maven build.

How can I achieve this?


回答1:


There are a couple of ways to configure multiple suites to be run:

  • Add multiple execution elements to your pom (inside the executions element you already have) one per suite, each with a unique id
  • Place all suites you want to run under a shared parent suite (and run the parent suite). You can also use symbolic links to achieve this.
  • Create a suite query page to indicate which suites should be run (and run that page).
  • Create a suite cross reference page and run that
  • Give all suites the same tag and use filters to select all suites to run based on the tag

P.S. Why are you using the antrun plugin instead of maven-exec?



来源:https://stackoverflow.com/questions/39053436/how-to-setup-multiple-fitnesse-suites-in-pom-file-using-maven-antrun-plugin-an

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!