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")));
        pullService = (PullServiceImpl) factory.getBean("pullService");
        tools = getFieldValue(pullService, "tools", Map.class);
        prePulledTools = getFieldValue(pullService, "prePulledTools", Map.class);
    }
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

        assertEquals("http:///ccc/ddd?a=1&b=+#ref2", broker.render());
    }

    @Test
    public void config() {
        ApplicationContext factory = new XmlApplicationContext(new FileSystemResource(new File(srcdir,
                                                                                               "services-uris.xml")));

        URIBrokerService uris = (URIBrokerService) factory.getBean("uris");

        TurbineContentURIBroker link1 = (TurbineContentURIBroker) uris.getURIBroker("tclink4");
        assertEquals("http://taobao.com/mycontext/mycomponent/myprefix/mycontent.jpg?a=1&b=2", link1.toString());

        TurbineContentURIBroker link2 = (TurbineContentURIBroker) uris.getURIBroker("tclink5");
View Full Code Here

        assertEquals("action", broker.getActionParam());
    }

    @Test
    public void config_withMappings() {
        ApplicationContext factory = new XmlApplicationContext(new FileSystemResource(new File(srcdir,
                                                                                               "services-uris.xml")));

        URIBrokerService uris = (URIBrokerService) factory.getBean("uris");

        URIBroker link1 = uris.getURIBroker("link1");
        assertEquals("http://taobao.com/hello", link1.toString());

        TurbineURIBroker link2 = (TurbineURIBroker) uris.getURIBroker("link2");
        assertSame(factory.getBean("mappingRuleService"), link2.getMappingRuleService());
        assertEquals("http://taobao.com/mycontext/myservlet/mycomponent/my_target.htm?action=myAction",
                     link2.toString());

        TurbineURIBroker link3 = (TurbineURIBroker) uris.getURIBroker("link3");
        assertSame(factory.getBean("mapping2"), link3.getMappingRuleService());
        assertEquals("http://taobao.com/mycontext/myservlet/mycomponent/myTarget.vhtml?myaction=myAction",
                     link3.toString());
    }
View Full Code Here

                     link3.toString());
    }

    @Test
    public void config_withoutMappings() {
        ApplicationContext factory = new XmlApplicationContext(new FileSystemResource(new File(srcdir,
                                                                                               "services-uris-no-mappings.xml")));

        URIBrokerService uris = (URIBrokerService) factory.getBean("uris");

        URIBroker link1 = uris.getURIBroker("link1");
        assertEquals("http://taobao.com/hello", link1.toString());

        TurbineURIBroker link2 = (TurbineURIBroker) uris.getURIBroker("link2");
View Full Code Here

    @BeforeClass
    public static void init() {
        System.setProperty("skipValidation", "true");

        try {
            appContext = new XmlApplicationContext(new FileSystemResource(new File(srcdir, "beans-default-values.xml")));
        } finally {
            System.clearProperty("skipValidation");
        }

        factory = (DefaultListableBeanFactory) appContext.getAutowireCapableBeanFactory();
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

    private        AbstractSerializationEncoder encoder;
    private        boolean                      skipEncoding;

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

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

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

public class ContributionDecoratorTests {
    private static XmlApplicationContext factory;

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