Examples of VersionableSchemas


Examples of com.alibaba.citrus.springext.VersionableSchemas

    @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("--");
        System.out.println(str);

        assertThat(
                str,
                containsAll(
                        "Schemas[my-services.xsd, targetNamespace=http://www.alibaba.com/my/services, 2 versioned schemas]",
                        "version 1.0: Schema[name=my-services-1.0.xsd, version=1.0, targetNamespace=http://www.alibaba.com/my/services, source=generated-content]",
                        "version 2.0: Schema[name=my-services-2.0.xsd, version=2.0, targetNamespace=http://www.alibaba.com/my/services, source=generated-content]"));

        // cp - main schema
        String content = schemas.getMainSchema().getText();

        System.out.println("--");
        System.out.println(content);

        assertThat(
                content,
                containsAll("xmlns=\"http://www.alibaba.com/my/services\"",
                            "targetNamespace=\"http://www.alibaba.com/my/services\"", "elementFormDefault=\"qualified\""));
        assertThat(
                content,
                containsAll("<xsd:include", "schemaLocation=\"my/services/service1.xsd\"",
                            "schemaLocation=\"my/services/service2.xsd\"", "schemaLocation=\"my/services/service3.xsd\""));

        // cp - version 1.0 schema
        content = schemas.getVersionedSchema("1.0").getText();

        System.out.println("--");
        System.out.println(content);

        assertThat(
                content,
                containsAll("xmlns=\"http://www.alibaba.com/my/services\"",
                            "targetNamespace=\"http://www.alibaba.com/my/services\"", "elementFormDefault=\"qualified\""));
        assertThat(
                content,
                containsAll("<xsd:include", "schemaLocation=\"my/services/service1-1.0.xsd\"",
                            "schemaLocation=\"my/services/service2.xsd\"", "schemaLocation=\"my/services/service3.xsd\""));

        // cp - version 2.0 schema
        content = schemas.getVersionedSchema("2.0").getText();

        System.out.println("--");
        System.out.println(content);

        assertThat(
View Full Code Here

Examples of com.alibaba.citrus.springext.VersionableSchemas

        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();

        System.out.println("--");
        System.out.println(str);

        assertThat(
                str,
                containsAll("Schemas[my/services/service1.xsd, 1 versioned schemas]",
                            "version 1.0: Schema[name=my/services/service1-1.0.xsd, version=1.0, source=",
                            "my/services/service1-1.0.xsd]"));

        // contrib1 - main schema to string
        String content = schemas.getMainSchema().getText();
        assertThat(content, containsString("service1-main"));

        // contrib1 - version 1.0 schema to string
        content = schemas.getVersionedSchema("1.0").getText();
        assertThat(content, containsString("service1-1.0"));

        // contrib2 - schemas to string
        contrib = i.next();
        schemas = contrib.getSchemas();
        str = schemas.toString();

        System.out.println("--");
        System.out.println(str);

        assertThat(
                str,
                containsAll("Schemas[my/services/service2.xsd, 1 versioned schemas]",
                            "version 2.0: Schema[name=my/services/service2-2.0.xsd, version=2.0, source=",
                            "my/services/service2-2.0.xsd]"));

        // contrib2 - main schema to string
        content = schemas.getMainSchema().getText();
        assertThat(content, containsString("service2-main"));

        // contrib2 - version 2.0 schema to string
        content = schemas.getVersionedSchema("2.0").getText();
        assertThat(content, containsString("service2-2.0"));

        // contrib3 - schemas to string
        contrib = i.next();
        schemas = contrib.getSchemas();
        str = schemas.toString();

        System.out.println("--");
        System.out.println(str);

        assertThat(str, containsAll("Schemas[my/services/service3.xsd, 0 versioned schemas]"));

        // contrib3 - main schema to string
        content = schemas.getMainSchema().getText();
        assertThat(content, containsString("service3-main"));

        assertFalse(i.hasNext());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.