net.sf.jbenchmark
Class BenchmarkTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended bynet.sf.jbenchmark.BenchmarkTask

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

Currently the main part of JBenchmark intended for running from ANT only. In the future we would like to extract this and have this class as an integration point only.

Version:
$Id: BenchmarkTask.java,v 1.12 2004/07/02 05:51:35 twpatkua Exp $
Author:
Adam Murdoch

Nested Class Summary
static class BenchmarkTask.Script
          Information about a benchmark script.
 
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
BenchmarkTask()
           
 
Method Summary
 void addConfiguredDb(ConnectionFactory factory)
          Adds a connection factory.
 void addConfiguredHttpServer(HttpServer server)
          Adds a HTTP server element.
 void addConfiguredPublisher(FileResultPublisher publisher)
          Adds a result publisher.
 void addConfiguredScript(BenchmarkTask.Script script)
          Adds a benchmark script to execute.
protected  java.lang.Object dynamicallyLoad(java.lang.Class superClass, java.lang.String className)
          Load a class ensuring that it is of a specific type of super class.
 void execute()
          Executtes the benchmark.
protected  TopLevelContext getTestContext()
           
 void setFormatter(java.lang.String formatterClassName)
          Set the formatter.
 void setScript(java.io.File script)
          Sets the benchmark script to execute.
 void setStatisticPublisher(java.lang.String statisticPublisherName)
          Set the statistic publisher.
 
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

BenchmarkTask

public BenchmarkTask()
Method Detail

setScript

public void setScript(java.io.File script)
Sets the benchmark script to execute.


addConfiguredScript

public void addConfiguredScript(BenchmarkTask.Script script)
Adds a benchmark script to execute.


addConfiguredHttpServer

public void addConfiguredHttpServer(HttpServer server)
Adds a HTTP server element.


addConfiguredPublisher

public void addConfiguredPublisher(FileResultPublisher publisher)
Adds a result publisher.


addConfiguredDb

public void addConfiguredDb(ConnectionFactory factory)
Adds a connection factory.


setStatisticPublisher

public void setStatisticPublisher(java.lang.String statisticPublisherName)
Set the statistic publisher.


setFormatter

public void setFormatter(java.lang.String formatterClassName)
Set the formatter. We don't set it on the publisher immediately becuase it may not have been specified.


dynamicallyLoad

protected java.lang.Object dynamicallyLoad(java.lang.Class superClass,
                                           java.lang.String className)
Load a class ensuring that it is of a specific type of super class.


getTestContext

protected TopLevelContext getTestContext()
Returns:
TopLevelContext

execute

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

Throws:
org.apache.tools.ant.BuildException