public void setDao(Dao dao)
{
this.dao = dao;
}
public String operate()
{
List list = dao.execute("select * from tbl_test");
return (String) list.get(0);
}
}
//BusinessTest.java
package com.raistlin.test.jmock
import org.jmock.cglib.MockObjectTestCase;
import org.jmock.cglib.Mock;
public class BusinessTest extends MockObjectTestCase
{
private Mock mockDao = null;
private Business business = null;
protected void setUp() throws Exception
{
super.setUp();
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/