${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核心编程 第二版》.(Wesley J. Chun ).[高清PDF中文版]
《Python开发技术详解》.( 周伟,宗杰).[高清PDF扫描版+随书视频+代码]
在Ubuntu下用Python搭建桌面算法交易研究环境