Package com.alibaba.citrus.service.resource.support.context

Examples of com.alibaba.citrus.service.resource.support.context.ResourceLoadingXmlApplicationContext


    public static void initFactory() {
        factory = createFactory("services.xml");
    }

    private static ApplicationContext createFactory(String configFile) {
        return new ResourceLoadingXmlApplicationContext(new FileSystemResource(new File(srcdir, configFile)));
    }
View Full Code Here


    private static ApplicationContext factory;
    private SpringResourceLoaderAdapter freemarkerLoader;

    @BeforeClass
    public static void initFactory() {
        factory = new ResourceLoadingXmlApplicationContext(new FileSystemResource(new File(srcdir, "services.xml")));
    }
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug("Loading ApplicationContext for locations [" + StringUtils.arrayToCommaDelimitedString(locations)
                      + "].");
        }

        ResourceLoadingXmlApplicationContext context = new ResourceLoadingXmlApplicationContext(locations,
                                                                                                testResourceLoader, false);

        prepareContext(context);
        context.refresh();
        context.registerShutdownHook();

        return context;
    }
View Full Code Here

            System.setProperty("test.destdir", destdir.getAbsolutePath());

            Resource testResourceConfig = new ClassPathResource(
                    ClassUtil.getResourceNameForPackage(SpringextContextLoader.class) + "/test-resources.xml");

            return new ResourceLoadingXmlApplicationContext(testResourceConfig);
        } finally {
            System.clearProperty("test.srcdir");
            System.clearProperty("test.destdir");
        }
    }
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug("Loading ApplicationContext for locations [" + StringUtils.arrayToCommaDelimitedString(locations)
                      + "].");
        }

        ResourceLoadingXmlApplicationContext context = new ResourceLoadingXmlApplicationContext(locations, testResourceLoader, false);

        prepareContext(context);
        context.refresh();
        context.registerShutdownHook();

        return context;
    }
View Full Code Here

    public final ConfigurableApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception {
        if (log.isDebugEnabled()) {
            log.debug("Loading ApplicationContext for merged context configuration [" + mergedConfig + "].");
        }

        ResourceLoadingXmlApplicationContext context = new ResourceLoadingXmlApplicationContext(mergedConfig.getLocations(), testResourceLoader, false);

        context.getEnvironment().setActiveProfiles(mergedConfig.getActiveProfiles());
        prepareContext(context);
        context.refresh();
        context.registerShutdownHook();

        return context;
    }
View Full Code Here

    private static ApplicationContext          factory;
    private        SpringResourceLoaderAdapter velocityLoader;

    @BeforeClass
    public static void initFactory() {
        factory = new ResourceLoadingXmlApplicationContext(new FileSystemResource(new File(srcdir, "services.xml")));
    }
View Full Code Here

        return createContext(name, parent);
    }

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

    protected static ApplicationContext createFactory(String configFile, boolean contextResourceSupport) {
        // 如果!contextResourceSupport,则appcontext返回的resource将被转换成非ContextResource对象,
        // 用于测试preloaded resource loader。
        if (contextResourceSupport) {
            return new ResourceLoadingXmlApplicationContext(new FileSystemResource(new File(srcdir, configFile)));
        } else {
            return new ResourceLoadingXmlApplicationContext(new FileSystemResource(new File(srcdir, configFile))) {
                @Override
                public Resource[] getResources(String locationPattern) throws IOException {
                    Resource[] resources = super.getResources(locationPattern);

                    if (!isEmptyArray(resources)) {
View Full Code Here

    private static ApplicationContext          factory;
    private        SpringResourceLoaderAdapter freemarkerLoader;

    @BeforeClass
    public static void initFactory() {
        factory = new ResourceLoadingXmlApplicationContext(new FileSystemResource(new File(srcdir, "services.xml")));
    }
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.service.resource.support.context.ResourceLoadingXmlApplicationContext

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.