Port server to new interface testsPage edited by Aidan SkinnerExisting unit test coverageExisting 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 teststestGetRemoteAddresstestGetRemoteAddressThis test will verify that the ProtocolEngineMbean.getRemoteAddress method calls the ProtocolEngine.getRemoteAddress method and returns the same data.
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
- [CONF] Apache Qpid > Port server to new interface tests confluence