⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 springtestsupport.java

📁 Jencks是一个轻量级的JCA容器。它可以轻松部署到Spring中以提供消息驱动的POJOs.此外Jencks通过使用类似于JMS,JAX-RPC,JBI与JCA CCI的API来提供对inboun
💻 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 + -