`
dannyhz
  • 浏览: 374405 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

前三句可以打印 mybatis log

 
阅读更多
引用

@Test
    public void test() throws Exception{
        File config=new File("D:/finance/finance-voucher/src/main/resources/conf/finance-voucher-log.xml");
        ConfigurationSource source = new ConfigurationSource(new FileInputStream(config),config);
        Configurator.initialize(null, source);
    

   ApplicationContext act = new ClassPathXmlApplicationContext(new String[] { "conf/beans.xml" });
        SharedService sharedService = act.getBean(SharedService.class);
        Map paramMap = new HashMap();
        paramMap.put(VoucherConstants.SHARED_SERVICE, sharedService);

        CountDownLatch cdl =  new CountDownLatch(1);
        CompensatoryRepayRecordDetailProcessor processor = null;
        try {
            Date dt = DateUtils.getDate("2018-03-15", "yyyy-MM-dd");
            paramMap.put(VoucherConstants.QUERY_DATE, dt);
            processor = new CompensatoryRepayRecordDetailProcessor(cdl, paramMap);
            processor.call();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics