Add unit tests framework (Mockito)

Details

Description

Most HDFS tests are functional tests that test a feature end to end by running a mini cluster. We should add more tests like TestReplication that attempt to stress individual classes in isolation, ie by stubbing out dependencies without running a mini cluster. This allows for more fine-grain testing and making tests run much more quickly because they avoid the cost of cluster setup and teardown. If it makes sense to use another framework besides junit we should standardize with MAPREDUCE-1050.

Like MAPREDUCE-1050 but for HDFS. If using framework makes sense we should standardize across Hadoop projects. Using mock objects will allow for fine grain unit tests (ie write tests for particular class without creating a MiniDFSCluster by creating mock objects for some/all of the classes dependencies). I'll work on an example patch for preliminary review.

Most HDFS tests are functional tests that test a feature end to end by running a mini cluster. We should add more tests like TestReplication that attempt to stress individual classes in isolation, ie by stubbing out dependencies without running a mini cluster. This allows for more fine-grain testing and making tests run much more quickly because they avoid the cost of cluster setup and teardown. If it makes sense to use another framework besides junit we should standardize with MAPREDUCE-1050.