The first three sentences can print mybatis log

quote

@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();
        }
    }

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326098766&siteId=291194637