???????
????hadoop??mapreduce????????????г???????λ?????鷳????????????????????????????????????С??????????????????????????????????????б???????????????????????????????????bug????????е???????????????????????????л????????????????
?????????mapreduce????????????Щ?????????Map??Reduce?Щ???????????????????hadoop????????????OutputCollector??Reporter??InputSplit??????????Mock??Ρ???дmapreduce??????????????д?????????Mock????????????????????????MRUnit????д????????????о?????2??????MRUnit??????hadoop mapreduceд???????????API????????????á???????Щ?????????????粻???MultipleOutputs?????????????????MultipleOutputs????????????????潫??????????MRUnit?????MultipleOutputs????
????MRUnit
????MRUnit????????????????????????Driver??
????  MapDriver??????????Map?????
????  ReduceDriver??????????Reduce?????
????  MapReduceDriver????Map??Reduce?????????????
????  PipelineMapReduceDriver???????Map-Reduce pair???????
????MapDriver
????????????Map??????????????????????????????????????Map????????η??????????????Map??????

//??????????Map
private Map mapper;
private MapDriver<LongWritable?? Text?? Text?? TimeInfo> mapDriver;
@Before
public void setUp() {
mapper = new Map();
mapDriver = new MapDriver<LongWritable?? Text?? Text?? TimeInfo>();
}
@Test
public void testMap_timeFormat2() {
String sellerId = "444";
//?????????У?withInput???????????????????????????????(sellerId)      //????????? ?10С?.
//?????????????sellerId?key??value?????1??10С???TimeInfo????          //??withOutput??
//??????????????Map????????????????????????????
Text mapInputValue = new Text("……");
mapDriver.withMapper(mapper)
.withInput(null?? mapInputValue)
.withOutput(new Text(sellerId)?? new TimeInfo(1?? 10))
.runTest();
}
 
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????