qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Qpid > Port server to new interface tests
Date Thu, 30 Jul 2009 15:12:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=qpid&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/qpid/Port+server+to+new+interface+tests">Port
server to new interface tests</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~aidan">Aidan
Skinner</a>
    </h4>
     
          <br/>
     <div class="notificationGreySide">
         <div>
<ul>
    <li><a href='#Portservertonewinterfacetests-TestObjectives'>Test Objectives</a></li>
    <li><a href='#Portservertonewinterfacetests-PerformanceTestPlan'>Performance
Test Plan</a></li>
    <li><a href='#Portservertonewinterfacetests-ExistingSystemTests'>Existing
System Tests</a></li>
<ul>
    <li><a href='#Portservertonewinterfacetests-ConnectionTest'>ConnectionTest</a></li>
    <li><a href='#Portservertonewinterfacetests-AcknowledgeTest'>AcknowledgeTest</a></li>
    <li><a href='#Portservertonewinterfacetests-MultipleConnectionTest'>MultipleConnectionTest</a></li>
    <li><a href='#Portservertonewinterfacetests-SimpleACLTest'>SimpleACLTest</a></li>
</ul>
    <li><a href='#Portservertonewinterfacetests-Newsystemtestsrequired'>New system
tests required</a></li>
<ul>
    <li><a href='#Portservertonewinterfacetests-ServerHeartbeatTest'>ServerHeartbeatTest</a></li>
<ul>
    <li><a href='#Portservertonewinterfacetests-testClientWriteIdleTest'>testClientWriteIdleTest</a></li>
</ul>
</ul>
    <li><a href='#Portservertonewinterfacetests-ExistingUnitTests'>Existing Unit
Tests</a></li>
    <li><a href='#Portservertonewinterfacetests-Newunittestsrequired'>New unit
tests required</a></li>
<ul>
    <li><a href='#Portservertonewinterfacetests-MINANetworkDrivertests'>MINANetworkDriver
tests</a></li>
<ul>
    <li><a href='#Portservertonewinterfacetests-testBindOpen'>testBindOpen</a></li>
    <li><a href='#Portservertonewinterfacetests-testBindSocketInUse'>testBindSocketInUse</a></li>
    <li><a href='#Portservertonewinterfacetests-testSend'>testSend</a></li>
    <li><a href='#Portservertonewinterfacetests-testSetReadIdle'>testSetReadIdle</a></li>
    <li><a href='#Portservertonewinterfacetests-testSetWriteIdle'>testSetWriteIdle</a></li>
    <li><a href='#Portservertonewinterfacetests-testClosed'>testClosed</a></li>
    <li><a href='#Portservertonewinterfacetests-testExceptionCaught'>testExceptionCaught</a></li>
    <li><a href='#Portservertonewinterfacetests-testGetRemoteAddress'>testGetRemoteAddress</a></li>
</ul>
    <li><a href='#Portservertonewinterfacetests-AMQDecodertests'>AMQDecoder tests</a></li>
<ul>
<ul>
    <li><a href='#Portservertonewinterfacetests-testDecodePI09'>testDecodePI09</a></li>
    <li><a href='#Portservertonewinterfacetests-testDecodePI08'>testDecodePI08</a></li>
    <li><a href='#Portservertonewinterfacetests-testDecodePartialDataBlock'>testDecodePartialDataBlock</a></li>
    <li><a href='#Portservertonewinterfacetests-testDecodeCompleteDataBlock'>testDecodeCompleteDataBlock</a></li>
    <li><a href='#Portservertonewinterfacetests-testEncodeFrame'>testEncodeFrame</a></li>
</ul>
</ul>
    <li><a href='#Portservertonewinterfacetests-AMQProtocolEnginetests'>AMQProtocolEngine
