injectspringobjectfactorytest.java
来自「在Struts2中的jar包xwork的源代码.版本为2.0.7」· Java 代码 · 共 30 行
JAVA
30 行
/* * Created on Jun 29, 2004 */package com.opensymphony.xwork2.spring;import com.opensymphony.xwork2.ObjectFactory;import com.opensymphony.xwork2.XWorkTestCase;import org.springframework.context.ApplicationContext;import org.springframework.context.support.ClassPathXmlApplicationContext;/** * Test that Spring correctly calls the "init" method of the * {@link com.opensymphony.xwork2.spring.SpringObjectFactory} * * @author Simon Stewart */public class InjectSpringObjectFactoryTest extends XWorkTestCase { public void testSpringShouldCallInitMethod() { ApplicationContext appContext = new ClassPathXmlApplicationContext( "com/opensymphony/xwork2/spring/autowireContext.xml"); ObjectFactory factory = ObjectFactory.getObjectFactory(); assertTrue( "ObjectFactory should be an instance of SpringObjectFactory", factory instanceof SpringObjectFactory); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?