MAven FItnesse Adaptor

A maven plugin for FitNesse

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

nl.sijpesteijn.testing.fitnesse.plugins
ArtifactId

ArtifactId

mafia-maven-plugin
Last Version

Last Version

2.1.12
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

MAven FItnesse Adaptor
A maven plugin for FitNesse
Project URL

Project URL

https://github.com/sijpesteijn/mafia-maven-plugin

Download mafia-maven-plugin

How to add to project

<plugin>
    <groupId>nl.sijpesteijn.testing.fitnesse.plugins</groupId>
    <artifactId>mafia-maven-plugin</artifactId>
    <version>2.1.12</version>
</plugin>

Dependencies

compile (27)

Group / Artifact Type Version
org.fitnesse : fitnesse jar 20140630
com.ximpleware : vtd-xml jar 2.13
org.apache.maven : maven-artifact jar 3.0.5
org.apache.maven : maven-plugin-api jar 3.0.5
org.apache.maven : maven-model jar 3.0.5
org.apache.maven : maven-core jar 3.0.5
org.apache.maven : maven-repository-metadata jar 3.0.5
org.apache.maven.reporting : maven-reporting-api jar 3.0
org.apache.maven.reporting : maven-reporting-impl jar 2.0.5
org.jsoup : jsoup jar 1.7.2
ant : ant jar 1.7.0
org.apache.maven.doxia : doxia-sink-api jar 1.0
org.apache.maven.doxia : doxia-site-renderer jar 1.0
org.codehaus.plexus : plexus-archiver jar 2.3
org.codehaus.plexus : plexus-utils jar 3.0.9
org.apache.maven.shared : file-management jar 1.2.1
org.codehaus.plexus : plexus-container-default jar 1.0-alpha-9-stable-1
org.codehaus.plexus : plexus-io jar 2.0.6
org.apache.maven.shared : maven-dependency-analyzer jar 1.4
org.apache.maven.shared : maven-dependency-tree jar 2.0
org.apache.maven.shared : maven-common-artifact-filters jar 1.4
org.apache.maven.shared : maven-invoker jar 2.0.11
commons-lang : commons-lang jar 2.6
commons-io : commons-io jar 2.4
commons-collections : commons-collections jar 3.2.1
classworlds : classworlds jar 1.1
org.mockito : mockito-core jar 1.9.5

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.2

test (2)

Group / Artifact Type Version
junit : junit jar 4.9
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 2.1

Project Modules

There are no modules declared in this project.

THIS PLUGIN IS NO LONGER ACTIVELY MAINTAINED. Feel free to send merge request. If anybody would like to maintain this plugin, please contact me and YOU could become the owner!

This is a maven plugin for FitNesse.

mafia-maven-plugin MAaven FItnesse Adapter

This plugin let's you control:

  • STARTING & STOPPING FitNesse.
  • RUN TEST(S), SUITE(S), OR TAG FILTERED TESTS.
  • CLASSPATH ENTRIES & DEFINITIONS can be written to root page of FitNesse using the pom configuration.
  • COLLECT REPORTING.

Supported versions of FitNesse:

  • 20150424
  • 20150226
  • 20140630
  • 20140623
  • 20140418
  • 20140201
  • 20131110
  • 20131109
  • 20130530
  • 20130531
  • 20121220
  • 20111025

**NOTE if you don't want to use the fitnesse version (= latest) that comes with the mafia plugin, please include fitnesse as a dependency of your product. IMPORTANT add the <classifier>standalone</classifier> to include velocity and htmlparser dependencies.

1 - STARTING FitNesse.

goal: start
phase: install
command: mvn mafia:start

This maven goal will start the FitNesse server. You can create a configuration section in your pom to change default behaviour.
Configuration:

Property Default Description
fitNessePort 9090 Port for FitNesse to listen on.
wikiRoot ${basedir} Root of FitNesse.
nameRootPage FitNesseRoot Name of the root page
retainDays 14 Number of days to retain older versions (.zip files)
jvmArguments Arguments for the jvm.
jvmDependencies Classpath entries for the jvm.
fitNesseAuthenticateStart no auth username:password - Enforces access for one user or /auth/file/path/and/name - Enforces access for a file of users with encrypted passwords
fitNesseVerbose false Sets verbose option for fitnesse
logDirectory ${basedir}/log/ Where to put and what to call the run log.
connectionAttempts 4 Mafia waits for the startup of FitNesse by trying to connect to it. This configuration determines how often Mafia will attempt.

Configuration example with defaults and example values:

  
	<plugin>
		<groupId>nl.sijpesteijn.testing.fitnesse.plugins</groupId>
		<artifactId>mafia-maven-plugin</artifactId>
		<configuration>
			<fitNessePort>9090</fitNessePort>
			<wikiRoot>${basedir}</wikiRoot>
			<nameRootPage>FitNesseRoot</nameRootPage>
			<retainDays>14</retainDays>
			<jvmArguments>
				<jvmArgument>CM_SYSTEM=fitnesse.wiki.cmSystems.GitCmSystem</jvmArgument>
			</jvmArguments>
			<jvmDependencies>
				<dependency>
					<groupId>nl.abc.fitnesse</groupId>
					<artifactId>fitnesse-plugin</artifactId>
				</dependency>
			</jvmDependencies>
			<log>${basedir}/log/</log>
			<connectionAttempts>4</connectionAttempts>
		</configuration>
	 </plugin>
  

2 - STOPPING FitNesse.

goal: stop
phase: clean
command: mvn mafia:stop

This maven goal will stop the FitNesse server. You can create a configuration section in your pom to change default behaviour.
Configuration:

Property Default Description
fitNessePort 9090 Port for FitNesse to listen on.
jvmArguments Arguments for the jvm.
jvmDependencies Classpath entries for the jvm.
fitNesseAuthenticateStop no auth username:password - Enforces access for user on shutdown

Configuration example with defaults and exmaple values:

  
	<plugin>
		<groupId>nl.sijpesteijn.testing.fitnesse.plugins</groupId>
		<artifactId>mafia-maven-plugin</artifactId>
		<configuration>
			<fitNessePort>9090</fitNessePort>
			<jvmArguments>
				<jvmArgument>CM_SYSTEM=fitnesse.wiki.cmSystems.GitCmSystem</jvmArgument>
			</jvmArguments>
			<jvmDependencies>
				<dependency>
					<groupId>nl.abc.fitnesse</groupId>
					<artifactId>fitnesse-plugin</artifactId>
				</dependency>
			</jvmDependencies>
		</configuration>
	</plugin>
  

3 - RUN TEST(S), SUITE(S), OR TAG FILTERED TESTS.

goal: test
phase: integration-test
command: mvn mafia:test

This maven goal will run the tests listed in the configuration section. Note that the tests are run on a FitNesse server running on separate port, default 9091.
Configuration:

Property Default Description
fitNesseRunPort 9091 Port for FitNesse to listen on.
jvmArguments Arguments for the jvm.
jvmDependencies Classpath entries for the jvm.
testResultsDirectory ${basedir}/FitNesse/files/mafiaTestResults Output directory for the mafia test results.
stopTestsOnIgnore false Stop the run when an ignore exception occurs.
stopTestsOnException true Stop the run when an exception occurs.
stopTestsOnWrong true Stop the run when a wrong exception occurs.
tests List of elements with tests.
suites List of elements with suites.
suitePageName Root page of filtered suites to run.
suiteFilter tag filter to use. Used in combination with a suitePageName
fitNesseAuthenticateStart no auth username:password - Enforces access for one user or /auth/file/path/and/name - Enforces access for a file of users with encrypted passwords on startup
fitNesseAuthenticateStop no auth username:password - Enforces access for user on shutdown
fitNesseUpdatePrevents update Prevents (omits) updating FitNesseRoot content
fitNesseVerbose not verbose Sets verbose option for fitnesse
writeSurefireReports false If true, every test result will be written to the folder "surefire-reports" in the maven build directory. This enabled tools like Jenkins to recognize if a test failed.
connectionAttempts 4 Mafia waits for the startup of FitNesse by trying to connect to it. This configuration determines how often Mafia will attempt.

