Package com.alibaba.citrus.springext

Examples of com.alibaba.citrus.springext.Contribution


    @Test(expected = IllegalArgumentException.class)
    public void getCp_Name_notFound() throws Exception {
        createConfigurationPoints("TEST-INF/test6/cps");
        ConfigurationPointImpl cp = (ConfigurationPointImpl) cps.getConfigurationPointByName("cp1");
        Contribution contrib = cp.getContributions().iterator().next();

        SpringExtUtil.getSiblingConfigurationPoint("not-found", contrib);
    }
View Full Code Here


    @Test
    public void test6_getCp() throws Exception {
        createConfigurationPoints("TEST-INF/test6/cps");
        ConfigurationPointImpl cp = (ConfigurationPointImpl) cps.getConfigurationPointByName("cp1");
        Contribution contrib = cp.getContributions().iterator().next();

        assertSame(cp, SpringExtUtil.getSiblingConfigurationPoint("cp1", contrib));
    }
View Full Code Here

    @Test
    public void unqualifiedStyleContribution() throws Exception {
        cps = new ConfigurationPointsImpl((ClassLoader) null, null);

        ConfigurationPoint cp1 = cps.getConfigurationPointByName("my/cp1");
        Contribution contrib1 = cp1.getContribution("test1", BEAN_DEFINITION_PARSER);
        Schema schema = contrib1.getSchemas().getMainSchema();

        // my/cp1/test1.xsd包含elementFormDefault,转换后被强制去除。
        assertQualified(schema, false);
    }
View Full Code Here

                }
            }
        });

        ConfigurationPoint cp1 = cps.getConfigurationPointByName("my/cp1");
        Contribution contrib1 = cp1.getContribution("test1", BEAN_DEFINITION_PARSER);
        Schema schema = contrib1.getSchemas().getMainSchema();

        // my/cp1/test1.xsd包含elementFormDefault。此处摸拟老版本,故qualified被保留。
        assertQualified(schema, true);
    }
View Full Code Here

        assertEquals(6, cp.getContributions().size());
        assertSame(cps, cp.getConfigurationPoints());

        Iterator<Contribution> i = cp.getContributions().iterator();
        Contribution contrib;

        // cp1:my1, MyBeanDefinitionParser
        contrib = i.next();
        MyBeanDefinitionParser c1 = getContributionImplementation(cp, BEAN_DEFINITION_PARSER, "my1",
                                                                  MyBeanDefinitionParser.class);

        assertNotNull(c1);

        // cp1:my1, MyBeanDefinitionDecorator
        contrib = i.next();
        MyBeanDefinitionDecorator c2 = getContributionImplementation(cp, BEAN_DEFINITION_DECORATOR, "my1",
                                                                     MyBeanDefinitionDecorator.class);

        assertNotNull(c2);
        assertSame(cp, contrib.getConfigurationPoint());

        // cp1:my1, MyBeanDefinitionDecorator
        contrib = i.next();
        MyBeanDefinitionDecorator c3 = getContributionImplementation(cp, BEAN_DEFINITION_DECORATOR_FOR_ATTRIBUTE,
                                                                     "my1", MyBeanDefinitionDecorator.class);

        assertNotNull(c3);
        assertSame(cp, contrib.getConfigurationPoint());

        // cp1:my2, MyBeanDefinitionParser2
        contrib = i.next();
        MyBeanDefinitionParser2 c4 = getContributionImplementation(cp, BEAN_DEFINITION_PARSER, "my2",
                                                                   MyBeanDefinitionParser2.class);

        assertSame(contrib, c4.getContribution());
        assertSame(cp, contrib.getConfigurationPoint());

        // cp1:my2, MyBeanDefinitionDecorator2
        contrib = i.next();
        MyBeanDefinitionDecorator2 c5 = getContributionImplementation(cp, BEAN_DEFINITION_DECORATOR, "my2",
                                                                      MyBeanDefinitionDecorator2.class);

        assertSame(contrib, c5.getContribution());
        assertSame(cp, contrib.getConfigurationPoint());

        // cp1:my2, MyBeanDefinitionDecorator2
        contrib = i.next();
        MyBeanDefinitionDecorator2 c6 = getContributionImplementation(cp, BEAN_DEFINITION_DECORATOR_FOR_ATTRIBUTE,
                                                                      "my2", MyBeanDefinitionDecorator2.class);

        assertSame(contrib, c6.getContribution());
        assertSame(cp, contrib.getConfigurationPoint());
    }
View Full Code Here

    @Test
    public void getAnnotation() {
        createConfigurationPoints("TEST-INF/test9/cps");

        ConfigurationPoint cp = cps.getConfigurationPointByName("my/services");
        Contribution service1 = cp.getContribution("service1", ContributionType.BEAN_DEFINITION_PARSER);
        Contribution service2 = cp.getContribution("service2", ContributionType.BEAN_DEFINITION_PARSER);

        assertEquals("this\n" +
                     "is\n" +
                     "service1", service1.getAnnotation());

        assertEquals(null, service2.getAnnotation());
    }
View Full Code Here

    public void test2_NoClass() throws Exception {
        createConfigurationPoints("TEST-INF/test2/cps");

        // quietly failed
        ConfigurationPoint cp = cps.getConfigurationPointByName("cp1");
        Contribution contrib = cp.getContribution("no-class", BEAN_DEFINITION_PARSER);

        try {
            instantiateContributionImplementation(cp, contrib);
            fail();
        } catch (FatalBeanException e) {
View Full Code Here

    public void test2_ClassNotFound() throws Exception {
        createConfigurationPoints("TEST-INF/test2/cps");

        // quietly failed
        ConfigurationPoint cp = cps.getConfigurationPointByName("cp1");
        Contribution contrib = cp.getContribution("not-exist-class", BEAN_DEFINITION_PARSER);

        try {
            instantiateContributionImplementation(cp, contrib);
            fail();
        } catch (FatalBeanException e) {
View Full Code Here

    public void test2_WrongClass_beanDefinitionParsers() throws Exception {
        createConfigurationPoints("TEST-INF/test2/cps");

        // quietly failed
        ConfigurationPoint cp = cps.getConfigurationPointByName("cp1");
        Contribution contrib = cp.getContribution("wrong-class", BEAN_DEFINITION_PARSER);

        try {
            instantiateContributionImplementation(cp, contrib);
            fail();
        } catch (FatalBeanException e) {
View Full Code Here

    public void test2_WrongClass_beanDefinitionDecorators() throws Exception {
        createConfigurationPoints("TEST-INF/test2/cps");

        // quietly failed
        ConfigurationPoint cp = cps.getConfigurationPointByName("cp1");
        Contribution contrib = cp.getContribution("wrong-class", BEAN_DEFINITION_DECORATOR);

        try {
            instantiateContributionImplementation(cp, contrib);
            fail();
        } catch (FatalBeanException e) {
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.springext.Contribution

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.