Junit测试

来源:互联网 发布:win10有线网络无法上网 编辑:程序博客网 时间:2024/05/16 17:23
@RunWith(SpringJUnit4ClassRunner.class)  //使用junit4进行测试  
@ContextConfiguration   
(locations={
"file:E:/DevelopedTools/green software/MyEclipse10/workSpace/Workspaces/Workspaces10/fcruise/WebRoot/WEB-INF/webApplicationContext.xml"
  }) //加载配置文件  




public class TravelDaoTest extends TestCase{
@Autowired
        private ApplicationContext ac;上下文
@Autowired 
private TravelDao t;

@Test
public void testTravelList(){


PageModel p=new PageModel();
p.setSearchKey("7");
List<Map<String,Object>> list=t.travelList(p);
}
}
0 0
原创粉丝点击