You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
845 B
26 lines
845 B
package com.ssm.aop.xml.test;
|
|
|
|
import org.springframework.context.ApplicationContext;
|
|
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
|
|
|
public class TestAnnotation {
|
|
public static void main(String[] args) {
|
|
ApplicationContext ac = new ClassPathXmlApplicationContext("com/ssm/aop/xml/test/bean-di-aop.xml");
|
|
|
|
// 测试Category
|
|
Category category = (Category) ac.getBean("category");
|
|
category.printMessage();
|
|
|
|
// 测试Announcement
|
|
Announcement announcement = (Announcement) ac.getBean("announcement");
|
|
announcement.printPub();
|
|
|
|
// 测试Flower
|
|
Flower flower = (Flower) ac.getBean("flower");
|
|
flower.printFlower();
|
|
|
|
// 测试Content
|
|
Content content = (Content) ac.getBean("content");
|
|
content.printContent();
|
|
}
|
|
} |