public class TestSocketsDirect extends TestCase3
Note: Tests in this suite should use direct byte buffers (non-heap NIO) buffers in order accurately model the conditions that bigdata uses for write replication. If you use heap byte[]s, then they are copied into an NIO direct buffer before they are transmitted over a socket. By using NIO direct buffers, we stay within the zero-copy pattern for sockets.
Note: Tests in this suite need to use ServerSocketChannel.open()
to
get access to the stream oriented listening interface for the server side of
the socket. This is what is used by the HAReceiveService
. It also
sets up the ServerSocketChannel
in a non-blocking mode and then uses
the selectors to listen for available data. See HAReceiveService
.
TestCase2.MyProperties, TestCase2.RandomType
_randomType, log
Constructor and Description |
---|
TestSocketsDirect() |
TestSocketsDirect(String name) |
Modifier and Type | Method and Description |
---|---|
void |
testDirectSockets_exceptionIfPortNotOpen()
Simple test of connecting to a server socket and the failure to connect
to a port not associated with a server socket.
|
void |
testDirectSockets_largeWrite_NotAccepted()
Test of a large write on a socket to understand what happens when the
write is greater than the combined size of the client send buffer and the
server receive buffer and the server side of the socket is either not
accepted or already shutdown.
|
void |
testDirectSockets()
The use of threaded tasks in the send/receive service makes it difficult to
observer the socket state changes.
|
void |
testMultipleClients()
Confirms that multiple clients can communicate with same Server
|
assertCondition, assertCondition, assertEquals, assertEquals, getBytes, getPort, getRandomData, getRandomData, setUp, tearDown
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsWithinUlps, assertSameArray, assertSameArray, assertSameBigDecimal, assertSameBigDecimal, assertSameBigInteger, assertSameBigInteger, assertSameIterator, assertSameIterator, assertSameIteratorAnyOrder, assertSameIteratorAnyOrder, assertSameValue, assertSameValue, assertZeroUlps, assertZeroUlps, fail, getInnerCause, getNormalInt, getProjectBuildPath, getProperties, getRandomObject, getRandomObject, getRandomOrder, getRandomString, getTestInputStream, getTestResource, getTestResource, getUlps, getUlps, isDEBUG, isDEBUG, isINFO, isINFO, isInnerCause, logProperties
assertEquals, 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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString
public TestSocketsDirect()
public TestSocketsDirect(String name)
public void testDirectSockets_exceptionIfPortNotOpen() throws IOException
IOException
public void testDirectSockets_largeWrite_NotAccepted() throws IOException, InterruptedException
IOException
InterruptedException
public void testDirectSockets() throws IOException, InterruptedException
IOException
InterruptedException
public void testMultipleClients() throws IOException
IOException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.