directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <elecha...@gmail.com>
Subject Re: embedding ApacheDS for tests uisng NIS schema
Date Tue, 18 Dec 2012 08:03:19 GMT
Le 12/18/12 8:32 AM, Kiran Ayyagari a écrit :
> try it this way
>
>   @Before
>  // simplest way to enable a schema in embedded mode
>   public void enableNis() throws Exception  {
>       if(!service.getSchemaManager().isEnabled( "nis" ))
>       {
>           service.getSchemaManager().enable( "nis" );
>       }
>   }
>
>   //that will work just fine
>   @Test
>   @ApplyLdifs( {
>           "dn: ou=groups,dc=mycompany,dc=com",
>           "objectClass: organizationalUnit",
>           "ou: groups",
>           "description: Groups"
>   }
>   )
>   public void authenticateAndAuthorizeFromDynamicGroup() throws Exception {
>       // operators group
>      // this needs to be added manually instead of adding using ApplyLdifs
>      Entry entry = new DefaultEntry(
> "cn=operators,ou=groups,dc=mycompany,dc=com",
>       "objectClass: posixGroup",
>       "cn: operators",
>       "gidNumber: 5000",
>       "description: Operators Group",
>       "objectClass: posixGroup",
>       "cn: operators",
>       "gidNumber: 5000",
>       "description: Operators Group");
>
>      LdapConnection connection = IntegrationUtils.getAdminConnection(
> service );
>      connection.add( entry );
>
>      assertTrue(connection.exists( entry.getDn() ));
>   }
>
> for some reason not yet clear to me FrameworkRunner is failing while adding
> the cn=operators entry  when present in ApplyLdifs

I'm wondering if the schemas should not be reloaded after having enabled
the NIS schema...

Anthony, I suggest you fill a JIRA asking for the creation of a special
annotation, solthing like @EnableSchema( <list of schema to enable> ) ad
@DisableSchema( <List of schema to disable> ).

That could be useful.

We will continue to investigate the reason the NIS schema is not enabled.



-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Mime
View raw message