fitnesseMain.ant.StopFitnesseTask 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 fitnesse.FitNesse;
import fitnesse.FitNesseContext;
import fitnesse.testutil.FitNesseUtil;
/**
* Task to stop fitnesse.
*
* Usage:
* <taskdef name="stop-fitnesse" classname="fitnesse.ant.StopFitnesseTask" classpathref="classpath" />
* OR
* <taskdef classpathref="classpath" resource="tasks.properties" />
*
* <stop-fitnesse fitnesseport="8082" />
*
*/
public class StopFitnesseTask extends Task {
private int fitnessePort = 8082;
@Override
public void execute() throws BuildException {
FitNesseContext context = FitNesseUtil.makeTestContext(fitnessePort);
try {
new FitNesse(context).stop();
log("Sucessfully stoped Fitnesse on port " + fitnessePort);
}
catch (Exception e) {
throw new BuildException("Failed to stop FitNesse. Error Msg: " + e.getMessage(), e);
}
}
/**
* Set the 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;
}
}