Hi Martin, This is what I am using at the top of my unit tests... maybe of help to you...
@RunWith(FrameworkRunner.class) @CreateLdapServer( transports = { @CreateTransport(protocol = "LDAP", port = 1024) }) @CreateDS( name="ldapDS", partitions = { @CreatePartition( name = "testdomain", suffix = "dc=testdomain,dc=co,dc=nz", contextEntry = @ContextEntry( entryLdif = "dn: dc=testdomain,dc=co,dc=nz\n" + "dc: testdomain\n" + "objectClass: top\n" + "objectClass: domain\n\n" + "dn: ou=People,dc=testdomain,dc=co,dc=nz\n" + "objectClass: organizationalUnit\n" + "objectClass: top\n" + "ou: people\n" + "description: Contains entries which describe persons\n\n" + "dn: ou=Groups,dc=testdomain,dc=co,dc=nz\n" + "objectClass: organizationalUnit\n" + "objectClass: top\n" + "ou: groups\n" + "description: Contains groups\n\n" + "dn: ou=Disabled,dc=testdomain,dc=co,dc=nz\n" + "objectClass: organizationalUnit\n" + "objectClass: top\n" + "ou: disabled\n" + "description: Contains disabled people\n\n" ), indexes = { @CreateIndex( attribute = "objectClass", cacheSize = 1000 ), @CreateIndex( attribute = "sn", cacheSize = 1000 ), @CreateIndex( attribute = "cn", cacheSize = 1000 ) } ) }, enableChangeLog = false ) public class LdapConnectorTest extends AbstractLdapTestUnit { -- Paul Edwards ________________________________________ From: m...@stefan-seelmann.de [m...@stefan-seelmann.de] On Behalf Of Stefan Seelmann [seelm...@apache.org] Sent: Wednesday, 11 August 2010 10:51 p.m. To: users@directory.apache.org Subject: Re: Add a schema to embedded Apache DS Hi Martin, Do you have the schema as OpenLDAP *.schema file? In that case you can use Studio's Schema Editor to import the *.schema file [1] and export it in ApacheDS format [2]. Kind Regards, Stefan [1] http://directory.apache.org/studio/static/users_guide/schema_editor/tasks_importing_schemas_from_openldap_files.html [2] http://directory.apache.org/studio/static/users_guide/schema_editor/tasks_exporting_schemas_for_apache_ds.html On Wed, Aug 11, 2010 at 2:23 PM, <martin.goldh...@uis.no> wrote: > Here is the LDIF file that was dropped by the mailer. > > > # > ====================================================================================================================================== > # > # File: eduOrg.ldf > # Version: 200210 > # > # This file should be imported with the following command while logged in > to the Domain Controller as an Admin User: > # ldifde -i -f eduPerson.adschema.ldif -v -j <PATH TO LOGFILES> > # > # REMEMBER TO SEARCH AND REPLACE DC=X WITH YOUR DC SUFFIX > # > # > ======================================================================================================================================= > > # ================================================================== > # Attributes > # ================================================================== > > dn: CN=eduOrgHomePageURI,ou=schema > changetype: ntdsschemaadd > objectClass: top > objectClass: metaSchema > cn: eduOrgHomePageURI > lDAPDisplayName: eduOrgHomePageURI > adminDisplayName: eduOrgHomePageURI > adminDescription: eduOrg per Internet2 and EDUCAUSE > attributeID: 1.3.6.1.4.1.5923.1.2.1.2 > attributeSyntax: 2.5.5.12 > oMSyntax: 64 > isSingleValued: FALSE > searchFlags: 0 > showInAdvancedViewOnly: TRUE > systemOnly: FALSE > > #dn: ou=objectClasses,CN=eduOrgHomePageURI,ou=schema > #changetype: ntdsschemaadd > #objectClass: top > #objectClass: organizationalUnit > #ou: objectClasses > > dn: CN=eduOrgIdentityAuthNPolicyURI,ou=schema > changetype: ntdsschemaadd > objectClass: top > objectClass: metaSchema > cn: eduOrgIdentityAuthNPolicyURI > lDAPDisplayName: eduOrgIdentityAuthNPolicyURI > adminDisplayName: eduOrgIdentityAuthNPolicyURI > adminDescription: eduOrg per Internet2 and EDUCAUSE > attributeID: 1.3.6.1.4.1.5923.1.2.1.3 > attributeSyntax: 2.5.5.12 > oMSyntax: 64 > isSingleValued: FALSE > searchFlags: 0 > showInAdvancedViewOnly: TRUE > systemOnly: FALSE > > dn: CN=eduOrgLegalName,ou=schema > changetype: ntdsschemaadd > objectClass: top > objectClass: metaSchema > cn: eduOrgLegalName > lDAPDisplayName: eduOrgLegalName > adminDisplayName: eduOrgLegalName > adminDescription: eduOrg per Internet2 and EDUCAUSE > attributeID: 1.3.6.1.4.1.5923.1.2.1.4 > attributeSyntax: 2.5.5.12 > oMSyntax: 64 > isSingleValued: FALSE > searchFlags: 0 > showInAdvancedViewOnly: TRUE > systemOnly: FALSE > > dn: CN=eduOrgSuperiorURI,ou=schema > changetype: ntdsschemaadd > objectClass: top > objectClass: metaSchema > cn: eduOrgSuperiorURI > lDAPDisplayName: eduOrgSuperiorURI > adminDisplayName: eduOrgSuperiorURI > adminDescription: eduOrg per Internet2 and EDUCAUSE > attributeID: 1.3.6.1.4.1.5923.1.2.1.5 > attributeSyntax: 2.5.5.12 > oMSyntax: 64 > isSingleValued: FALSE > searchFlags: 0 > showInAdvancedViewOnly: TRUE > systemOnly: FALSE > > dn: CN=eduOrgWhitePagesURI,ou=schema > changetype: ntdsschemaadd > objectClass: top > objectClass: metaSchema > cn: eduOrgWhitePagesURI > lDAPDisplayName: eduOrgWhitePagesURI > adminDisplayName: eduOrgWhitePagesURI > adminDescription: eduOrg per Internet2 and EDUCAUSE > attributeID: 1.3.6.1.4.1.5923.1.2.1.6 > attributeSyntax: 2.5.5.12 > oMSyntax: 64 > isSingleValued: FALSE > searchFlags: 0 > showInAdvancedViewOnly: TRUE > systemOnly: FALSE > > #dn: > #changetype: modify > #add: schemaUpdateNow > #schemaUpdateNow: 1 > #- > > > # ================================================================== > # Object classes > # ================================================================== > > dn: m-oid=1.3.6.1.4.1.5923.1.2.2,ou=objectclasses,CN=other,ou=schema > changetype: ntdsschemaadd > objectClass: metaObjectClass > m-name: eduOrg > m-description: Supplementary attributes for an educational organization > m-oid: 1.3.6.1.4.1.5923.1.2.2 > m-subobjectclass: top > m-typeobjectclass: AUXILIARY > m-may: eduOrgHomePageURI > m-may: eduOrgIdentityAuthNPolicyURI > m-may: eduOrgLegalName > m-may: eduOrgSuperiorURI > m-may: eduOrgWhitePagesURI > > #dn: > #changetype: modify > #add: schemaUpdateNow > #schemaUpdateNow: 1 > #- > > dn: CN=User,ou=schema > changetype: modify > add: auxiliaryClass > auxiliaryClass: eduOrg > - > > #dn: > #changetype: modify > #add: schemaUpdateNow > #schemaUpdateNow: 1 > #- > > > > > > Emmanuel Lecharny <elecha...@gmail.com> > 11.08.2010 14:00 > Please respond to > users@directory.apache.org > > > To > users@directory.apache.org > cc > > Subject > Re: Add a schema to embedded Apache DS > > > > > > > Sadly, attachements are not going through the mailer, so we don't have > the modified schema (LDIF format). > > Can you put it onto some site like http://pastebin.com/ ? > > On 8/11/10 1:37 PM, martin.goldh...@uis.no wrote: >> Hi! >> I run Apache 1.5.6 with the FrameworkRunner in junit 4.7. >> I have trouble adding a new schema to the LDAP server. >> I fetched a schema from http://www.feide.no/ldap-schema-feide. Bu these >> are provided for OpenLDAP. >> The schema is added with the @ApplyLdifFiles annotation >> I figured I had to change some attributes. I got as far as adding object >> classes to the schema, but then it complains that the schema is not >> defined. >> >> Here is my modified schema. >> The original schema can be downloaded from >> > http://www.feide.no/sites/feide.no/files/documents/noreduperson-1_5-openldap.ldif > >> >> -- >> Regards >> Martin Goldhahn >> Systems Developer >> University of Stavanger, IT Department >> phone: +47-518 31065 > > > -- > Regards, > Cordialement, > Emmanuel Lécharny > www.iktek.com > > > >