uk.org.skeet.jbench
Class BenchSuite

java.lang.Object
  |
  +--uk.org.skeet.jbench.BenchSuite
Direct Known Subclasses:
PropertyBasedSuite

public class BenchSuite
extends java.lang.Object

Class encapsulating a set of tasks and a general configuration. A BenchSuite may in turn contain further BenchSuites. In that case, tasks from the subsidiary BenchSuites are used, but the configuration isn't.


Constructor Summary
BenchSuite()
           
 
Method Summary
 void addSuite(BenchSuite suite)
          Adds a suite to this one, as a subsidiary.
 void addSystemInformation(java.lang.String info)
          Adds an item of system information to the list
 void addTask(BenchTask task)
           
 java.util.List getAllTasks()
          Returns a list of all the tasks contained in this suite and all subsidiary suites.
 JBenchEventListener getEventListener()
          Returns the event listener for this suite.
 int getExcludeBest()
          Returns how many of the best results will be excluded
 int getExcludeWorst()
          Returns how many of the worst results will be excluded
 int getRunsPerTask()
          Returns the number of tests to run on each task
 java.util.List getSuiteList()
          Returns a list of the subsidiary suites.
 java.util.List getSystemInformation()
          Returns the list of system information items
 java.util.List getTaskList()
          Returns a list of just the tasks contained in this suite, not including subsidiary suites.
 BenchTimer getTimer()
          Returns the timer to use in performance measurements
 boolean isFailFast()
          Returns whether or not this suite fails on error
 void resetSuiteList()
          Resets the list of subsidiary suites.
 void resetSystemInformation()
          Resets the list of system information items
 void resetTaskList()
          Resets the list of tasks for this suite (not subsidiary suites).
 void runTests()
          Runs the tests themselves, including those defined in subsidiary suites.
 void setEventListener(JBenchEventListener eventListener)
          Sets the event listener for this suite.
 void setExcludeBest(int excludeBest)
          Sets how many of the best results should be excluded
 void setExcludeWorst(int excludeWorst)
          Sets how many of the worst results should be excluded
 void setFailFast(boolean failFast)
          Specifies whether or not this suite should fail on error
 void setRunsPerTask(int runsPerTask)
          Sets the number of tests to run on each task
 void setTimer(BenchTimer timer)
          Sets the timer to use in performance measurements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BenchSuite

public BenchSuite()
Method Detail

runTests

public void runTests()
Runs the tests themselves, including those defined in subsidiary suites. Note that after each task is run, it is removed from the list so they may be garbage collected. If the event listener is null at the start of this method, it is replaced with an EventWriter writing to System.out.

isFailFast

public boolean isFailFast()
Returns whether or not this suite fails on error

setFailFast

public void setFailFast(boolean failFast)
Specifies whether or not this suite should fail on error

getTaskList

public java.util.List getTaskList()
Returns a list of just the tasks contained in this suite, not including subsidiary suites.

getAllTasks

public java.util.List getAllTasks()
Returns a list of all the tasks contained in this suite and all subsidiary suites.

addTask

public void addTask(BenchTask task)

resetTaskList

public void resetTaskList()
Resets the list of tasks for this suite (not subsidiary suites).

getSuiteList

public java.util.List getSuiteList()
Returns a list of the subsidiary suites.

addSuite

public void addSuite(BenchSuite suite)
Adds a suite to this one, as a subsidiary.

resetSuiteList

public void resetSuiteList()
Resets the list of subsidiary suites.

getEventListener

public JBenchEventListener getEventListener()
Returns the event listener for this suite.

setEventListener

public void setEventListener(JBenchEventListener eventListener)
Sets the event listener for this suite.

getRunsPerTask

public int getRunsPerTask()
Returns the number of tests to run on each task

setRunsPerTask

public void setRunsPerTask(int runsPerTask)
Sets the number of tests to run on each task

getExcludeBest

public int getExcludeBest()
Returns how many of the best results will be excluded

setExcludeBest

public void setExcludeBest(int excludeBest)
Sets how many of the best results should be excluded

getExcludeWorst

public int getExcludeWorst()
Returns how many of the worst results will be excluded

setExcludeWorst

public void setExcludeWorst(int excludeWorst)
Sets how many of the worst results should be excluded

getSystemInformation

public java.util.List getSystemInformation()
Returns the list of system information items

addSystemInformation

public void addSystemInformation(java.lang.String info)
Adds an item of system information to the list

resetSystemInformation

public void resetSystemInformation()
Resets the list of system information items

getTimer

public BenchTimer getTimer()
Returns the timer to use in performance measurements

setTimer

public void setTimer(BenchTimer timer)
Sets the timer to use in performance measurements