de.printStackTrace();
fail( de.getMessage() );
}
// Check the decoded DelRequest PDU
DeleteRequest delRequest = container.getMessage();
assertEquals( 1, delRequest.getMessageId() );
assertEquals( "cn=testModify,ou=users,ou=system", delRequest.getName().toString() );
// Check the Control
Map<String, Control> controls = delRequest.getControls();
assertEquals( 1, controls.size() );
@SuppressWarnings("unchecked")
CodecControl<Control> control = ( org.apache.directory.shared.ldap.codec.api.CodecControl<Control> ) controls
.get( "2.16.840.1.113730.3.4.2" );
assertEquals( "2.16.840.1.113730.3.4.2", control.getOid() );
assertEquals( "", Strings.dumpBytes( ( byte[] ) control.getValue() ) );
DeleteRequest internalDeleteRequest = new DeleteRequestImpl();
internalDeleteRequest.setMessageId( delRequest.getMessageId() );
internalDeleteRequest.setName( delRequest.getName() );
internalDeleteRequest.addControl( control );
// Check the encoding
try
{
ByteBuffer bb = encoder.encodeMessage( internalDeleteRequest );