wx930910 opened a new pull request #2254:
URL: https://github.com/apache/accumulo/pull/2254


   Fixes #2253
   
   ### Description
   
   #### Refactor test class 
[MockRateLimiter](https://github.com/apache/accumulo/blob/1dc72fce2c781dee597c8c11876a3bc6c321c199/core/src/test/java/org/apache/accumulo/core/file/streams/MockRateLimiter.java#L25)
 and test file 
[RateLimitedInputStreamTest.java](https://github.com/apache/accumulo/blob/1dc72fce2c781dee597c8c11876a3bc6c321c199/core/src/test/java/org/apache/accumulo/core/file/streams/RateLimitedInputStreamTest.java#L33),
 
[RateLimitedOutputStreamTest.java](https://github.com/apache/accumulo/blob/1dc72fce2c781dee597c8c11876a3bc6c321c199/core/src/test/java/org/apache/accumulo/core/file/streams/RateLimitedOutputStreamTest.java#L35)
   
   <hr>
   
   ##### Motivation
   
   - Decoupling test class `MockRateLimiter` from production class 
`RateLimiter`.
   - Making test condition more clear by verifying mocking obejct's behavior 
with a local variable.
   - Making test logic more clear by using method stub instead of method 
overriding.
   
   <hr>
   
   ##### Key changed/added classes in this PR
    * Created mocking object to replace test subclass `MockRateLimiter`, 
decoupled test from production code.
    * Extract `PermitsAcquired` as a local variable to improve test logic and 
make test condition more explict.
   
   <hr>


-- 
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.

To unsubscribe, e-mail: [email protected]

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


Reply via email to