Run Twist Scenarios from Maven
Twist scenarios can be executed in Maven. This makes Twist Continuous Integration friendly, and allows tests to be run as part of
a build within tools such as CruiseControl. For more information about Continuous Integration, please
visit http://martinfowler.com/articles/continuousIntegration.html
Export Twist Libraries
Using Maven Integration
Twist Scenarios can be run from Maven by calling the Ant target from Maven, using the maven-antrun-plugin.
Here are the steps required to do this:
- Create the Ant target using the template 'twist-target'. See running scenarios from Ant for more.
- Create a Maven profile as shown in the example below. Replace parameters surrounded with braces with suitable values.
<profiles>
<profile>
<id>{profile-id-used-for-command-line-execution}</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>{appropriate-id}</id>
<configuration>
<tasks>
<property name="ant.library.dir" value="{location-of-ant-library}"/>
<ant dir="{location-of-ant-build-file-created-as-part-of-step-1}"
inheritRefs="true">
<target name="execute-scenarios" />
</ant>
</tasks>
</configuration>
<goals>
<goal>{a-goal-name. For egs "test"}</goal>
</goals>
<phase>{phase-after-which-the-scenarios-are-to-be-executed. For egs "post-integration-test"}</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
mvn clean install -P {profile-id-created}