Package com.alibaba.citrus.springext

Examples of com.alibaba.citrus.springext.ConfigurationPoint


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


    @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

        createConfigurationPoints("TEST-INF/test12/cps");

        Resource resource;

        // configuration point
        ConfigurationPoint cp1 = cps.getConfigurationPointByName("my/services");
        resource = assertSourceInfoAndGetResource(cp1, ConfigurationPointSourceInfo.class, null);
        assertResource("TEST-INF/test12/cps", resource);

        // configuration point schema
        Schema cp1Schema = cp1.getSchemas().getMainSchema();
        resource = assertSourceInfoAndGetResource(cp1Schema, ConfigurationPointSchemaSourceInfo.class, cp1);
        assertResource(null, resource);

        Schema cp1Schema2 = cp1.getSchemas().getVersionedSchema("2.0");
        resource = assertSourceInfoAndGetResource(cp1Schema2, ConfigurationPointSchemaSourceInfo.class, cp1);
        assertResource(null, resource);

        // contribution
        Contribution contrib1 = cp1.getContribution("myservice", ContributionType.BEAN_DEFINITION_PARSER);
        resource = assertSourceInfoAndGetResource(contrib1, ContributionSourceInfo.class, cp1);
        assertResource("TEST-INF/test12/my-services.bean-definition-parsers", resource);

        Contribution contrib2 = cp1.getContribution("myservice-abc-xyz", ContributionType.BEAN_DEFINITION_DECORATOR);
        resource = assertSourceInfoAndGetResource(contrib2, ContributionSourceInfo.class, cp1);
        assertResource("TEST-INF/test12/my-services.bean-definition-decorators", resource);

        // contribution schema
        Schema contrib1Schema = contrib1.getSchemas().getMainSchema();
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

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.