public class SocketConnectionTest extends Object
SocketConnection
class.Modifier and Type | Class and Description |
---|---|
static class |
SocketConnectionTest.AFUNIXSocketException
AFUNIXSocketException provides a test instance of the Unix domain socket
exception.
|
class |
SocketConnectionTest.SocketFactoryWithConnectionListener
SocketFactoryWithConnectionListener provides a test socket factory that
also implements SocketConnectionListener.
|
Constructor and Description |
---|
SocketConnectionTest() |
public static void setUpBeforeClass() throws IOException
IOException
- On a failure to start the Mock MongoDB server.public static void tearDownAfterClass() throws IOException
IOException
- On a failure to stop the Mock MongoDB server.public void setUp()
Server
.public void tearDown() throws IOException
IOException
- On a failure to shutdown the test connection.public void testAutoClose() throws IOException, InterruptedException, ExecutionException, TimeoutException
SocketConnection
.IOException
- On a failure connecting to the Mock MongoDB server.ExecutionException
- On a failure waiting for a reply.InterruptedException
- On a failure waiting for a reply.TimeoutException
- On a failure waiting for a reply.public void testClose() throws IOException
SocketConnection.close()
.IOException
- On a failure connecting to the Mock MongoDB server.public void testCommandToNew() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testConnectionLost() throws IOException, InterruptedException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.InterruptedException
- On a failure to sleep.public void testGetLastError() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testGetLastErrorWithFsync() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testGetLastErrorWithJ() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testGetLastErrorWithW() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testGetMore() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testInsertMulti() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testInsertSingle() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testInsertToLarge() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testKillCursor() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testMultiDelete() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testQuery() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testQueryAwaitData() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testQueryExhaust() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testQueryNoCursorTimeout() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testQueryPartial() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testQuerySecondaryPreference() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testQueryTailable() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testQueryWithFields() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testRaiseError() throws IOException, InterruptedException
AbstractSocketConnection.raiseErrors(MongoDbException)
.IOException
- On a failure connecting to the Mock MongoDB server.InterruptedException
- On a failure to sleep.public void testRead() throws IOException, InterruptedException, ExecutionException, TimeoutException
SocketConnection
.IOException
- On a failure connecting to the Mock MongoDB server.ExecutionException
- On a failure waiting for a reply.InterruptedException
- On a failure waiting for a reply.TimeoutException
- On a failure waiting for a reply.public void testRead2() throws IOException, InterruptedException, ExecutionException, TimeoutException
SocketConnection
.IOException
- On a failure connecting to the Mock MongoDB server.TimeoutException
- On a failure waiting for a reply.InterruptedException
- On a failure waiting for a reply.ExecutionException
- On a failure waiting for a reply.TimeoutException
- On a failure waiting for a reply.public void testReadDelete() throws IOException, InterruptedException, TimeoutException
SocketConnection
.IOException
- On a failure connecting to the Mock MongoDB server.TimeoutException
- On a failure waiting for a reply.InterruptedException
- On a failure waiting for a reply.public void testReadGarbage() throws IOException, InterruptedException, TimeoutException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.InterruptedException
- On a failure to sleep.TimeoutException
- On a failure to sleep.public void testReadGetMore() throws IOException, InterruptedException, TimeoutException
SocketConnection
.IOException
- On a failure connecting to the Mock MongoDB server.InterruptedException
- On a failure waiting for a reply.TimeoutException
- On a failure waiting for a reply.public void testReadInsert() throws IOException, InterruptedException, TimeoutException
SocketConnection
.IOException
- On a failure connecting to the Mock MongoDB server.TimeoutException
- On a failure waiting for a reply.InterruptedException
- On a failure waiting for a reply.public void testReadKillCursors() throws IOException, InterruptedException, TimeoutException
SocketConnection
.IOException
- On a failure connecting to the Mock MongoDB server.TimeoutException
- On a failure waiting for a reply.InterruptedException
- On a failure waiting for a reply.public void testReadQuery() throws IOException, InterruptedException, TimeoutException, ExecutionException
SocketConnection
.IOException
- On a failure connecting to the Mock MongoDB server.TimeoutException
- On a failure waiting for a reply.InterruptedException
- On a failure waiting for a reply.ExecutionException
- On a failure waiting for a reply.public void testReadStuff() throws IOException, InterruptedException, ExecutionException, TimeoutException
SocketConnection
.IOException
- On a failure connecting to the Mock MongoDB server.TimeoutException
- On a failure waiting for a reply.ExecutionException
- On a failure waiting for a reply.InterruptedException
- On a failure waiting for a reply.public void testReadTimeout() throws IOException, InterruptedException, TimeoutException
SocketConnection
.IOException
- On a failure connecting to the Mock MongoDB server.TimeoutException
- On a failure waiting for a reply.InterruptedException
- On a failure waiting for a reply.public void testReadUpdate() throws IOException, InterruptedException, TimeoutException
SocketConnection
.IOException
- On a failure connecting to the Mock MongoDB server.TimeoutException
- On a failure waiting for a reply.InterruptedException
- On a failure waiting for a reply.public void testReadWhenPendingQueueIsCorrupt() throws IOException, InterruptedException, ExecutionException, TimeoutException
SocketConnection
.IOException
- On a failure connecting to the Mock MongoDB server.ExecutionException
- On a failure waiting for a reply.InterruptedException
- On a failure waiting for a reply.TimeoutException
- On a failure waiting for a reply.public void testReplyWithLatency() throws IOException, InterruptedException, TimeoutException
SocketConnection
.IOException
- On a failure connecting to the Mock MongoDB server.TimeoutException
- On a failure waiting for a reply.InterruptedException
- On a failure waiting for a reply.public void testReplyWithoutLatency() throws IOException, InterruptedException, TimeoutException
SocketConnection
.IOException
- On a failure connecting to the Mock MongoDB server.TimeoutException
- On a failure waiting for a reply.InterruptedException
- On a failure waiting for a reply.public void testSecondMessageToLarge() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testSendError() throws IOException, InterruptedException
SocketConnection.close()
.IOException
- On a failure connecting to the Mock MongoDB server.InterruptedException
- On a failure waiting for the threads to close.public void testSendFailureClose() throws IOException, InterruptedException
SocketConnection.close()
.IOException
- On a failure connecting to the Mock MongoDB server.InterruptedException
- On a failure waiting for the threads to close.public void testSendRuntimeException() throws IOException, InterruptedException
SocketConnection.close()
.IOException
- On a failure connecting to the Mock MongoDB server.InterruptedException
- On a failure waiting for the threads to close.public void testServerClose() throws IOException, InterruptedException
SocketConnection.close()
.IOException
- On a failure connecting to the Mock MongoDB server.InterruptedException
- On a failure waiting for the threads to close.public void testShutdown() throws IOException, InterruptedException
AbstractSocketConnection.shutdown(boolean)
.IOException
- On a failure connecting to the Mock MongoDB server.InterruptedException
- On a failure to sleep.public void testShutdownWhenClosed() throws IOException, InterruptedException
AbstractSocketConnection.shutdown(boolean)
.IOException
- On a failure connecting to the Mock MongoDB server.InterruptedException
- On a failure to sleep.public void testSingleDelete() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testSocketConnectFailure() throws IOException
SocketConnection.SocketConnection(Server, MongoClientConfiguration)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testSocketConnection() throws IOException
SocketConnection.SocketConnection(Server, MongoClientConfiguration)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testSocketConnectionFailure() throws IOException
SocketConnection.SocketConnection(Server, MongoClientConfiguration)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testSocketConnectNotifiesFactoryOfConnect() throws IOException
SocketConnection.SocketConnection(Server, MongoClientConfiguration)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testSocketConnectNotifiesFactoryOfConnectWhichThrows() throws IOException
SocketConnection.SocketConnection(Server, MongoClientConfiguration)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testSocketFactoryFailure() throws IOException
SocketConnection.SocketConnection(Server, MongoClientConfiguration)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testSocketOptionsFailure() throws IOException
SocketConnection.SocketConnection(Server, MongoClientConfiguration)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testSocketOptionsFailureFromUnixDomainSockets() throws IOException
SocketConnection.SocketConnection(Server, MongoClientConfiguration)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testStop() throws IOException, InterruptedException
AbstractSocketConnection.stop()
.IOException
- On a failure connecting to the Mock MongoDB server.InterruptedException
- On a failure to sleep.public void testUpdate() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testUpdateMulti() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testUpdateUpsert() throws IOException
SocketConnection.send(com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.Message, com.allanbank.mongodb.client.callback.ReplyCallback)
.IOException
- On a failure connecting to the Mock MongoDB server.public void testWaitForClosedWhenInterrupted() throws IOException, InterruptedException
AbstractSocketConnection.shutdown(boolean)
.IOException
- On a failure connecting to the Mock MongoDB server.InterruptedException
- On a failure to sleep.Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.