Configuration with defaults. tests, suites and a suiteFilter can be mixed. A suiteFilter needs a suitePageName.

  
	<plugin>
		<groupId>nl.sijpesteijn.testing.fitnesse.plugins</groupId>
		<artifactId>mafia-maven-plugin</artifactId>
		<configuration>
			<fitNesseRunPort>9091</fitNesseRunPort>
			<jvmArguments>
				<jvmArgument>CM_SYSTEM=fitnesse.wiki.cmSystems.GitCmSystem</jvmArgument>
			</jvmArguments>
			<jvmDependencies>
				<dependency>
					<groupId>nl.abc.fitnesse</groupId>
					<artifactId>fitnesse-plugin</artifactId>
				</dependency>
			</jvmDependencies>
			<testResultsDirectory>${project.build.directory}/fitnesse/</testResultsDirectory>
			<stopTestsOnIgnore>false</stopTestsOnIgnore>
			<stopTestsOnException>true</stopTestsOnException>
			<stopTestsOnWrong>true</stopTestsOnWrong>
			<tests>
				<test>FrontPage.IntegrationTest</test>
				<test>...</test>
			</tests>
			<suites>
				<suite>FrontPage.IntegrationSuite</suite>
				<suite>...</suite>
			</suites>
			<suitePageName>FrontPage.SomeSuite</suitePageName>
			<suiteFilter>critical_tests</suiteFilter>
			<writeSurefireReports>false</writeSurefireReports>
			<connectionAttempts>4</connectionAttempts>
		</configuration>
	</plugin>
  

4 CLASSPATH ENTRIES & DEFINITIONS.

goal: content
phase: process-resources

command: mvn mafia:content


This maven goal will create the content.txt file, root page, for FitNesse, filling it with classpath entries (!path ) and definitions (!define ). Automatically including the compile and runtime dependencies, but you can exclude dependencies in the configuration.
Configuration:

Property Default Description
wikiRoot ${basedir} Root of FitNesse.
nameRootPage FitNesseRoot Name of the root page
statics Values ares copied as is to content.txt (This could also be wiki text)
resources Values are prefixed with !define and copied to content.txt
targets Values are prefixed with !define and postfixed with /target/classes/ and added to content.txt (useful for hot-deployment).
excludeDependencies Listed dependencies are excluded from the classpath entries. (Most likely the ones listed in the targets configuration section).

Example:

  
	<plugin>
		<groupId>nl.sijpesteijn.testing.fitnesse.plugins</groupId>
		<artifactId>mafia-maven-plugin</artifactId>
		<configuration>
		    <wikiRoot>${basedir}</wikiRoot>
		    <nameRootPage>FitNesseRoot</nameRootPage>
			<statics>
				<static>!define TEST_SYSTEM {slim}</static>
			</statics>
			<resources>
				<resource>/resource_location/resources/</resource>
			</resources>
			<targets>
				<target>../application-to-test/</target>
			</targets>
			<excludeDependencies>
				<dependency>
					<groupId>nl.abc.dependency</groupId>
					<artifactId>some-artifact</artifactId>
					<version>1.0.0</version>
				</dependency>
			</excludeDependencies>
		</configuration>
	</plugin>
  

5 - COLLECT REPORTING.

goal: report
phase: site

command: mvn mafia:report

This maven goal will generate a report of the last run tests.
Configuration:

Property Default Description
wikiRoot ${basedir} Root of FitNesse.
nameRootPage FitNesseRoot Name of the root page

Configuration with defaults:

  
    <reporting>
        <plugins>
            <plugin>
                <groupId>nl.sijpesteijn.testing.fitnesse.plugins</groupId>
                <artifactId>mafia-maven-plugin</artifactId>
                <configuration>
                    <wikiRoot>${basedir}</wikiRoot>
                    <nameRootPage>FitNesseRoot</nameRootPage>
                </configuration>
            </plugin>
        </plugins>
    </reporting>
 

Versions

Version
2.1.12
2.1.11
2.1.10
2.1.9
2.1.8
2.1.7
2.1.6
2.1.5
2.1.4
2.1.3
2.1.2
2.1.1
2.1.0
2.0.0
1.0.14
1.0.13
1.0.12
1.0.11
1.0.10
1.0.9
1.0.8
1.0.7
1.0.6