Closed abhishekdas99 closed 6 years ago
One big question is composition vs inheritance between the two implementations of Hadoop Cluster Managers. I probably prefer inheritance in this specific case because tests that are valid for V1 is also valid for V2 except for a few scenarios where you want different scenarios. If you choose composition, then you have to repeat all the tests.
@vrajat Yes I thought about it. First the tests are same in terms of checking the condition. The output of the tests are going to be different. For example, for testUnhealthyNodeCluster_decommissioned
, the old HadoopClusterManager will return 1 node whereas the new implementation is going to return 2 nodes.
Both the clustermanagers are extending the abstract class and quite a few implementations are different for these two cases such as initialize
, getNextRunningNodeIndex
and getPreviousRunningNodeIndex
. The common methods which can be used as utility methods have been extracted out to a different Utility class. Same logic has been applied to TestClasses as well.
Pull Request Test Coverage Report for Build 160
💛 - Coveralls