Package com.alibaba.citrus.springext

Examples of com.alibaba.citrus.springext.ConfigurationPoint


    @Test
    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


    @Test
    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

    @Test
    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

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

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

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

    @Test
    public void test1_configurationPoint_noContributions() throws IOException {
        createConfigurationPoints("TEST-INF/test1/cps");

        ConfigurationPoint cp = cps.getConfigurationPointByName("cp1");
        VersionableSchemas schemas = cp.getSchemas();

        String str = schemas.toString();

        System.out.println("--");
        System.out.println(str);
View Full Code Here

    @Test
    public void test6_configurationPoint_noContributionSchemas() throws IOException {
        createConfigurationPoints("TEST-INF/test6/cps");

        ConfigurationPoint cp = cps.getConfigurationPointByName("cp1");
        VersionableSchemas schemas = cp.getSchemas();

        String str = schemas.toString();

        System.out.println("--");
        System.out.println(str);
View Full Code Here

    @Test
    public void test7_configurationPoint_nestedName_noContributionSchemas() throws IOException {
        createConfigurationPoints("TEST-INF/test7/cps");

        ConfigurationPoint cp = cps.getConfigurationPointByName("dir/cp1");
        VersionableSchemas schemas = cp.getSchemas();

        String str = schemas.toString();

        System.out.println("--");
        System.out.println(str);
View Full Code Here

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

        ConfigurationPoint cp = cps.getConfigurationPointByName("my/services");
        VersionableSchemas schemas = cp.getSchemas();

        // cp - main schema
        Schema mainSchema = schemas.getMainSchema();

        assertEquals("http://www.alibaba.com/my/services", mainSchema.getTargetNamespace());
        assertEquals("svc", mainSchema.getNamespacePrefix()); // cps定义中指定了nsPrefix

        // cp - version 1.0 schema
        Schema versionedSchema_10 = schemas.getVersionedSchema("1.0");

        assertEquals("http://www.alibaba.com/my/services", versionedSchema_10.getTargetNamespace());
        assertEquals("svc", versionedSchema_10.getNamespacePrefix()); // cps定义中指定了nsPrefix

        // cp - version 2.0 schema
        Schema versionedSchema_20 = schemas.getVersionedSchema("2.0");

        assertEquals("http://www.alibaba.com/my/services", versionedSchema_20.getTargetNamespace());
        assertEquals("svc", versionedSchema_20.getNamespacePrefix()); // cps定义中指定了nsPrefix

        // cp - main schema, no nsPrefix specified
        cp = cps.getConfigurationPointByName("my/plugins");
        schemas = cp.getSchemas();
        mainSchema = schemas.getMainSchema();

        assertEquals("http://www.alibaba.com/my/plugins", mainSchema.getTargetNamespace());
        assertEquals("plugins", mainSchema.getNamespacePrefix()); // 根据targetNamespace生成
    }
View Full Code Here

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

        ConfigurationPoint cp = cps.getConfigurationPointByName("my/services");
        VersionableSchemas schemas = cp.getSchemas();

        // schemas to string
        String str = schemas.toString();

        System.out.println("--");
View Full Code Here

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

        ConfigurationPoint cp = cps.getConfigurationPointByName("my/services");
        Iterator<Contribution> i = cp.getContributions().iterator();

        // contrib1 - schemas to string
        Contribution contrib = i.next();
        VersionableSchemas schemas = contrib.getSchemas();
        String str = schemas.toString();
View Full Code Here

TOP

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

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.