前三句可以打印 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(); } }