net.sf.jbenchmark
Interface TestContext

All Known Implementing Classes:
TestGroup, TopLevelContext

public interface TestContext

The context that a test runs in.

Version:
$Id: TestContext.java,v 1.4 2004/07/01 00:48:43 twpatkua Exp $
Author:
Adam Murdoch

Method Summary
 java.lang.String getAttribute(java.lang.String name)
          Returns the value of a test attribute.
 java.io.InputStream getExternalResource(java.lang.String nameOfResource)
          Locates an external resource made available from the class loader in which this context was made available.
 TestListener getListener()
          Returns the listener to use to notify the container of test execution.
 java.lang.Object getResource(java.lang.Class resClass)
          Locates a resource.
 int getThreadCount()
          Returns the number of test threads executing in this context.
 void setAttribute(java.lang.String name, java.lang.String value)
          Sets the value of a test attribute.
 

Method Detail

getResource

public java.lang.Object getResource(java.lang.Class resClass)
                             throws java.lang.Exception
Locates a resource.

Throws:
java.lang.Exception

getExternalResource

public java.io.InputStream getExternalResource(java.lang.String nameOfResource)
                                        throws java.lang.Exception
Locates an external resource made available from the class loader in which this context was made available.

Throws:
java.lang.Exception

getListener

public TestListener getListener()
Returns the listener to use to notify the container of test execution.


getThreadCount

public int getThreadCount()
Returns the number of test threads executing in this context.


getAttribute

public java.lang.String getAttribute(java.lang.String name)
Returns the value of a test attribute.

Returns:
The value of the attribute, or null if the attribute has no value.

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)
Sets the value of a test attribute.