assertEquals( "Ex+mple", rdn.getUpValue().getString() );
assertEquals( "Ex+mple", rdn.getNormValue().getString() );
// The first ATAV
Ava atav = rdn.getAva();
assertEquals( " OU = Ex\\+mple ", atav.getUpName() );
assertEquals( "ou=Ex\\+mple", atav.getNormName() );
assertEquals( "ou", atav.getNormType() );
assertEquals( "OU", atav.getUpType() );
assertEquals( "Ex+mple", atav.getUpValue().get() );
assertEquals( "Ex+mple", atav.getNormValue().get() );
assertEquals( 2, rdn.getNbAtavs() );
// The second ATAV
for ( Ava ava : rdn )
{
if ( "Ex+mple".equals( ava.getNormValue().get() ) )
{
// Skip the first one
continue;
}
assertEquals( " ou = T\\+ST\\ ", ava.getUpName() );
assertEquals( "ou=T\\+ST\\ ", ava.getNormName() );
assertEquals( "ou", ava.getUpType() );
assertEquals( "ou", ava.getNormType() );
assertEquals( "T+ST ", ava.getUpValue().get() );
assertEquals( "T+ST ", ava.getNormValue().get() );
}
// ------------------------------------------------------------------
// Now normalize the Dn
dn.normalize( schemaManager );
assertEquals( " OU = Ex\\+mple + ou = T\\+ST\\ , ou = COM ", dn.getName() );
assertEquals( "2.5.4.11=ex\\+mple+2.5.4.11=t\\+st,2.5.4.11=com", dn.getNormName() );
// Check the first Rdn
rdn = dn.getRdn();
assertEquals( " OU = Ex\\+mple + ou = T\\+ST\\ ", rdn.getName() );
assertEquals( "2.5.4.11=ex\\+mple+2.5.4.11=t\\+st", rdn.getNormName() );
assertEquals( "OU", rdn.getUpType() );
assertEquals( "2.5.4.11", rdn.getNormType() );
assertEquals( "Ex+mple", rdn.getUpValue().getString() );
assertEquals( "ex+mple", rdn.getNormValue().getString() );
// The first ATAV
atav = rdn.getAva();
assertEquals( " OU = Ex\\+mple ", atav.getUpName() );
assertEquals( "2.5.4.11=ex\\+mple", atav.getNormName() );
assertEquals( "2.5.4.11", atav.getNormType() );
assertEquals( "OU", atav.getUpType() );
assertEquals( "Ex+mple", atav.getUpValue().get() );
assertEquals( "ex+mple", atav.getNormValue().get() );
assertEquals( 2, rdn.getNbAtavs() );
// The second ATAV
for ( Ava ava : rdn )