Port server to new interface testsPage edited by Aidan Skinner
Test ObjectivesThis initial phase of work involves minimal changes to existing classes and behaviour. There should be no impact on performance and existing functionality should remain unchanged. The only significant change is the stage at which the byte stream is encoded and decoded. Testing needs to verify that there has not been a negative affect on the fundamental parts of connection processing: connection establishment, encoding, decoding, frame handling, virtualhost selection failure, authentication failure, authorization failure and handling multiple connections at the same time. Performance Test PlanThere should be no impact on performance since the underlying implementation and threading model remains the same. The performance test suite will be used to validate that there has not been a negative impact on performance. Existing System TestsThere should be no change in functionality, the existing system tests should continue to function as is. System tests will present the main validation that this work has not had any negative impact. All system tests which create a connection to a broker will exercise the changed code. In particular the following test cases contain tests which fully exercise the changed code paths in the broker ConnectionTestThis TestCase contains:
AcknowledgeTestThis TestCase contains:
MultipleConnectionTestThis TestCase contains:
SimpleACLTestThis TestCase contains multiple tests which will verify that connection attempts where authorization fails continue to throw the correct exception. New system tests requiredNo system tests exist which test the AMQP heartbeating functionality. ServerHeartbeatTesttestClientWriteIdleTestThis test will open a client connection and let it idle for longer than the timeout period. It will verify that the connection remains usable after this idle period. Existing Unit TestsExisting unit test coverage of the classes involved is minimal to non-existent. I will add tests for the changed functionality, but not for the existing functionality which has not been modified. New unit tests requiredUnit tests will need to be written for MINANetworkDriver, AMQProtocolEngine and AMQDecoder MINANetworkDriver testsThe unit test will create a ProtocolEngine to implement a simple echo server which will send back any recieved data. testBindOpenThis test will create two NetworkDrivers, one of which binds to a socket and one of which opens a socket. This test will assert that the open fails before the bind and that open succeeds after the bind. testBindSocketInUseThis test will create testSendThis test will create one NetworkDriver and call it's send method and verify that the data is passed to the ProcotolEngines receive() method testSetReadIdleThis test will create one NetworkDriver and set it's read idle timeout. It will verify that the ProtocolEngines readIdle method is called after the appropriate time testSetWriteIdleThis test will create one NetworkDriver and set it's write idle timeout. It will verify that the ProtocolEngines writeIdle method is called after the appropriate time testClosedThis test will create one NetworkDriver and close it. It will verify that the ProtocolEngines closed method is called. testExceptionCaughtThis test will create one NetworkDriver bind it and open a socket. It will forcibly close the socket to generate an exception. It will verify that the ProtocolEngines exception method is called. testGetRemoteAddressThis getRemoteAddress method and returns a SocketAddress that corresponds to localhost. AMQDecoder teststestDecodePI09This test will create a byte buffer containing an AMQP 0-9 protocol header and check that testDecode returns a ProtocolInitiation with the protocolMajor set to 0 and protocolMinor set to 9. testDecodePI08This test will create a byte buffer containing an AMQP 0-9 protocol header and check that testDecode returns a ProtocolInitiation with the protocolMajor set to 0 and protocolMinor set to 8. testDecodePartialDataBlockThis test will create a byte buffer containing a partial data block and verify that doDecode returns null to indicate that the data should be held until more arrives. testDecodeCompleteDataBlockThis test will create a byte buffer containing a complete AMQP data block and verify that doDecode returns an AMQFrame of the apppropriate type. testEncodeFrameThis test will create an AMQP frame and verify that encodeFrame returns a byte array with the appropriate contents. AMQProtocolEngine testsThese tests will use a MockNetworkDriver to test the functionality of the ProtocolEngine parts of AMQProtocolEngine testPartialReceivedThis test will pass in a ByteBuffer containing a partial AMQP frame and check that the frame handler is not called. It will then pass in a second ByteBuffer containing the rest of the AMQ frame and check that the frame handler is called. testCompleteReceivedThis test will pass in a ByteBuffer containing a complete AMQP frame and check that the frame handler is called. testReaderIdleThis test will call the ProtocolEngines readerIdle method and check that the ProtocolEngine closes itself testWriterIdleThis test will call the ProtocolEngines writerIdle method and check that the ProtocolEngine calls the NetworkDriver.send() method with an encoded HeartBeatBody frame testGetRemoteAddressThis test will verify that the ProtocolEngine.getRemoteAddress method calls the NetworkDriver.getRemoteAddress method and returns the same data. AMQProtocolEngineMbean teststestGetRemoteAddressThis test will verify that the ProtocolEngineMbean.getRemoteAddress method calls the ProtocolEngine.getRemoteAddress method and returns the same data. NetworkDriverConfiguration testsThis test case will construct a ServerConfiguration with known values h7. testGetKeepAlive This test will verify that the method returns the expected value h7. testGetOOBInline This test will verify that the method returns the expected value h7. testGetReuseAddress This test will verify that the method returns the expected value h7. testGetSoLinger This test will verify that the method returns the expected value h7. testGetSoTimeout This test will verify that the method returns the expected value h7. testGetTcpNoDelay This test will verify that the method returns the expected value h7. testGetTrafficClass This test will verify that the method returns the expected value h7. testGetReceiveBufferSize This test will verify that the method returns the expected value h7. testGetSendBufferSize This test will verify that the method returns the expected value
Change Notification Preferences
View Online
|
View Change
|
Add Comment
|
- [CONF] Apache Qpid > Port server to new interface tests confluence
- [CONF] Apache Qpid > Port server to new interface tests confluence
- [CONF] Apache Qpid > Port server to new interface tests confluence
- [CONF] Apache Qpid > Port server to new interface tests confluence
- [CONF] Apache Qpid > Port server to new interface tests confluence
- [CONF] Apache Qpid > Port server to new interface tests confluence
- [CONF] Apache Qpid > Port server to new interface tests confluence
- [CONF] Apache Qpid > Port server to new interface tests confluence
- [CONF] Apache Qpid > Port server to new interface tests confluence
- [CONF] Apache Qpid > Port server to new interface tests confluence
- [CONF] Apache Qpid > Port server to new interface tests confluence