Class TestFilter
java.lang.Object
com.sun.javatest.TestFilter
- Direct Known Subclasses:
AllTestsFilter, CompositeFilter, ExcludeListFilter, InitialUrlFilter, KeywordsFilter, ObservableTestFilter, StatusFilter
A filter interface for TestDescriptions.
Implementations of this class should implement the equals()
and hashCode() as per the spec in java.lang.Object. This is used
by the harness for file equality purposes which looking for changes and
optimizations to perform.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis exception is to report problems that occur while filtering tests.static interfaceAn interface for notification about why a test has been filtered out. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanDetermines whether a TestDescription should be accepted or rejected by this filter.booleanDetermines whether a TestDescription should be accepted or rejected by this filter; if rejected, it is reported to the provided observer.booleanaccepts(TestResult tr) booleanaccepts(TestResult tr, TestFilter.Observer o) abstract StringGet a description of this filter, as might be used to give more details about this filter than provided bygetName().abstract StringgetName()Get the name of this filter, as might be used to choose of of a set of filters.abstract StringGet the reason why this filter would reject a test, as might be used in reports.
-
Constructor Details
-
TestFilter
public TestFilter()
-
-
Method Details
-
getName
Get the name of this filter, as might be used to choose of of a set of filters. This string should be localized.- Returns:
- the name of this filter
-
getDescription
-
getReason
Get the reason why this filter would reject a test, as might be used in reports. This string should be localized.- Returns:
- a rejection reason for this filter
-
accepts
Determines whether a TestDescription should be accepted or rejected by this filter.- Parameters:
td- the TestDescription to check- Returns:
- true if td should be included in collection; false otherwise.
- Throws:
TestFilter.Fault- if an error occurs while trying to determine if this test should be accepted or not.
-
accepts
- Throws:
TestFilter.FaultTestResult.Fault
-
accepts
Determines whether a TestDescription should be accepted or rejected by this filter; if rejected, it is reported to the provided observer.- Parameters:
td- The TestDescription to check.o- An observer, which will be notified if the test is rejected by this filter.- Returns:
- true if td should be included in collection; false otherwise.
- Throws:
TestFilter.Fault- if an error occurs while trying to determine if this test should be accepted or not.
-
accepts
public boolean accepts(TestResult tr, TestFilter.Observer o) throws TestFilter.Fault, TestResult.Fault - Throws:
TestFilter.FaultTestResult.Fault
-