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