|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.grinder.common.AbstractTestSemantics
net.grinder.script.Test
public class Test
Scripts create Test instances which can then be used
to wrap(java.lang.Object) other Jython objects.
To The Grinder, a test is a unit of work against which statistics are recorded. Tests are uniquely defined by a test number and may also have a description. Scripts can report many different types of thing against the same test, The Grinder will aggregate the results.
Creating a Test will automatically update The
Grinder console with the test number and the description. If
two Tests are created with the same number but a
different description, the console will show the first
description.
| Nested Class Summary | |
|---|---|
static interface |
Test.InstrumentationFilter
Selective instrumentation. |
| Constructor Summary | |
|---|---|
Test(int number,
java.lang.String description)
Creates a new Test instance. |
|
| Method Summary | |
|---|---|
java.lang.String |
getDescription()
Get the test description. |
int |
getNumber()
Get the test number. |
void |
record(java.lang.Object target)
Instrument the supplied target object. |
void |
record(java.lang.Object target,
Test.InstrumentationFilter filter)
Version of record that allows selective
instrumentation of an object. |
java.lang.Object |
wrap(java.lang.Object target)
Creates a proxy script object that has the same interface as the passed object. |
| Methods inherited from class net.grinder.common.AbstractTestSemantics |
|---|
compareTo, equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Test(int number,
java.lang.String description)
Test instance.
number - Test number.description - Test description.| Method Detail |
|---|
public final int getNumber()
getNumber in interface Testpublic final java.lang.String getDescription()
getDescription in interface Test
public final java.lang.Object wrap(java.lang.Object target)
throws NotWrappableTypeException
Test statistics. This method can be called many
times, for many different targets.
target - Object to wrap.
NotWrappableTypeException - If the target object could not be
wrapped.
public final void record(java.lang.Object target)
throws NonInstrumentableTypeException
target object. Subsequent calls to target will be recorded against the statistics for this Test.
target - Object to instrument.
NonInstrumentableTypeException - If target could not be instrumented.
public final void record(java.lang.Object target,
Test.InstrumentationFilter filter)
throws NonInstrumentableTypeException
record that allows selective
instrumentation of an object.
The instrumenter will pass candidate items for instrumentation to the
supplied filter. Only items for which the filter returns true will be instrumented.
The type of item passed to the filter depends upon the instrumenter, and in
turn this depends on the type of target. For example, the Java DCR
instrumenter will pass Methods to the filter.
Some instrumenters, including the Jython instrumenter, do not support
selective instrumentation. If an instrumenter can handle the target
, but does not support selective instrumentation, this method will throw
NonInstrumentableTypeException. The non-selective version of
record(Object) should be used instead.
target - Object to instrument.filter - Filter that selects the parts of target to instrument.
NonInstrumentableTypeException - If target could not be instrumented.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||