someserviceimpltest.java

来自「Spring AOP演示程序」· Java 代码 · 共 50 行

JAVA
50
字号
/**
 * SomeServiceImplTest.java 1.0 2007-8-6 下午11:50:24,创建 by yangfan
 */


package aop;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 *
 * @author yangfan
 * @version 1.0 2007-8-6 下午11:50:24,创建
 */
public class SomeServiceImplTest
{
	@SuppressWarnings("unused")
	private static final Log log = LogFactory.getLog(SomeServiceImplTest.class);

	private ApplicationContext ctx;

	@Before
	public void setUp() throws Exception
	{
		String[] paths = { "classpath:applicationContext-aop.xml" };
        ctx = new ClassPathXmlApplicationContext(paths);
	}

	@After
	public void tearDown() throws Exception
	{
	}

	@Test
	public void testAop()
	{
		SomeService someService = (SomeService) ctx.getBean("someService");
		log.debug("someService.class==>" + someService.getClass());
        someService.someMethod();
        log.debug("---------invoke someInnerMetho----------------");
        someService.someInnerMethod();
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?