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 Wed, 29 Jul 2009 15:17: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-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></div>

<h1><a name="Portservertonewinterfacetests-Existingunittestcoverage"></a>Existing
unit test coverage</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-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=4&originalVersion=3">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