You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Keith Byrne <ka...@gmail.com> on 2008/02/15 16:27:06 UTC

Adding custom attributes in a unit test

I'm using ApacheDS 1.5.1.   I have a unit test that extends
AbstractServerTest.

I need to add a couple of custom attributes in order to simulate Active
Directory (don't ask) in a programmatic way within the unit test.

The documentation that I've found seems to be outdated, how can I easily
accomplish this?

Or is there a way to disable schema checking? Since this won't be a live
ldap server I really don't care about validation.

Thanks.

Re: Adding custom attributes in a unit test

Posted by Emmanuel Lecharny <el...@gmail.com>.
Keith Byrne wrote:
> I'm using ApacheDS 1.5.1.   I have a unit test that extends
> AbstractServerTest.
>
> I need to add a couple of custom attributes in order to simulate Active
> Directory (don't ask) 
You are not the only one doing that :)
> in a programmatic way within the unit test.
>
> The documentation that I've found seems to be outdated, how can I easily
> accomplish this?
>   
Doco is badly outdated... Sorry for that !

Have you tried :
http://java.sun.com/products/jndi/tutorial/ldap/schema/attribute.html ?

There is a paragraph describing how to add a new AttributeType using 
JNDI. It should work, as ADS is using JNDI as a abstraction layer.


> Or is there a way to disable schema checking? Since this won't be a live
> ldap server I really don't care about validation.
>   
Nope, schema checking is kind of mandatory atm.

Thanks for using ADS !

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org