tests</a></li>
<ul>
<ul>
<ul>
    <li><a href='#Portservertonewinterfacetests-testPartialReceived'>testPartialReceived</a></li>
    <li><a href='#Portservertonewinterfacetests-testCompleteReceived'>testCompleteReceived</a></li>
    <li><a href='#Portservertonewinterfacetests-testReaderIdle'>testReaderIdle</a></li>
    <li><a href='#Portservertonewinterfacetests-testWriterIdle'>testWriterIdle</a></li>
    <li><a href='#Portservertonewinterfacetests-testGetRemoteAddress'>testGetRemoteAddress</a></li>
</ul>
</ul>
</ul>
    <li><a href='#Portservertonewinterfacetests-AMQProtocolEngineMbeantests'>AMQProtocolEngineMbean
tests</a></li>
<ul>
<ul>
<ul>
<ul>
    <li><a href='#Portservertonewinterfacetests-testGetRemoteAddress'>testGetRemoteAddress</a></li>
</ul>
</ul>
</ul>
</ul>
    <li><a href='#Portservertonewinterfacetests-NetworkDriverConfigurationtests'>NetworkDriverConfiguration
tests</a></li>
</ul>
</ul></div>

<h1><a name="Portservertonewinterfacetests-TestObjectives"></a>Test Objectives</h1>

<p>This 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. </p>

<h1><a name="Portservertonewinterfacetests-PerformanceTestPlan"></a>Performance
Test Plan</h1>

<p>There 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. </p>

<h1><a name="Portservertonewinterfacetests-ExistingSystemTests"></a>Existing
System Tests</h1>

<p>There 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. </p>

<p>In particular the following test cases contain tests which fully exercise the changed
code paths in the broker</p>

<h2><a name="Portservertonewinterfacetests-ConnectionTest"></a>ConnectionTest</h2>

<p>This TestCase contains:</p>
<ol>
	<li>testSimpleConnection which verifies that a basic AMQP connection can be created
establishing that:
	<ol>
		<li>TCP connections can be created from client to broker</li>
		<li>Protocol negotiation continues to work</li>
		<li>The broker can decode and encode frames properly</li>
		<li>The broker is properly handling decoded frames</li>
	</ol>
	</li>
	<li>testPasswordFailureConnection which verifies that a connection with incorrect authentication
fails to be established and throws the correct exception</li>
	<li>testUnresolvedVirtualHostFailure which verifies that a connection to the wrong
virtual host fails to be  established and throws the correct exception</li>
</ol>


<h2><a name="Portservertonewinterfacetests-AcknowledgeTest"></a>AcknowledgeTest</h2>

<p>This TestCase contains:</p>
<ol>
	<li>test2ConsumersAutoAck which verifies that multiple connections doing input/output
simultaneouslyworks</li>
	<li>test2ConsumersTx which verifies that multiple connections doing input/output simultaneously
inside a transaction works</li>
</ol>


<h2><a name="Portservertonewinterfacetests-MultipleConnectionTest"></a>MultipleConnectionTest</h2>

<p>This TestCase contains:</p>
<ol>
	<li>test which verifies that many connections reading and writing to the broker at
the same time works</li>
</ol>


<h2><a name="Portservertonewinterfacetests-SimpleACLTest"></a>SimpleACLTest</h2>

<p>This TestCase contains multiple tests which will verify that connection attempts
where authorization fails continue to throw the correct exception. </p>

<h1><a name="Portservertonewinterfacetests-Newsystemtestsrequired"></a>New
system tests required</h1>

<p>No system tests exist which test the AMQP heartbeating functionality.</p>

<h2><a name="Portservertonewinterfacetests-ServerHeartbeatTest"></a>ServerHeartbeatTest</h2>

<h3><a name="Portservertonewinterfacetests-testClientWriteIdleTest"></a>testClientWriteIdleTest</h3>

<p>This 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. </p>

<h1><a name="Portservertonewinterfacetests-ExistingUnitTests"></a>Existing
Unit Tests</h1>

<p>Existing 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. </p>

<h1><a name="Portservertonewinterfacetests-Newunittestsrequired"></a>New
unit tests required</h1>

<p>Unit tests will need to be written for MINANetworkDriver, AMQProtocolEngine and AMQDecoder</p>

<h2><a name="Portservertonewinterfacetests-MINANetworkDrivertests"></a>MINANetworkDriver
tests</h2>

<p>The unit test will create a ProtocolEngine to implement a simple echo server which
will send back any recieved data.</p>

<div>
<ul>
    <li><a href='#Portservertonewinterfacetests-testClientWriteIdleTest'>testClientWriteIdleTest</a></li>
    <li><a href='#Portservertonewinterfacetests-testBindOpen'>testBindOpen</a></li>
    <li><a href='#Portservertonewinterfacetests-testBindSocketInUse'>testBindSocketInUse</a></li>
    <li><a href='#Portservertonewinterfacetests-testSend'>testSend</a></li>
    <li><a href='#Portservertonewinterfacetests-testSetReadIdle'>testSetReadIdle</a></li>
    <li><a href='#Portservertonewinterfacetests-testSetWriteIdle'>testSetWriteIdle</a></li>
    <li><a href='#Portservertonewinterfacetests-testClosed'>testClosed</a></li>
    <li><a href='#Portservertonewinterfacetests-testExceptionCaught'>testExceptionCaught</a></li>
    <li><a href='#Portservertonewinterfacetests-testGetRemoteAddress'>testGetRemoteAddress</a></li>
</ul></div>

<h3><a name="Portservertonewinterfacetests-testBindOpen"></a>testBindOpen</h3>

<p>This 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.</p>

<h3><a name="Portservertonewinterfacetests-testBindSocketInUse"></a>testBindSocketInUse</h3>

<p>This test will create </p>

<h3><a name="Portservertonewinterfacetests-testSend"></a>testSend</h3>

<p>This test will create one NetworkDriver and call it's send method and verify that
the data is passed to the ProcotolEngines receive() method</p>

<h3><a name="Portservertonewinterfacetests-testSetReadIdle"></a>testSetReadIdle</h3>

<p>This 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</p>

<h3><a name="Portservertonewinterfacetests-testSetWriteIdle"></a>testSetWriteIdle</h3>

<p>This 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</p>

<h3><a name="Portservertonewinterfacetests-testClosed"></a>testClosed</h3>

<p>This test will create one NetworkDriver and close it. It will verify that the ProtocolEngines
closed method is called.</p>

<h3><a name="Portservertonewinterfacetests-testExceptionCaught"></a>testExceptionCaught</h3>

<p>This 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.</p>

<h3><a name="Portservertonewinterfacetests-testGetRemoteAddress"></a>testGetRemoteAddress</h3>

<p>This getRemoteAddress method and returns a SocketAddress that corresponds to localhost.
</p>


<h2><a name="Portservertonewinterfacetests-AMQDecodertests"></a>AMQDecoder
tests</h2>

<div>
<ul>
    <li><a href='#Portservertonewinterfacetests-testDecodePI09'>testDecodePI09</a></li>
    <li><a href='#Portservertonewinterfacetests-testDecodePI08'>testDecodePI08</a></li>
    <li><a href='#Portservertonewinterfacetests-testDecodePartialDataBlock'>testDecodePartialDataBlock</a></li>
    <li><a href='#Portservertonewinterfacetests-testDecodeCompleteDataBlock'>testDecodeCompleteDataBlock</a></li>
    <li><a href='#Portservertonewinterfacetests-testEncodeFrame'>testEncodeFrame</a></li>
</ul></div>

<h4><a name="Portservertonewinterfacetests-testDecodePI09"></a>testDecodePI09</h4>

<p>This 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.</p>

<h4><a name="Portservertonewinterfacetests-testDecodePI08"></a>testDecodePI08</h4>

<p>This 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.</p>

<h4><a name="Portservertonewinterfacetests-testDecodePartialDataBlock"></a>testDecodePartialDataBlock</h4>

<p>This 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. </p>

<h4><a name="Portservertonewinterfacetests-testDecodeCompleteDataBlock"></a>testDecodeCompleteDataBlock</h4>

<p>This test will create a byte buffer containing a complete AMQP data block and verify
that doDecode returns an AMQFrame of the apppropriate type.</p>

<h4><a name="Portservertonewinterfacetests-testEncodeFrame"></a>testEncodeFrame</h4>

<p>This test will create an AMQP frame and verify that encodeFrame returns a byte array
with the appropriate contents.</p>

<h2><a name="Portservertonewinterfacetests-AMQProtocolEnginetests"></a>AMQProtocolEngine
tests</h2>

<div>
<ul>
    <li><a href='#Portservertonewinterfacetests-testPartialReceived'>testPartialReceived</a></li>
    <li><a href='#Portservertonewinterfacetests-testCompleteReceived'>testCompleteReceived</a></li>
    <li><a href='#Portservertonewinterfacetests-testReaderIdle'>testReaderIdle</a></li>
    <li><a href='#Portservertonewinterfacetests-testWriterIdle'>testWriterIdle</a></li>
    <li><a href='#Portservertonewinterfacetests-testGetRemoteAddress'>testGetRemoteAddress</a></li>
</ul></div>

<p>These tests will use a MockNetworkDriver to test the functionality of the ProtocolEngine
parts of AMQProtocolEngine</p>

<h5><a name="Portservertonewinterfacetests-testPartialReceived"></a>testPartialReceived</h5>

<p>This 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.</p>

<h5><a name="Portservertonewinterfacetests-testCompleteReceived"></a>testCompleteReceived</h5>

<p>This test will pass in a ByteBuffer containing a complete AMQP frame and check that
the frame handler is called. </p>

<h5><a name="Portservertonewinterfacetests-testReaderIdle"></a>testReaderIdle</h5>

<p>This test will call the ProtocolEngines readerIdle method and check that the ProtocolEngine
closes itself</p>

<h5><a name="Portservertonewinterfacetests-testWriterIdle"></a>testWriterIdle</h5>

<p>This test will call the ProtocolEngines writerIdle method and check that the ProtocolEngine
calls the NetworkDriver.send() method with an encoded HeartBeatBody frame</p>

<h5><a name="Portservertonewinterfacetests-testGetRemoteAddress"></a>testGetRemoteAddress</h5>

<p>This test will verify that the ProtocolEngine.getRemoteAddress method calls the NetworkDriver.getRemoteAddress
method and returns the same data. </p>

<h2><a name="Portservertonewinterfacetests-AMQProtocolEngineMbeantests"></a>AMQProtocolEngineMbean
tests</h2>

<div>
<ul>
    <li><a href='#Portservertonewinterfacetests-testGetRemoteAddress'>testGetRemoteAddress</a></li>
</ul></div>

<h6><a name="Portservertonewinterfacetests-testGetRemoteAddress"></a>testGetRemoteAddress</h6>

<p>This test will verify that the ProtocolEngineMbean.getRemoteAddress method calls
the ProtocolEngine.getRemoteAddress method and returns the same data. </p>

<h2><a name="Portservertonewinterfacetests-NetworkDriverConfigurationtests"></a>NetworkDriverConfiguration
tests</h2>



<p>This test case will construct a ServerConfiguration with known values</p>

<p>h7. testGetKeepAlive</p>

<p>This test will verify that the method returns the expected value</p>

<p>h7. testGetOOBInline</p>

<p>This test will verify that the method returns the expected value</p>

<p>h7. testGetReuseAddress</p>

<p>This test will verify that the method returns the expected value</p>

<p>h7. testGetSoLinger</p>

<p>This test will verify that the method returns the expected value</p>

<p>h7. testGetSoTimeout</p>

<p>This test will verify that the method returns the expected value</p>

<p>h7. testGetTcpNoDelay</p>

<p>This test will verify that the method returns the expected value</p>

<p>h7. testGetTrafficClass</p>

<p>This test will verify that the method returns the expected value</p>

<p>h7. testGetReceiveBufferSize</p>

<p>This test will verify that the method returns the expected value</p>

<p>h7. testGetSendBufferSize</p>

<p>This test will verify that the method returns the expected value</p>
     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/qpid/Port+server+to+new+interface+tests">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=2328856&revisedVersion=12&originalVersion=11">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/qpid/Port+server+to+new+interface+tests?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message