|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase frysk.junit.TestCase frysk.sys.TestFileDescriptor
public class TestFileDescriptor
Minimal testing for the FileDescriptor.
Nested Class Summary | |
---|---|
private static class |
TestFileDescriptor.IO
|
Field Summary | |
---|---|
private FileDescriptor |
file
|
private String |
hello
|
private Pipe |
pipe
|
private String |
xxxhelloyyy
|
Constructor Summary | |
---|---|
TestFileDescriptor()
|
Method Summary | |
---|---|
private void |
assertArrayIndexOutOfBounds(String what,
TestFileDescriptor.IO io,
byte[] buf,
int start,
int length)
Check that an IO operation throws an exception. |
private void |
assertBecomesReady(FileDescriptor fd)
|
void |
setUp()
Sets up the fixture, for example, open a network connection. |
void |
tearDown()
Tears down the fixture, for example, close a network connection. |
void |
testArrayEOF()
Test closing a pipe. |
void |
testArrayIO()
Test passing arrays of bytes through a pipe. |
void |
testArraySubBufferRead()
Test a sub-buffer read. |
void |
testArraySubBufferWrite()
Test a sub-buffer write. |
void |
testByteEOF()
Test closing a pipe. |
void |
testByteIO()
Test passing individual bytes through a pipe. |
void |
testCreate()
Try creating a temporary file. |
void |
testDupPipeOutToIn()
Try duping the output of a Pipe back to its input. |
void |
testInputOutputStreams()
Test input and output streams. |
void |
testNegativeFileDescriptor()
See what happens if FileDescriptor is -ve. |
void |
testOpenEtcPasswd()
Try opening a random file and reading it. |
void |
testReadOutOfBounds()
Try performing IO outside of an array's bounds. |
void |
testReady()
Test the ready method, a pipe is only ready if something was written to it. |
void |
testSeek()
Try wondering round the file using seeks. |
void |
testTwiceClosed()
Try closing things twice; second call should do nothing (i.e., no exception). |
void |
testWriteOutOfBounds()
|
private void |
verifyOutOfBounds(TestFileDescriptor.IO io)
Try performing OP with various out-of-bounds array parameters. |
Methods inherited from class frysk.junit.TestCase |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, getTimeoutMilliseconds, getTimeoutSeconds, missing32or64, unresolved, unresolvedOffUtrace, unresolvedOn32On64, unresolvedOnIA32, unresolvedOnPPC, unresolvedOnUtrace, unresolvedOnx8664, unsupported |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private Pipe pipe
private FileDescriptor file
private final String hello
private final String xxxhelloyyy
Constructor Detail |
---|
public TestFileDescriptor()
Method Detail |
---|
public void setUp()
TestCase
setUp
in class TestCase
public void tearDown()
TestCase
tearDown
in class TestCase
private void assertBecomesReady(FileDescriptor fd)
public void testReady()
public void testByteIO()
public void testArrayIO()
public void testArraySubBufferWrite()
public void testArraySubBufferRead()
public void testByteEOF()
public void testArrayEOF()
public void testInputOutputStreams() throws IOException
IOException
public void testDupPipeOutToIn() throws IOException
IOException
public void testOpenEtcPasswd()
private void assertArrayIndexOutOfBounds(String what, TestFileDescriptor.IO io, byte[] buf, int start, int length)
private void verifyOutOfBounds(TestFileDescriptor.IO io)
public void testReadOutOfBounds()
public void testWriteOutOfBounds()
public void testSeek()
public void testNegativeFileDescriptor()
public void testTwiceClosed()
public void testCreate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |