Skip to content
Permalink
Browse files
Fix for DIRAPI-349
  • Loading branch information
elecharny committed Jun 27, 2019
1 parent 14d6b44 commit f7529b6685226d35b668804a5c999b1f42c19cb9
Show file tree
Hide file tree
Showing 5 changed files with 758 additions and 683 deletions.
@@ -3129,4 +3129,31 @@ public void testDnParsingOneRdnPerf() throws LdapInvalidDnException
long t1 = System.currentTimeMillis();
System.out.println( "delta new 1 RDN : " + ( t1 - t0 ) );
}


/**
* test a simple Dn with hexString attribute value, schema aware
*/
@Test
public void testDnHexStringAttributeValueDSchemaAware() throws LdapException
{
Dn dn = new Dn( schemaManager, "uid = #4869" );

assertTrue( Dn.isValid( "uid = #4869" ) );
assertEquals( "uid=Hi", dn.getEscaped() );
assertEquals( "uid = #4869", dn.getName() );
assertEquals( "0.9.2342.19200300.100.1.1= hi ", dn.getNormName() );

// Now, create a new DN, not schema aware
Dn dn2 = new Dn( "UID = #4869" );
assertEquals( "UID=Hi", dn2.getEscaped() );
assertEquals( "UID = #4869", dn2.getName() );
assertEquals( "uid=Hi", dn2.getNormName() );

// Make it schemaAware
Dn dn3 = new Dn( schemaManager, dn2 );
assertEquals( "UID=Hi", dn3.getEscaped() );
assertEquals( "UID = #4869", dn3.getName() );
assertEquals( "0.9.2342.19200300.100.1.1= hi ", dn3.getNormName() );
}
}
@@ -359,9 +359,18 @@ relativeDistinguishedName [SchemaManager schemaManager, Rdn rdn]
val = currentAva.getValue();
if ( ( schemaManager == null ) && ( val != null ) && ( val.getNormalized() != null ) )
if ( ( schemaManager == null ) && ( val != null ) )
{
rdnNormStr.append( val.getNormalized() );
if ( val.getNormalized() != null )
{
rdnNormStr.append( val.getNormalized() );
}
else
{
// We can't tell if the value is HR or not.
// Use the Value User Provided value
rdnNormStr.append( val.getUpValue() );
}
}
}
(
@@ -391,9 +400,18 @@ relativeDistinguishedName [SchemaManager schemaManager, Rdn rdn]

val = currentAva.getValue();

if ( ( schemaManager == null ) &&( val != null ) && ( val.getNormalized() != null ) )
if ( ( schemaManager == null ) && ( val != null ) )
{
rdnNormStr.append( val.getNormalized() );
if ( val.getNormalized() != null )
{
rdnNormStr.append( val.getNormalized() );
}
else
{
// We can't tell if the value is HR or not.
// Use the Value User Provided value
rdnNormStr.append( val.getUpValue() );
}
}
}
)*

0 comments on commit f7529b6

Please sign in to comment.