1.
public class DepoAssureTest {
private static ApplicationContext context = null;
public static void main(String[] args) {
try {
context = new ClassPathXmlApplicationContext("spring/*");
DepoAssureBackendInterface depoAssureBackendInterface = (DepoAssureBackendInterface)context.getBean("depoAssureBackendInterfaceImpl");
}catch (Exception e){
e.printStackTrace();
}
}
}
2.
@RunWith(SpringJUnit4ClassRunner.class)
//引入Spring配置
@ContextConfiguration({"classpath:spring/*.xml"})
public class BaseTest {
}