mybatis测试类
来源:互联网 发布:乐视有没有mac 编辑:程序博客网 时间:2024/06/10 12:34
public class RechargeRecordTest {
private SqlMapClient sqlMapClient;
private ApplicationContext context;
// 此方法是在执行testFindUserById之前执行
@org.junit.Before
public void setUp() throws Exception {
String resource = "com/fenghu/config/SqlMapConfig.xml";
InputStream inputStream = null;
inputStream = Resources.getResourceAsStream(resource);
SqlMapClient sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(inputStream);
context = new ClassPathXmlApplicationContext("com/fenghu/config/applicationContext.xml");
}
@Test
public void updateRecordAndHistoryTest() throws Exception{
RechargeRecordBiz userService = (RechargeRecordBiz) context.getBean("rechargeRecordBiz");
Rechargerecord rechargerecord = new Rechargerecord();
rechargerecord.setAvailableamount(50d);
rechargerecord.setOrderid(1000001);
rechargerecord.setRechargeamount(200d);
rechargerecord.setRechargedate(new Date());
rechargerecord.setRechargetype(2);
rechargerecord.setUsername("18300087973");
rechargerecord.setUsestatus(0);
String msg = userService.insertRechReco(rechargerecord,new Htrecord());
System.out.println(msg);
private SqlMapClient sqlMapClient;
private ApplicationContext context;
// 此方法是在执行testFindUserById之前执行
@org.junit.Before
public void setUp() throws Exception {
String resource = "com/fenghu/config/SqlMapConfig.xml";
InputStream inputStream = null;
inputStream = Resources.getResourceAsStream(resource);
SqlMapClient sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(inputStream);
context = new ClassPathXmlApplicationContext("com/fenghu/config/applicationContext.xml");
}
@Test
public void updateRecordAndHistoryTest() throws Exception{
RechargeRecordBiz userService = (RechargeRecordBiz) context.getBean("rechargeRecordBiz");
Rechargerecord rechargerecord = new Rechargerecord();
rechargerecord.setAvailableamount(50d);
rechargerecord.setOrderid(1000001);
rechargerecord.setRechargeamount(200d);
rechargerecord.setRechargedate(new Date());
rechargerecord.setRechargetype(2);
rechargerecord.setUsername("18300087973");
rechargerecord.setUsestatus(0);
String msg = userService.insertRechReco(rechargerecord,new Htrecord());
System.out.println(msg);
}
}
0 0
- mybatis测试类
- MyBatis测试范例
- MyBatis配置测试
- Mybatis简单测试
- mybatis 测试文件
- SpringMvc+Mybatis简单测试
- spring-mybatis整合测试
- spring测试mybatis
- MyBatis 框架测试ResultMapsm
- spring+Mybatis(测试)
- MyBatis核心API测试
- mybatis加载配置文件测试
- SSM框架中mybatis接口测试工具类
- MyBatis框架测试 Srping+mybatis+maven
- MyBatis学习【二】CRUD测试
- springMVC、spring、mybatis整合测试
- MyBatis+Spring 事务管理(未测试)
- spring+mybatis+junit测试问题
- HttpModule(管道层)在项目和网站中的使用简单实例
- POJ 2019 Cornfields 【二维线段树】
- Java_Spring----My Batis
- JAVA该掌握的知识
- python pexpect
- mybatis测试类
- Coursera《machine learning》--(2)单变量线性回归(Linear Regression with One Variable)
- 应该如何入门deep learning呢?从UFLDL开始!
- (转载)深度学习三十年创新路
- Coursera《machine learning》--(8)神经网络表述
- 卷积神经网络
- (转载)卷积神经网络
- 机器学习、深度学习的相关资料
- (转载)KL距离,Kullback-Leibler Divergence