Skip to content
Permalink
Browse files
Fixed missing assignment of schemaManager in Ava (+test)
  • Loading branch information
semancik committed Feb 25, 2022
1 parent 1755fa3 commit 76f4895b55d839806050ec5f11d5a779a8135b17
Showing 2 changed files with 27 additions and 4 deletions.
@@ -1246,13 +1246,13 @@ public void testStringParser() throws Exception


/**
* Class to test for void LdapName(String)
* Class to test for Dn(String)
*
* @throws Exception
* if anything goes wrong.
*/
@Test
public void testLdapNameString() throws Exception
public void testDnString() throws Exception
{
Dn name = new Dn( "" );
Dn name50 = new Dn();
@@ -1280,12 +1280,34 @@ public void testLdapNameString() throws Exception
assertNotSame( name2, name5 );
}

/**
* Class to test for Dn(SchemaManager, String)
*
* @throws Exception
* if anything goes wrong.
*/
@Test
public void testDnStringSchemaAware() throws Exception
{

Dn dnPeople = new Dn( schemaManager, "ou=People,dc=example,dc=com" );
Dn dnPeopleCase = new Dn( schemaManager, "ou=people,dc=ExAmPLE,dc=COM" );
Dn dnJack = new Dn( schemaManager, "uid=jack,ou=People,dc=example,dc=com" );

assertEquals( dnPeople, dnPeopleCase );
assertTrue( dnPeople.isAncestorOf( dnJack ) );
assertTrue( dnPeopleCase.isAncestorOf( dnJack ) );
assertTrue( dnJack.isDescendantOf( dnPeople ) );
assertTrue( dnJack.isDescendantOf( dnPeopleCase ) );
assertNotSame( dnPeople, dnJack );
}


/**
* Class to test for void LdapName()
* Class to test for Dn()
*/
@Test
public void testLdapName()
public void testDn()
{
Dn name = new Dn();
assertTrue( name.toString().equals( "" ) );
@@ -133,6 +133,7 @@ public Ava( SchemaManager schemaManager )
public Ava( SchemaManager schemaManager, Ava ava ) throws LdapInvalidDnException
{
upType = ava.upType;
this.schemaManager = schemaManager;

if ( ava.isSchemaAware() )
{

0 comments on commit 76f4895

Please sign in to comment.