Package com.alibaba.citrus.springext.support.context

Examples of com.alibaba.citrus.springext.support.context.XmlApplicationContext


    public void init() {
        if (skipValidation) {
            System.setProperty("skipValidation", "true");
        }

        factory = new XmlApplicationContext(new FileSystemResource(new File(srcdir, "services-skip-validation.xml")));
        upload = (UploadServiceImpl) factory.getBean("uploadService");
    }
View Full Code Here


        factory = new XmlBeanFactory(new FileSystemResource(new File(srcdir, "beans.xml")));
    }

    @Test
    public void autowireAndInitialize() throws Exception {
        ApplicationContext context = new XmlApplicationContext(new FileSystemResource(new File(srcdir, "beans.xml")));

        class Bean implements BeanNameAware, ApplicationContextAware, InitializingBean {
            @Autowired
            private com.alibaba.citrus.springext.support.context.MyClass myClass;
            private String                                               beanName;
View Full Code Here

        System.setProperty("loggingLevel", "debug");
        factory = createContext("services.xml", createContext("services-root.xml", null));
    }

    protected final static ApplicationContext createContext(String configLocation, ApplicationContext parent) {
        XmlApplicationContext factory = new XmlApplicationContext(new FileSystemResource(new File(srcdir,
                                                                                                  configLocation)), parent);
        factory.getBeanFactory().registerScope("request", new RequestScope());
        return factory;
    }
View Full Code Here

    protected static ApplicationContext createContext(String name, boolean prod) {
        return createContext(name, prod ? prodContext : devContext);
    }

    protected static ApplicationContext createContext(String name, ApplicationContext parent) {
        return new XmlApplicationContext(new FileSystemResource(new File(srcdir, name)), parent);
    }
View Full Code Here

        assertResourceServiceList("/test.txt", "test.txt", true, false);
    }

    @Test
    public void noParent() throws Exception {
        ApplicationContext factory = new XmlApplicationContext(new FileSystemResource(new File(srcdir,
                                                                                               "loader/super-loader.xml")));

        resourceLoadingService = (ResourceLoadingService) factory.getBean("resourceLoadingService");
        assertResourceServiceList("/no_name/webroot/test.txt", "test.txt", false, false);
        assertResourceServiceList("/with_name/test.txt", "test.txt", false, false);

        resourceLoadingService = (ResourceLoadingService) factory.getBean("sameName");
        assertResourceServiceList("/webroot/test.txt", "test.txt", false, false);

        resourceLoadingService = (ResourceLoadingService) factory.getBean("defaultName");
        assertResourceServiceList("/test.txt", "test.txt", false, false);

        resourceLoadingService = (ResourceLoadingService) factory.getBean("defaultName1");
        assertResourceServiceList("/test.txt", "test.txt", false, false);
    }
View Full Code Here

    protected HttpServletRequest            newRequest;
    protected HttpServletResponse           newResponse;

    /** 创建beanFactory。 */
    protected final static void createBeanFactory(String configLocation) {
        factory = new XmlApplicationContext(new FileSystemResource(new File(srcdir, configLocation)));
    }
View Full Code Here

    protected RunData                       rundata;
    protected HttpServletRequest            newRequest;
    protected HttpServletResponse           newResponse;

    protected static ApplicationContext createContext(String name) {
        return new XmlApplicationContext(new FileSystemResource(new File(srcdir, name)), null);
    }
View Full Code Here

    protected static ApplicationContext createContext(String name) {
        return new XmlApplicationContext(new FileSystemResource(new File(srcdir, name)), null);
    }

    protected static ApplicationContext createContext(String name, ApplicationContext parent) {
        return new XmlApplicationContext(new FileSystemResource(new File(srcdir, name)), parent);
    }
View Full Code Here

    protected static ApplicationContext createContext(String name) {
        return createContext(name, null);
    }

    protected static ApplicationContext createContext(String name, ApplicationContext parentContext) {
        return new XmlApplicationContext(new FileSystemResource(new File(srcdir, name)), parentContext);
    }
View Full Code Here

        return SchemaUtil.getDocumentText(contrib.getSchemas().getMainSchema().getDocument(), null);
    }

    @Test
    public void parse_import_each_other() throws Exception {
        ApplicationContext ctx = new XmlApplicationContext(new FileSystemResource(new File(srcdir,
                                                                                           "test-import-each-other.xml")));

        Test1 test1 = new Test1(new Test3(new Test1()), new Test4(new Test2()));
        Test3 test3 = new Test3(new Test1());

        assertEquals(test1, ctx.getBean("test1"));
        assertEquals(test3, ctx.getBean("test3"));
    }
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.springext.support.context.XmlApplicationContext

Copyright © 2018 www.massapicom. 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.