All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fitnesseMain.ant.StopFitnesseTask Maven / Gradle / Ivy

There is a newer version: 20181217
Show newest version
// 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; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy