elek opened a new pull request #2138:
URL: https://github.com/apache/ozone/pull/2138


   ## What changes were proposed in this pull request?
   
   Today `OzoneClient` is tested only by integration tests 
(`TestOzoneRpcClientAbstract` from integration-test and all the sub-classes).
   
   I believe `OzoneClient` itself contains a lot of smart logic (especially 
regarding the buffering and retry/commit) which are good to be tested. This 
test can be faster and more efficient with real unit tests where the network 
traffic is mocked.
   
   Fortunately we already have interfaces for both (`OmTransport` and 
`XceiverClientSpi`. The latter is just an abstract class, not an interface, but 
nothing can be perfect ;-)).  
   
   With the help of these interfaces it's quite easy to create the unit test.
   
   I copied some methods from the `TestOzoneRpcClientAbstract` and tested them 
without creating MiniOzoneCluster but using in-memory implementation of OM/DN 
client interfaces.
   
   Not all the methods are tested (yet) but the main key create / read path is 
already covered. The main goal is to have all the required classes on master 
which can be used later by the new EC part of the client which can have good 
coverage with standard, fast unit tests (and later with integration test, 
too...)
   
   ## How was this patch tested?
   
   The new unit test is executed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to