public class CompositeFilter extends TestFilter
TestFilter.Fault, TestFilter.Observer
Constructor and Description |
---|
CompositeFilter(TestFilter[] filters)
Construct an unnamed filter composed of the given filters.
|
CompositeFilter(TestFilter[] filters,
I18NResourceBundle bundle,
java.lang.String prefix)
This is the preferred constructor which creates a filter composed of the
given filters, with descriptive string from a resource bundle.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(TestDescription td)
Determines whether a TestDescription should be accepted or rejected
by this filter.
|
boolean |
accepts(TestDescription td,
TestFilter.Observer o)
Determines whether a TestDescription should be accepted or rejected
by this filter; if rejected, it is reported to the provided observer.
|
boolean |
equals(java.lang.Object tf)
This implementation will compare the filters in the parameter filter
to the ones in this instance.
|
static boolean |
equals(TestFilter[] array1,
TestFilter[] array2)
Check if two arrays are equal, using set-equality.
|
java.lang.String |
getDescription()
Get a description of this filter, as might be used to give more details
about this filter than provided by
TestFilter.getName() . |
TestFilter[] |
getFilters()
Return the filters being used internally by this composite.
|
java.lang.String |
getName()
Get the name of this filter, as might be used to choose of of a set
of filters.
|
java.lang.String |
getReason()
Get the reason why this filter would reject a test, as might be used
in reports.
|
int |
hashCode() |
accepts, accepts
public CompositeFilter(TestFilter[] filters, I18NResourceBundle bundle, java.lang.String prefix)
An empty set of filters is accepted for convenience, but will result allowing all tests passing through for filtering to be accepted.
filters
- The filters that constitute this composite filter.
Must never be null.bundle
- The bundle to get the description, name and reason from.
Must never be null.prefix
- Prefix with which begins the I18N key for the description,
name and reason. Must never be null.TestFilter
public CompositeFilter(TestFilter[] filters)
An empty set of filters is accepted for convienience, but will result allowing all tests passing through for filtering to be accepted.
filters
- The filters that constitute this composite filter.
Must never be null.CompositeFilter(TestFilter[],I18NResourceBundle,String)
public java.lang.String getName()
TestFilter
getName
in class TestFilter
public java.lang.String getDescription()
TestFilter
TestFilter.getName()
. This string should
be localized.getDescription
in class TestFilter
public java.lang.String getReason()
TestFilter
getReason
in class TestFilter
public boolean accepts(TestDescription td) throws TestFilter.Fault
TestFilter
accepts
in class TestFilter
td
- the TestDescription to checkTestFilter.Fault
- if an error occurs while trying to determine if this test
should be accepted or not.public boolean accepts(TestDescription td, TestFilter.Observer o) throws TestFilter.Fault
TestFilter
accepts
in class TestFilter
td
- The TestDescription to check.o
- An observer, which will be notified if the test is
rejected by this filter.TestFilter.Fault
- if an error occurs while trying to determine if this test
should be accepted or not.public boolean equals(java.lang.Object tf)
equals
in class java.lang.Object
tf
- The object to be checked for equality with this oneObject.equals(Object)
public int hashCode()
hashCode
in class java.lang.Object
public TestFilter[] getFilters()
public static boolean equals(TestFilter[] array1, TestFilter[] array2)
array1
- First set of filters; may not be null.array2
- Second set of filters; may not be null.Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.