String schemaDirectory = SchemaConfigManager.getSchemaDirectoryPath(true);
SchemaTestMatchingRule matchingRule1 =
new SchemaTestMatchingRule("testAddMultipleValidSchemaFiles1Match",
"1.3.6.1.4.1.26027.1.999.24");
DirectoryServer.registerMatchingRule(matchingRule1, false);
String[] fileLines1 =
{
"dn: cn=schema",
"objectClass: top",
"objectClass: ldapSubentry",
"objectClass: subschema",
"attributeTypes: ( testaddmultiplevalidschemafiles1at-oid " +
"NAME 'testAddMultipleValidSchemaFiles1AT' )",
"objectClasses: ( testaddmultiplevalidschemafiles1oc-oid " +
"NAME 'testAddMultipleValidSchemaFiles1OC' STRUCTURAL " +
"MUST testAddMultipleValidSchemaFiles1AT )",
"nameForms: ( testaddmultiplevalidschemafiles1nf-oid " +
"NAME 'testAddMultipleValidSchemaFiles1NF' " +
"OC testAddMultipleValidSchemaFiles1OC " +
"MUST testAddMultipleValidSchemaFiles1AT )",
"dITContentRules: ( testaddmultiplevalidschemafiles1oc-oid " +
"NAME 'testAddMultipleValidSchemaFiles1DCR' MAY description )",
"dITStructureRules: ( 999017 " +
"NAME 'testAddMultipleValidSchemaFiles1DSR' " +
"FORM testAddMultipleValidSchemaFiles1NF )",
"matchingRuleUse: ( 1.3.6.1.4.1.26027.1.999.24 " +
"NAME 'testAddMultipleValidSchemaFiles1MRU' " +
"APPLIES testAddMultipleValidSchemaFiles1AT )"
};
File validFile1 = new File(schemaDirectory, "05-multiple-valid-1.ldif");
BufferedWriter writer1 = new BufferedWriter(new FileWriter(validFile1));
for (String line : fileLines1)
{
writer1.write(line);
writer1.newLine();
}
writer1.close();
SchemaTestMatchingRule matchingRule2 =
new SchemaTestMatchingRule("testAddMultipleValidSchemaFiles2Match",
"1.3.6.1.4.1.26027.1.999.25");
DirectoryServer.registerMatchingRule(matchingRule2, false);
String[] fileLines2 =
{