* @throws Exception If the test failed unexpectedly.
*/
@Test
public void testEncodeDecode() throws Exception
{
ByteStringBuilder builder = new ByteStringBuilder();
ASN1Writer writer = ASN1.getWriter(builder);
CompareRequestProtocolOp compareEncoded;
CompareRequestProtocolOp compareDecoded;
ArrayList<LDAPAttribute> attributes;
//Test case for a full encode decode operation with normal params.
compareEncoded = new CompareRequestProtocolOp(dn, attributeType,
assertionValue);
compareEncoded.write(writer);
ASN1Reader reader = ASN1.getReader(builder.toByteString());
compareDecoded = (CompareRequestProtocolOp)LDAPReader.readProtocolOp(reader);
assertEquals(compareEncoded.getType(), OP_TYPE_COMPARE_REQUEST);
assertEquals(compareEncoded.getDN(), compareDecoded.getDN());
assertEquals(compareEncoded.getAttributeType(),