码迷,mamicode.com
首页 > 其他好文 > 详细

junit 测试

时间:2017-05-16 12:50:05      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:extend   query   public   junit4   dal   upd   man   src   resources   

public class ATest extends TestCase{
	 ApplicationContext ctx = null;
	 
	 @Override
	 protected void setUp() throws Exception {
		 System.out.println("%%%%%%%%%%%%%");
		 ctx =  new ClassPathXmlApplicationContext("classpath:res/spring/dao/applicationContext-resources.xml");
		// ctx = new FileSystemXmlApplicationContext("D:\\workspace\\AmiBasicModule\\src\\test\\res\\spring\\dao\\applicationContext-resources.xml");
	 }
	 
	 public void testiBatis(){
		 OrderManagerInf service = (OrderManagerInf)ctx.getBean("orderManager");
		 System.out.println(service.dangkouQuery(null));
	 }
}

 http://blog.sina.com.cn/s/blog_52fea7b60100op1o.html

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:applicationContext.xml")
public class CityImplTest {
    public void setUp() throws Exception {


    }

    public void tearDown() throws Exception {

    }

    @Test
    public void testFindOne() throws Exception {
        CityImpl cityQuery = new CityImpl();
        List<City> cityList = cityQuery.findAll("4ee057d90cf2d13fa03ab5d0");
        System.out.println(cityList.get(0).getName());
    }


    public void testFindAll() throws Exception {

    }

    public void testSave() throws Exception {

    }

    public void testUpdate() throws Exception {

    }

    public void testDelete() throws Exception {

    }

    public void testSearch() throws Exception {

    }
}

 

junit 测试

标签:extend   query   public   junit4   dal   upd   man   src   resources   

原文地址:http://www.cnblogs.com/xumin/p/6860431.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!