1、编写测试类
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.hp.approval.single.impl.SingleInterfaceManager;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath*:/spring/context-*.xml"})//从web.xml中获取contextConfigLocation路径
public class TestInterface {
@Autowired
private SingleInterfaceManager manager;
@Test
public void TestApproval(){
manager.checkSingleApproval();
}
}
2.web.xml格式