1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| package com.runsstudio.test;
import com.runsstudio.Servlet.BookServlet;
import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration(locations = "classpath:com/runsstudio/conf/BeanAdd.xml") @RunWith(SpringJUnit4ClassRunner.class) public class BookTest {
ApplicationContext ioc=null; @Autowired BookServlet bookServlet; @Test public void test01(){ bookServlet.saveBook(); } }
|