}
public void testAddExistingSchemasToPool() throws Exception
{
Schema sc1 = new Schema( "ressources/schemas/apache.schema", Schema.SchemaType.coreSchema ); //$NON-NLS-1$
Schema sc2 = new Schema( "ressources/schemas/core.schema", Schema.SchemaType.coreSchema ); //$NON-NLS-1$
Schema sc3 = new Schema( "ressources/schemas/cosine.schema", Schema.SchemaType.coreSchema ); //$NON-NLS-1$
Schema sc4 = new Schema( "ressources/schemas/misc.schema", Schema.SchemaType.coreSchema ); //$NON-NLS-1$
pool.addSchemas( new Schema[]
{ sc1, sc2, sc3, sc4 } );
assertTrue( pool.containsSchema( sc1 ) );
assertTrue( pool.containsSchema( sc2 ) );
assertTrue( pool.containsSchema( sc3 ) );
assertTrue( pool.containsSchema( sc4 ) );
Hashtable<String, ObjectClass> objectClasses = pool.getObjectClassesAsHashTableByName();
Hashtable<String, AttributeType> attributeTypes = pool.getAttributeTypesAsHashTableByName();
AttributeType[] sc1AT = sc1.getAttributeTypesAsArray();
for ( AttributeType type : sc1AT )
{
assertTrue( attributeTypes.containsValue( type ) );
}
AttributeType[] sc2AT = sc2.getAttributeTypesAsArray();
for ( AttributeType type : sc2AT )
{
assertTrue( attributeTypes.containsValue( type ) );
}
AttributeType[] sc3AT = sc3.getAttributeTypesAsArray();
for ( AttributeType type : sc3AT )
{
assertTrue( attributeTypes.containsValue( type ) );
}
AttributeType[] sc4AT = sc4.getAttributeTypesAsArray();
for ( AttributeType type : sc4AT )
{
assertTrue( attributeTypes.containsValue( type ) );
}