public class ListingTest extends NamingTest
list
and isDirectory
methods.
Items checked are:
list
and isDirectory
reject null
pointer arguments.list
and isDirectory
reject non-existent
objects as arguments.list
rejects files as arguments.isDirectory
returns
the correct results for files and directories.Modifier and Type | Field and Description |
---|---|
private Path |
file1 |
private Path |
file2 |
private Path |
file3 |
static java.lang.String |
notice
Test notice.
|
static java.lang.Class[] |
prerequisites
Prerequisites.
|
private TestStorageServer |
storage_server
Storage server providing the files used in the test.
|
registration_stub, service_stub
Constructor and Description |
---|
ListingTest()
Creates the
ListTest object and sets the notice. |
Modifier and Type | Method and Description |
---|---|
private void |
checkArguments()
Checks that bad arguments are rejected, and checks that the root
directory is identified as a directory.
|
private void |
checkDirectoryListing(Path path,
java.lang.String[] expected_children,
boolean[] expected_kinds)
Checks that directories are listed correctly, and checks that files and
directories are distinguished correctly by
isDirectory . |
protected void |
clean()
Stops test servers upon completion of the test.
|
protected void |
initialize()
Starts the test servers.
|
protected void |
perform()
Performs the tests.
|
cleanupFailure, cleanupSuccess, failure, success, task, task
public static final java.lang.String notice
public static final java.lang.Class[] prerequisites
private TestStorageServer storage_server
private final Path file1
private final Path file2
private final Path file3
public ListingTest()
ListTest
object and sets the notice.protected void perform() throws TestFailed
perform
in class Test
TestFailed
- If any of the tests fail.private void checkDirectoryListing(Path path, java.lang.String[] expected_children, boolean[] expected_kinds) throws TestFailed
isDirectory
.path
- The directory to be listed.expected_children
- The expected children of the directory.expected_kinds
- An array of expected results of
isDirectory
calls. The calls will be
made for each child of the directory, in the order
they are given in expected_children
.TestFailed
- If the directory is not listed correctly, or if
isDirectory
misidentifies a directory or
a file.private void checkArguments() throws TestFailed
TestFailed
- If any of the methods accept a bad argument, or if
the root directory is reported to be a file.protected void initialize() throws TestFailed
initialize
in class NamingTest
TestFailed
- If any of the servers cannot be started.protected void clean()
clean
in class NamingTest