| java.lang.Object com.sun.midp.i3test.TestCase com.sun.midp.io.j2me.socket.TestInterruptedIO
TestInterruptedIO | public class TestInterruptedIO extends TestCase implements Runnable(Code) | | Test of SocketConnection function that unblocks a pending read
when the connection is closed.
|
Method Summary | |
void | closeConnection() Close the open connection. | public void | run() Run method to open the InputStream and block on a read. | public void | runTests() Run the test by setting up the connection, and starting
a thread to block on a read then forcing the
connection to be closed and checking that exception occurred. | boolean | setUp() Open the connection and start the thread to call the run
method. | void | tearDown() Clean up after the test. | void | testForException() This test creates another thread that tries to close a socket
connection that is in use by first thread. |
done | boolean done(Code) | | Records if the thread exited.
|
exceptionThrown | boolean exceptionThrown(Code) | | Records if the expected InterruptedIOException is thrown.
|
closeConnection | void closeConnection()(Code) | | Close the open connection.
|
run | public void run()(Code) | | Run method to open the InputStream and block on a read.
When the stream/connection is closed the read should
unblock with an InterruptedIOException.
|
runTests | public void runTests()(Code) | | Run the test by setting up the connection, and starting
a thread to block on a read then forcing the
connection to be closed and checking that exception occurred.
|
setUp | boolean setUp()(Code) | | Open the connection and start the thread to call the run
method. It waits until the InputStream is open before returning.
false if testing cannot be continued |
tearDown | void tearDown()(Code) | | Clean up after the test.
|
testForException | void testForException()(Code) | | This test creates another thread that tries to close a socket
connection that is in use by first thread. It is supposed to throw
InterruptedIOException in this case.
|
Methods inherited from com.sun.midp.i3test.TestCase | public void assertEquals(Object expected, Object actual)(Code)(Java Doc) public void assertEquals(String message, Object expected, Object actual)(Code)(Java Doc) public void assertEquals(int expected, int actual)(Code)(Java Doc) public void assertEquals(String message, int expected, int actual)(Code)(Java Doc) public void assertFalse(boolean condition)(Code)(Java Doc) public void assertFalse(String message, boolean condition)(Code)(Java Doc) public void assertNotNull(Object object)(Code)(Java Doc) public void assertNotNull(String message, Object object)(Code)(Java Doc) public void assertNotSame(Object expected, Object actual)(Code)(Java Doc) public void assertNotSame(String message, Object expected, Object actual)(Code)(Java Doc) public void assertNull(Object object)(Code)(Java Doc) public void assertNull(String message, Object object)(Code)(Java Doc) public void assertSame(Object expected, Object actual)(Code)(Java Doc) public void assertSame(String message, Object expected, Object actual)(Code)(Java Doc) public void assertTrue(String message, boolean condition)(Code)(Java Doc) public void assertTrue(boolean condition)(Code)(Java Doc) public void declare(String testName)(Code)(Java Doc) public void fail()(Code)(Java Doc) public void fail(String message)(Code)(Java Doc) protected SecurityToken getSecurityToken()(Code)(Java Doc) protected boolean getVerbose()(Code)(Java Doc) public void info(String s)(Code)(Java Doc) abstract public void runTests() throws Throwable(Code)(Java Doc)
|
|
|