?? springtestsupport.java
字號:
package org.jencks;import junit.framework.TestCase;import org.springframework.context.ConfigurableApplicationContext;import org.springframework.context.support.ClassPathXmlApplicationContext;import javax.jms.Session;/** * @version $Revision: 1.1 $ */public abstract class SpringTestSupport extends TestCase { protected ConfigurableApplicationContext applicationContext; protected void setUp() throws Exception { applicationContext = createApplicationContext(); assertNotNull("Should have an ApplicationContext", applicationContext); } protected void tearDown() throws Exception { if (applicationContext != null) { applicationContext.close(); } } protected ConfigurableApplicationContext createApplicationContext() { return new ClassPathXmlApplicationContext(getApplicationContextXml()); } protected abstract String getApplicationContextXml(); /** * Finds the mandatory bean in the application context failing if its not there */ protected Object getBean(String name) { Object answer = applicationContext.getBean(name); assertNotNull("Could not find bean in ApplicationContext called: " + name, answer); return answer; }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -