*/
@Before
public void initAT()
{
sb = new EntryUtils.S( "1.1.1.1", false );
sb.setSyntaxChecker( new OctetStringSyntaxChecker() );
mrb = new EntryUtils.MR( "1.1.2.1" );
mrb.setSyntax( sb );
mrb.setLdapComparator( new ByteArrayComparator( "1.1.1" ) );
mrb.setNormalizer( new Normalizer( "1.1.1" )
{
public static final long serialVersionUID = 1L;
public Value<?> normalize( Value<?> value ) throws LdapException
{
if ( !value.isHumanReadable() )
{
byte[] val = value.getBytes();
// each byte will be changed to be > 0, and spaces will be trimmed
byte[] newVal = new byte[val.length];
int i = 0;
for ( byte b : val )
{
newVal[i++] = ( byte ) ( b & 0x007F );
}
return new BinaryValue( Strings.trim( newVal ) );
}
throw new IllegalStateException( "expected byte[] to normalize" );
}
public String normalize( String value ) throws LdapException
{
throw new IllegalStateException( "expected byte[] to normalize" );
}
} );
atb = new EntryUtils.AT( "1.1.3.1" );
atb.setEquality( mrb );
atb.setOrdering( mrb );
atb.setSubstring( mrb );
atb.setSyntax( sb );
ss = new EntryUtils.S( "1.1.1.1", true );
ss.setSyntaxChecker( new OctetStringSyntaxChecker() );
mrs = new EntryUtils.MR( "1.1.2.1" );
mrs.setSyntax( ss );
mrs.setLdapComparator( new StringComparator( "1.1.2.1" ) );
mrs.setNormalizer( new DeepTrimToLowerNormalizer( "1.1.2.1" ) );
ats = new EntryUtils.AT( "1.1.3.1" );