connection.modify( dn, mod );
// Get back the list of attributes, and find the one we just added
updateSSSE();
Attribute attributeTypes = subschemaSubentry.get( "attributeTypes" );
AttributeType attributeType = null;
for ( Value<?> value : attributeTypes )
{
String desc = value.getString();
if ( desc.indexOf( "1.3.6.1.4.1.18060.0.4.0.2.10000" ) != -1 )
{
attributeType = ATTRIBUTE_TYPE_DESCRIPTION_SCHEMA_PARSER.parseAttributeTypeDescription( desc );
break;
}
}
assertNotNull( attributeType );
assertEquals( true, attributeType.isSingleValued() );
assertEquals( false, attributeType.isCollective() );
assertEquals( false, attributeType.isObsolete() );
assertEquals( true, attributeType.isUserModifiable() );
assertEquals( " ", attributeType.getDescription() );
assertEquals( "bogus", attributeType.getNames().get( 0 ) );
assertEquals( "bogusName", attributeType.getNames().get( 1 ) );
assertEquals( "name", attributeType.getSuperiorOid() );
// Now check that the entry has been added
Entry entry = connection.lookup(
"m-oid=1.3.6.1.4.1.18060.0.4.0.2.10000,ou=attributeTypes,cn=nis,ou=schema" );
assertNotNull( entry );
SchemaEntityFactory factory = new SchemaEntityFactory();
AttributeType at = factory.getAttributeType( getService().getSchemaManager(), entry, getService()
.getSchemaManager().getRegistries(), "nis" );
assertEquals( "1.3.6.1.4.1.18060.0.4.0.2.10000", at.getOid() );
assertEquals( "name", at.getSuperiorOid() );
assertEquals( " ", at.getDescription() );
assertEquals( "bogus", at.getNames().get( 0 ) );
assertEquals( "bogusName", at.getNames().get( 1 ) );
assertEquals( true, at.isUserModifiable() );
assertEquals( false, at.isCollective() );
assertEquals( false, at.isObsolete() );
assertEquals( true, at.isSingleValued() );
}