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

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


* @author Michael Zhou
* @see XmlWebApplicationContext
*/
public class ResourceLoadingXmlWebApplicationContext extends XmlWebApplicationContext {
    public ResourceLoadingXmlWebApplicationContext() {
        setResourceLoadingExtender(new ResourceLoadingSupport(this));
    }
View Full Code Here


     */
    public ResourceLoadingXmlApplicationContext(Resource resource, ApplicationContext parentContext)
            throws BeansException {
        super(parentContext);
        this.configResource = resource;
        setResourceLoadingExtender(new ResourceLoadingSupport(this));
        refresh();
    }
View Full Code Here

     * </p>
     */
    public ResourceLoadingXmlApplicationContext(String[] configLocations, ApplicationContext parentContext) {
        super(parentContext);
        setConfigLocations(configLocations);
        setResourceLoadingExtender(new ResourceLoadingSupport(this));
        refresh();
    }
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

    private ResourceDataSource rds;

    @BeforeClass
    public static void initFactory() {
        factory = new XmlApplicationContext(new FileSystemResource(new File(srcdir, "services.xml")));
        factory.setResourceLoadingExtender(new ResourceLoadingSupport(factory));
    }
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

    }

    @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

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.