基于模板的简易代码生成器Python源码(2)

${testObject}DAO ${testObjVarName}DAO = get${testObject}DAO();
        long result = ${testObjVarName}DAO.insert(${testObjVarName}DO);
        Assert.assertTrue(result > 0);
    }
}

效果

/**
 * created since 2011-12-30 14:31:38
 */
package com.alipay.mspcore.common.dal.ibatis;

import java.util.Date;

import junit.framework.Assert;

import com.alipay.mspcore.common.dal.daointerface.UpdateHintDAO;
import com.alipay.mspcore.common.dal.dataobject.UpdateHint;
import com.alipay.sofa.runtime.test.AnnotatedAutowireSofaTestCase;
import com.iwallet.biz.common.util.money.Money;

/**
 * @author chenxin
 * @version $Id: IbatisUpdateHintDAOTester.java, v 0.1 2011-12-30 14:31:38 chenxin Exp $
 */
public class IbatisUpdateHintDAOTester extends AnnotatedAutowireSofaTestCase {

@Override
    public String[] getConfigurationLocations() {
        return new String[] { "META-INF/spring/common-dal-db.xml",
                "META-INF/spring/mobilespcore-common-dal-dao.xml", "META-INF/spring/common-dal.xml" };
    }

@Override
    public String[] getResourceFilterNames() {
        return new String[] { "META-INF/spring/common-dal-db.xml" };
    }

@Override
    public String[] getWebServiceConfigurationLocations() {
        return new String[] {};
    }

private UpdateHintDAO getUpdateHintDAO() {
        UpdateHintDAO dao = (UpdateHintDAO) this.getBean("updateHintDAO", UpdateHintDAO.class, null);
        return dao;
    }

public void testUpdateHintDAO() {
        UpdateHintDAO configDAO = getUpdateHintDAO();
        Assert.assertNotNull(configDAO);
    }

public void test() {
        UpdateHintDO updateHintDO = new UpdateHintDO();
        updateHintDO.setGmtCreate(new Date());
        updateHintDO.setGmtModified(new Date());
        updateHintDO.setId(10000);

UpdateHintDAO updateHintDAO = getUpdateHintDAO();
        long result = updateHintDAO.insert(updateHintDO);
        Assert.assertTrue(result > 0);
    }
}

Python向PHP发起GET与POST请求

《Python核心编程 第二版》.(Wesley J. Chun ).[高清PDF中文版]

《Python开发技术详解》.( 周伟,宗杰).[高清PDF扫描版+随书视频+代码]

Python脚本获取Linux系统信息

Ubuntu下用Python搭建桌面算法交易研究环境

Python 语言的发展简史

Python 的详细介绍请点这里
Python 的下载地址请点这里

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/f515527c7bcd9aad7bff72d2d63b8a8d.html