Package com.sishuok.spring4.annotation

Source Code of com.sishuok.spring4.annotation.ApplicationContextAnnotationTest

package com.sishuok.spring4.annotation;

import com.sishuok.spring4.generic.GenericConfig;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Map;

/**
* <p>User: Zhang Kaitao
* <p>Date: 13-12-22
* <p>Version: 1.0
*/
public class ApplicationContextAnnotationTest {

    @Test
    public void test() {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
        ctx.register(GenericConfig.class);
        ctx.refresh();

        Map<String, Object> beans = ctx.getBeansWithAnnotation(org.springframework.stereotype.Service.class);
        System.out.println(beans);
    }
}
TOP

Related Classes of com.sishuok.spring4.annotation.ApplicationContextAnnotationTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.