????????

??????????????????????Toast???????????????????????????á???????????????о????????mock?????????????????Mock??????hadoop??????????????????????????????????????????????????Щ??????

????????????????????mock???????????????????????壬?????????????????????????????е???壬????????????????????????????

????1????????????

????2??????????

????3?????????????

????4???????????κε????????????

????5?????????ú?????????????

???????????????г?????????????????????????????????????Ч???????????????????????Ч???????????Щ?????????????????????????????????????壬????????????????????????????????????????????????????????????

????????????????????????????????????Ч??????????????????п????????????????????????????????????С???????????????mock???????滻???Щ??????????????????????Э????????????У?mock????????????Ч????????Ρ?

???????????hadoop?????????????????????????google?У???????????????????????????????

?????????????????hadoop????????????ο????????????????????????????????????mock????Ρ?????????????hadoop????????????????????С????Щ?????hadoop?????????Щ??????????????????

???????????????£????Mockito????hadoop?????????mock???????+ PowerMock????????hadoop????????????????????

??????????????????

?????????????????????ShopScanMap??


public class ShopScanMap extends TableMapper<Text?? Text> {
@Override
    public void setup(Context context) throws IOException {
          //…
       Configuration conf = context.getConfiguration();
 
       ht_shop_info = new HTable(conf?? Bytes.toBytes(ParaDefine.t_shop_info));
       ht_bmw_users = new HTable(conf?? Bytes.toBytes(ParaDefine.t_bmw_users));
      
         …
 
       count_bmw = context.getCounter("Statistics"?? ParaDefine.t_bmw_shops);
 
         //…
}
 
    @Override
    public void map(ImmutableBytesWritable inKey?? Result inValue??
           Context context) throws IOException?? InterruptedException {
         //????main_process????
}
 
private int main_process(Map<String?? String> mapOutPut??
           Field_Bmw_Shops fBmwShops?? long shop_id?? TimeBill timeBill_shop??
           TimeBill timeBill_user) throws IOException {
         //…
       Get gtShopInfo = new Get(r_shopinfo.getBytes());
       Result rsShopInfo = ht_shop_info.get(gtShopInfo);
         //…
}
}