org.apache.cactus.integration.ant
Class RunServerTestsTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.cactus.integration.ant.RunServerTestsTask

public class RunServerTestsTask
extends org.apache.tools.ant.Task

Task to automate running in-container unit test. It has the following syntax when used in Ant :

   <runservertests testURL="&t;url>"
          starttarget="<start target name>"
          stoptarget="<stop target name>"
          testtarget="<test target name>"/>
 
where <url> is the URL that is used by this task to ensure that the server is running. Indeed, the algorithm is as follow :

Since:
Cactus 1.5
Version:
$Id: RunServerTestsTask.java 239003 2004-05-31 20:05:27Z vmassol $

Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
RunServerTestsTask()
           
 
Method Summary
 GenericContainer.Hook createStart()
          Creates a nested start element.
 GenericContainer.Hook createStop()
          Creates a nested stop element.
 GenericContainer.Hook createTest()
          Creates a nested test element.
 void execute()
          
 void setStartTarget(java.lang.String theStartTarget)
          Sets the target to call to start the server.
 void setStopTarget(java.lang.String theStopTarget)
          Sets the target to call to stop the server.
 void setTestTarget(java.lang.String theTestTarget)
          Sets the target to call to run the tests.
 void setTestURL(java.net.URL theTestURL)
          Sets the URL to call for testing if the server is running.
 void setTimeout(long theTimeout)
           
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunServerTestsTask

public RunServerTestsTask()
Method Detail

execute

public void execute()
             throws org.apache.tools.ant.BuildException

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException
See Also:
Task.execute()

createStart

public final GenericContainer.Hook createStart()
Creates a nested start element.

Returns:
The start element

setStartTarget

public void setStartTarget(java.lang.String theStartTarget)
Sets the target to call to start the server.

Parameters:
theStartTarget - the Ant target to call

createStop

public final GenericContainer.Hook createStop()
Creates a nested stop element.

Returns:
The stop element

setStopTarget

public void setStopTarget(java.lang.String theStopTarget)
Sets the target to call to stop the server.

Parameters:
theStopTarget - the Ant target to call

createTest

public final GenericContainer.Hook createTest()
Creates a nested test element.

Returns:
The test element

setTestTarget

public void setTestTarget(java.lang.String theTestTarget)
Sets the target to call to run the tests.

Parameters:
theTestTarget - the Ant target to call

setTestURL

public void setTestURL(java.net.URL theTestURL)
Sets the URL to call for testing if the server is running.

Parameters:
theTestURL - the test URL to ping

setTimeout

public void setTimeout(long theTimeout)
Parameters:
theTimeout - the timeout after which we stop trying to call the test URL.


Copyright © 2001-2009 The Apache Software Foundation. All Rights Reserved.