Package com.sun.javatest
Class ExcludeList
java.lang.Object
com.sun.javatest.ExcludeList
A set of tests to be excluded from a test run.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
An entry in the exclude list.static class
This exception is used to report problems manipulating an exclude list. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The standard extension for exclude-list files. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new exclude list.ExcludeList
(File f) Create an ExcludeList from the data contained in a file.ExcludeList
(File... files) Create an ExcludeList from the data contained in a series of files.ExcludeList
(File[] files, boolean strict) Create an ExcludeList from the data contained in a series of files.ExcludeList
(File f, boolean strict) Create an ExcludeList from the data contained in a file. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an entry to the table.boolean
boolean
Test if a specific test is completely excluded according to the table.boolean
excludesAllOf
(String url) Test if a specific test is completely excluded according to the table.boolean
Test if a specific test is partially or completely excluded according to the table.boolean
excludesAnyOf
(String url) Test if a specific test is partially or completely excluded according to the table.Locate an entry for a test.Locate an entry for a test.Iterator
<?> getIterator
(boolean group) Iterate over the contents of the table.String[]
Get the test cases to be excluded for a test.getTitle()
Get the title for this exclude list.int
hashCode()
boolean
isEmpty()
Check whether an exclude list has any entries or not.static boolean
Test if a file appears to be for an exclude list, by checking the extension.boolean
Check whether strict mode is enabled or not.void
merge
(ExcludeList other) Merge the contents of another exclude list into this one.void
Remove an entry from the table.void
setStrictModeEnabled
(boolean on) Specify whether strict mode is on or not.void
Set the title for this exclude list.int
size()
Get the number of entries in the table.void
Write the table out to a file.
-
Field Details
-
EXCLUDEFILE_EXTN
The standard extension for exclude-list files. (".jtx")- See Also:
-
-
Constructor Details
-
ExcludeList
public ExcludeList()Create a new exclude list. -
ExcludeList
Create an ExcludeList from the data contained in a file.- Parameters:
f
- The file to be read.- Throws:
FileNotFoundException
- if the file cannot be foundIOException
- if any problems occur while reading the fileExcludeList.Fault
- if the data in the file is ionconsistent- See Also:
-
ExcludeList
public ExcludeList(File f, boolean strict) throws FileNotFoundException, IOException, ExcludeList.Fault Create an ExcludeList from the data contained in a file.- Parameters:
f
- The file to be read.strict
- Indicate if strict data checking rules should be used.- Throws:
FileNotFoundException
- if the file cannot be foundIOException
- if any problems occur while reading the fileExcludeList.Fault
- if the data in the file is inconsistent- See Also:
-
ExcludeList
Create an ExcludeList from the data contained in a series of files.- Parameters:
files
- The file to be read.- Throws:
FileNotFoundException
- if any of the files cannot be foundIOException
- if any problems occur while reading the files.ExcludeList.Fault
- if the data in the files is inconsistent- See Also:
-
ExcludeList
public ExcludeList(File[] files, boolean strict) throws FileNotFoundException, IOException, ExcludeList.Fault Create an ExcludeList from the data contained in a series of files.- Parameters:
files
- The file to be read.strict
- Indicate if strict data checking rules should be used.- Throws:
FileNotFoundException
- if any of the files cannot be foundIOException
- if any problems occur while reading the files.ExcludeList.Fault
- if the data in the files is inconsistent- See Also:
-
-
Method Details
-
isExcludeFile
Test if a file appears to be for an exclude list, by checking the extension.- Parameters:
f
- The file to be tested.- Returns:
true
if the file appears to be an exclude list.
-
isStrictModeEnabled
public boolean isStrictModeEnabled()Check whether strict mode is enabled or not. In strict mode, calls to addEntry may generate an exception in the case of conflicts, such as adding an entry to exclude a specific test case when the entire test is already excluded.- Returns:
- true if strict mode is enabled, and false otherwise
- See Also:
-
setStrictModeEnabled
public void setStrictModeEnabled(boolean on) Specify whether strict mode is on or not. In strict mode, calls to addEntry may generate an exception in the case of conflicts, such as adding an entry to exclude a specific test case when the entire test is already excluded.- Parameters:
on
- true if strict mode should be enabled, and false otherwise- See Also:
-
excludesAllOf
Test if a specific test is completely excluded according to the table. It is completely excluded if there is an entry, and the test case field is null.- Parameters:
td
- A test description for the test being checked.- Returns:
true
if the table contains an entry for this test.
-
excludesAllOf
Test if a specific test is completely excluded according to the table. It is completely excluded if there is an entry, and the test case field is null.- Parameters:
url
- The test-suite root-relative URL for the test.- Returns:
true
if the table contains an entry for this test.
-
excludesAnyOf
Test if a specific test is partially or completely excluded according to the table. It is so excluded if there is any entry in the table for the test.- Parameters:
td
- A test description for the test being checked.- Returns:
true
if the table contains an entry for this test.
-
excludesAnyOf
Test if a specific test is partially or completely excluded according to the table. It is so excluded if there is any entry in the table for the test.- Parameters:
url
- The test-suite root-relative URL for the test.- Returns:
true
if the table contains an entry for this test.
-
getTestCases
Get the test cases to be excluded for a test.- Parameters:
td
- A test description for the test being checked.- Returns:
- an array of test case names if any test cases are to be excluded. The result is null if the test is not found or is completely excluded without specifying test cases. This may be a mix of single TC strings or a comma separated list of them.
-
addEntry
Add an entry to the table.- Parameters:
e
- The entry to be added; if an entry already exists for this test description, it will be replaced.- Throws:
ExcludeList.Fault
- if the entry is for the entire test and there is already an entry for a test case for this test, or vice versa.
-
getEntry
Locate an entry for a test.- Parameters:
url
- The root relative URL for the test; the URL may include a test case if necessary included in square brackets after the URL proper.- Returns:
- The entry for the test, or null if there is none.
-
getEntry
Locate an entry for a test.- Parameters:
url
- The root relative URL for the test.testCase
- An optional test case to be taken into account. This cannot be a comma separated list. A value of null will match any entry with the given url.- Returns:
- The entry for the test, or null if the URL cannot be found.
-
merge
Merge the contents of another exclude list into this one. The individual entries are merged; The title of the exclude list being merged is ignored.- Parameters:
other
- the exclude list to be merged with this one.
-
removeEntry
Remove an entry from the table.- Parameters:
e
- the entry to be removed
-
isEmpty
public boolean isEmpty()Check whether an exclude list has any entries or not.- Returns:
- true if this exclude list has no entries
- See Also:
-
size
public int size()Get the number of entries in the table.- Returns:
- the number of entries in the table
- See Also:
-
getIterator
Iterate over the contents of the table.- Parameters:
group
- iftrue
, entries for the same relative URL are grouped together, and if more than one, returned in an array; iffalse
, the iterator always returns separate entries.- Returns:
- an iterator for the table: the entries are either
single instances of @link(Entry) or a mixture of @link(Entry)
and @link(Entry)[], depending on the
group
parameter. - See Also:
-
getTitle
Get the title for this exclude list.- Returns:
- the title for this exclude list
- See Also:
-
setTitle
Set the title for this exclude list.- Parameters:
title
- the title for this exclude list- See Also:
-
write
Write the table out to a file.- Parameters:
f
- The file to which the table should be written.- Throws:
IOException
- is thrown if any problems occur while the file is being written.
-
equals
-
hashCode
public int hashCode()
-