use of com.unboundid.asn1.ASN1StreamReader in project ldapsdk by pingidentity.
the class SearchResultDoneProtocolOpTestCase method testReadMalformedSearchResultDone.
/**
* Tests the behavior when trying to read a malformed search result done.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testReadMalformedSearchResultDone() throws Exception {
byte[] opBytes = { 0x65, 0x00 };
ByteArrayInputStream inputStream = new ByteArrayInputStream(opBytes);
ASN1StreamReader reader = new ASN1StreamReader(inputStream);
new SearchResultDoneProtocolOp(reader);
}
use of com.unboundid.asn1.ASN1StreamReader in project ldapsdk by pingidentity.
the class SearchResultReferenceProtocolOpTestCase method testReadMalformedRequest.
/**
* Tests the behavior when trying to read a malformed search result
* reference.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testReadMalformedRequest() throws Exception {
byte[] requestBytes = { (byte) 0x73 };
ByteArrayInputStream inputStream = new ByteArrayInputStream(requestBytes);
ASN1StreamReader reader = new ASN1StreamReader(inputStream);
new SearchResultReferenceProtocolOp(reader);
}
use of com.unboundid.asn1.ASN1StreamReader in project ldapsdk by pingidentity.
the class UnbindRequestProtocolOpTestCase method testUnbindRequestProtocolOp.
/**
* Provides test coverage for the unbind request protocol op.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testUnbindRequestProtocolOp() throws Exception {
UnbindRequestProtocolOp op = new UnbindRequestProtocolOp();
ASN1Buffer buffer = new ASN1Buffer();
op.writeTo(buffer);
byte[] opBytes = buffer.toByteArray();
ByteArrayInputStream inputStream = new ByteArrayInputStream(opBytes);
ASN1StreamReader reader = new ASN1StreamReader(inputStream);
op = new UnbindRequestProtocolOp(reader);
op = UnbindRequestProtocolOp.decodeProtocolOp(op.encodeProtocolOp());
assertEquals(op.getProtocolOpType(), (byte) 0x42);
assertNotNull(op.toString());
}
use of com.unboundid.asn1.ASN1StreamReader in project ldapsdk by pingidentity.
the class CompareResponseProtocolOpTestCase method testReadMalformedCompareResponse.
/**
* Tests the behavior when trying to read a malformed compare response.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testReadMalformedCompareResponse() throws Exception {
byte[] opBytes = { 0x6F, 0x00 };
ByteArrayInputStream inputStream = new ByteArrayInputStream(opBytes);
ASN1StreamReader reader = new ASN1StreamReader(inputStream);
new CompareResponseProtocolOp(reader);
}
use of com.unboundid.asn1.ASN1StreamReader in project ldapsdk by pingidentity.
the class DeleteRequestProtocolOpTestCase method testReadMalformedRequest.
/**
* Tests the behavior when trying to read a malformed delete request.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testReadMalformedRequest() throws Exception {
byte[] requestBytes = { (byte) 0x4A };
ByteArrayInputStream inputStream = new ByteArrayInputStream(requestBytes);
ASN1StreamReader reader = new ASN1StreamReader(inputStream);
new DeleteRequestProtocolOp(reader);
}
Aggregations