HADOOP-9767: refactor test code to better fit with existing trunk test code