fitnesseMain.ant.StartFitnesseTask Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fitnesse Show documentation
Show all versions of fitnesse Show documentation
The fully integrated standalone wiki, and acceptance testing framework.
// Copyright (C) 2003-2009 by Object Mentor, Inc. All rights reserved.
// Released under the terms of the CPL Common Public License version 1.0.
package fitnesseMain.ant;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import fitnesseMain.FitNesseMain;
/**
* Task to start fitnesse.
*
* Usage:
* <taskdef name="start-fitnesse" classname="fitnesse.ant.StartFitnesseTask" classpathref="classpath" />
* OR
* <taskdef classpathref="classpath" resource="tasks.properties" />
*
* <start-fitnesse wikidirectoryrootpath="." fitnesseport="8082" />
*
*/
public class StartFitnesseTask extends Task {
private String wikiDirectoryRootPath;
private int fitnessePort = 8082;
@Override
public void execute() throws BuildException {
try {
FitNesseMain.main(new String[]
{"-p", String.valueOf(fitnessePort), "-d", wikiDirectoryRootPath, "-e", "0", "-o"});
log("Sucessfully Started Fitnesse on port " + fitnessePort);
}
catch (Exception e) {
throw new BuildException("Failed to start FitNesse. Error Msg: " + e.getMessage(), e);
}
}
/**
* Set port on which fitnesse would run. Defaults to 8082.
*
* @param fitnessePort port on which fitnesse would run
*/
public void setFitnessePort(int fitnessePort) {
this.fitnessePort = fitnessePort;
}
/**
* Set the path to the FitnesseRoot filder which contains all the wiki pages. MUST SET.
*
* @param wikiDirectoryRootPath path to the FitnesseRoot filder which contains all the wiki pages
*/
public void setWikiDirectoryRootPath(String wikiDirectoryRootPath) {
this.wikiDirectoryRootPath = wikiDirectoryRootPath;
}
}