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

Examples of com.alibaba.citrus.service.resource.support.ResourceLoadingSupport


        System.setProperty("user.name", "baobao"); // javamail Service���ȥȡuser.name���˴���ȷ�趨��ֵ��
    }

    protected static final XmlApplicationContext initFactory(String configFile) {
        XmlApplicationContext factory = new XmlApplicationContext(new FileSystemResource(new File(srcdir, configFile)));
        factory.setResourceLoadingExtender(new ResourceLoadingSupport(factory));
        return factory;
    }
View Full Code Here


        System.setProperty("project.home", new File("").getAbsolutePath());
        System.setProperty("srcdir", srcdir.getAbsolutePath());
        XmlWebApplicationContext webCtx = new XmlWebApplicationContext();

        webCtx.setResourceLoadingExtender(new ResourceLoadingSupport(webCtx));
        webCtx.setConfigLocation(new File(srcdir, configFile).toURI().toString());
        webCtx.setServletContext(servletContext);
        webCtx.refresh();

        parentFactory = webCtx;
View Full Code Here

        System.setProperty("user.name", "baobao"); // javamail Service类会去取user.name,此处明确设定该值。
    }

    protected static final XmlApplicationContext initFactory(String configFile) {
        XmlApplicationContext factory = new XmlApplicationContext(new FileSystemResource(new File(srcdir, configFile)));
        factory.setResourceLoadingExtender(new ResourceLoadingSupport(factory));
        return factory;
    }
View Full Code Here

    }

    @Before
    public void init() {
        context = new XmlWebApplicationContext();
        support = new ResourceLoadingSupport(context);

        context.setResourceLoadingExtender(support);
        context.setServletContext(servletContext);

        MyLoader.locationHolder.remove();
View Full Code Here

    }

    @Test
    public void resourceLoadingSupport_noFactory() {
        try {
            new ResourceLoadingSupport(null);
            fail();
        } catch (IllegalArgumentException e) {
            assertThat(e, exception("beanFactory"));
        }
    }
View Full Code Here

    @Test
    public void resourceLoadingSupport_getResourceLoadingService() {
        initContext("beans.xml");
        assertSame(context.getBean("resourceLoadingService"), support.getResourceLoadingService());
        assertSame(context.getBean("resourceLoadingService"),
                   new ResourceLoadingSupport(context).getResourceLoadingService());
    }
View Full Code Here

        assertTrue(resources[1].exists());
    }

    @Test
    public void getResource_noResourceLoadingService() throws Exception {
        context.setResourceLoadingExtender(new ResourceLoadingSupport(context, "nonExistId"));
        initContext("beans.xml");

        // resourceLoadingService[id=nonExistId]不存在,使用默认的机制装载资源
        Resource resource = context.getResource("beans.xml");
        assertThat(resource, instanceOf(ServletContextResource.class));
View Full Code Here

    protected void initFactory(String configFile) {
        factory = new XmlWebApplicationContext();

        factory.setConfigLocation(configFile);
        factory.setServletContext(servletContext);
        factory.setResourceLoadingExtender(new ResourceLoadingSupport(factory));
        factory.refresh();

        templateService = (TemplateService) factory.getBean("templateService");
        engine = (JspEngineImpl) templateService.getTemplateEngine("jsp");
View Full Code Here

        System.setProperty("project.home", new File("").getAbsolutePath());
        System.setProperty("srcdir", srcdir.getAbsolutePath());
        XmlWebApplicationContext webCtx = new XmlWebApplicationContext();

        webCtx.setResourceLoadingExtender(new ResourceLoadingSupport(webCtx));
        webCtx.setConfigLocation(new File(srcdir, configFile).toURI().toString());
        webCtx.setServletContext(servletContext);
        webCtx.refresh();

        parentFactory = webCtx;
View Full Code Here

    protected void initFactory(String configFile) {
        factory = new XmlWebApplicationContext();

        factory.setConfigLocation(configFile);
        factory.setServletContext(servletContext);
        factory.setResourceLoadingExtender(new ResourceLoadingSupport(factory));
        factory.refresh();

        templateService = (TemplateService) factory.getBean("templateService");
        engine = (JspEngineImpl) templateService.getTemplateEngine("jsp");
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.service.resource.support.ResourceLoadingSupport

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.