Package com.alibaba.citrus.springext

Examples of com.alibaba.citrus.springext.ConfigurationPoint


    @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

    @Test
    public void test12_contributionSchemas_versionRecognition() {
        createConfigurationPoints("TEST-INF/test12/cps");

        ConfigurationPoint cp = cps.getConfigurationPointByName("my/services");
        assertEquals(3, cp.getContributions().size());

        Contribution myservice = cp.getContribution("myservice", BEAN_DEFINITION_PARSER);
        Contribution myservice_abc = cp.getContribution("myservice-abc", BEAN_DEFINITION_PARSER);
        Contribution myservice_abc_xyz = cp.getContribution("myservice-abc-xyz", BEAN_DEFINITION_DECORATOR);

        assertThat(myservice.getSchemas().toString(),
                   containsAll("Schemas[my/services/myservice.xsd, 0 versioned schemas]"));

        assertThat(
View Full Code Here

    public void test1_getConfigurationPointByName() {
        createConfigurationPoints("TEST-INF/test1/cps");

        assertNull(cps.getConfigurationPointByName(null)); // no NPE

        ConfigurationPoint cp = cps.getConfigurationPointByName("cp1");
        assertThat(cp.toString(), containsString("cp1=http://www.alibaba.com/test1/cp1"));

        cp = cps.getConfigurationPointByName("cp2");
        assertThat(cp.toString(), containsString("cp2=http://www.alibaba.com/test1/cp2"));
    }
View Full Code Here

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

        assertNull(cps.getConfigurationPointByNamespaceUri(null)); // no NPE
        assertNull(cps.getConfigurationPointByNamespaceUri("http://www.alibaba.com/test1/cp3")); // invalid and ignored

        ConfigurationPoint cp = cps.getConfigurationPointByNamespaceUri("http://www.alibaba.com/test1/cp1");
        assertThat(cp.toString(), containsString("cp1=http://www.alibaba.com/test1/cp1"));

        cp = cps.getConfigurationPointByNamespaceUri("http://www.alibaba.com/test1/cp2");
        assertThat(cp.toString(), containsString("cp2=http://www.alibaba.com/test1/cp2"));
    }
View Full Code Here

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

        ConfigurationPoint cp = cps.getConfigurationPointByName("cp1");
        assertThat(cp.toString(), containsString("cp1=http://www.alibaba.com/test1/cp1"));

        cp = cps.getConfigurationPointByName("cp2");
        assertThat(cp.toString(), containsString("cp2=http://www.alibaba.com/test1/cp2"));
    }
View Full Code Here

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

        ConfigurationPoint cp = cps.getConfigurationPointByNamespaceUri("http://www.alibaba.com/test1/cp1");
        assertThat(cp.toString(), containsString("cp1=http://www.alibaba.com/test1/cp1"));

        cp = cps.getConfigurationPointByNamespaceUri("http://www.alibaba.com/test1/cp2");
        assertThat(cp.toString(), containsString("cp2=http://www.alibaba.com/test1/cp2"));
    }
View Full Code Here

    @Test
    public void expandConfigurationPointElements() throws Exception {
        createConfigurationPoints(null);

        ConfigurationPoint cp1 = cps.getConfigurationPointByName("my/cp1");
        ConfigurationPoint cp2 = cps.getConfigurationPointByName("my/cp2");

        String test1 = getSchemaText(cp1.getContribution("test1", BEAN_DEFINITION_PARSER));
        String test2 = getSchemaText(cp1.getContribution("test2", BEAN_DEFINITION_PARSER));
        String test3 = getSchemaText(cp2.getContribution("test3", BEAN_DEFINITION_PARSER));
        String test4 = getSchemaText(cp2.getContribution("test4", BEAN_DEFINITION_PARSER));

        // 假如ns已经import了,确保不重复import;确保不import自己所在的cp。
        assertSchemaText(test1, 1);
        assertSchemaText(test2, 2);
        assertSchemaText(test3, 3);
View Full Code Here

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

        ConfigurationPoint cp = cps.getConfigurationPointByName("cp1");

        assertTrue(cp.getContributions().isEmpty());
    }
View Full Code Here

    @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

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.