use of com.unboundid.ldap.sdk.IntermediateResponse in project ldapsdk by pingidentity.
the class GetChangelogBatchIntermediateResponseListenerTestCase method testHandleMalformedMissingChangelogEntries.
/**
* Provides test coverage for the {@code intermediateResponseReturned} method
* with a malformed missing changelog entries intermediate response.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testHandleMalformedMissingChangelogEntries() throws Exception {
final GetChangelogBatchExtendedRequest r = new GetChangelogBatchExtendedRequest(new EndOfChangelogStartingPoint(), 100, 300000L);
final TestChangelogEntryListener entryListener = new TestChangelogEntryListener();
assertEquals(entryListener.getEntryCount(), 0);
assertEquals(entryListener.getMissingChangesCount(), 0);
assertEquals(entryListener.getOtherCount(), 0);
final GetChangelogBatchIntermediateResponseListener l = new GetChangelogBatchIntermediateResponseListener(entryListener);
assertEquals(l.getEntryCount(), 0);
l.intermediateResponseReturned(new IntermediateResponse(MissingChangelogEntriesIntermediateResponse.MISSING_CHANGELOG_ENTRIES_INTERMEDIATE_RESPONSE_OID, new ASN1OctetString("foo")));
assertEquals(l.getEntryCount(), 0);
assertEquals(entryListener.getEntryCount(), 0);
assertEquals(entryListener.getMissingChangesCount(), 0);
assertEquals(entryListener.getOtherCount(), 1);
}
use of com.unboundid.ldap.sdk.IntermediateResponse in project ldapsdk by pingidentity.
the class GetChangelogBatchIntermediateResponseListenerTestCase method testHandleOtherIntermediateResponseWithOIDAndValue.
/**
* Provides test coverage for the {@code intermediateResponseReturned} method
* with an intermediate response message with an OID and value.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testHandleOtherIntermediateResponseWithOIDAndValue() throws Exception {
final GetChangelogBatchExtendedRequest r = new GetChangelogBatchExtendedRequest(new EndOfChangelogStartingPoint(), 100, 300000L);
final TestChangelogEntryListener entryListener = new TestChangelogEntryListener();
assertEquals(entryListener.getEntryCount(), 0);
assertEquals(entryListener.getMissingChangesCount(), 0);
assertEquals(entryListener.getOtherCount(), 0);
final GetChangelogBatchIntermediateResponseListener l = new GetChangelogBatchIntermediateResponseListener(entryListener);
assertEquals(l.getEntryCount(), 0);
l.intermediateResponseReturned(new IntermediateResponse("1.2.3.4", new ASN1OctetString("foo")));
assertEquals(l.getEntryCount(), 0);
assertEquals(entryListener.getEntryCount(), 0);
assertEquals(entryListener.getMissingChangesCount(), 0);
assertEquals(entryListener.getOtherCount(), 1);
}
use of com.unboundid.ldap.sdk.IntermediateResponse in project ldapsdk by pingidentity.
the class GetChangelogBatchIntermediateResponseListenerTestCase method testHandleMalformedChangelogEntry.
/**
* Provides test coverage for the {@code intermediateResponseReturned} method
* with a malformed changelog entry intermediate response.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testHandleMalformedChangelogEntry() throws Exception {
final GetChangelogBatchExtendedRequest r = new GetChangelogBatchExtendedRequest(new EndOfChangelogStartingPoint(), 100, 300000L);
final TestChangelogEntryListener entryListener = new TestChangelogEntryListener();
assertEquals(entryListener.getEntryCount(), 0);
assertEquals(entryListener.getMissingChangesCount(), 0);
assertEquals(entryListener.getOtherCount(), 0);
final GetChangelogBatchIntermediateResponseListener l = new GetChangelogBatchIntermediateResponseListener(entryListener);
assertEquals(l.getEntryCount(), 0);
l.intermediateResponseReturned(new IntermediateResponse(ChangelogEntryIntermediateResponse.CHANGELOG_ENTRY_INTERMEDIATE_RESPONSE_OID, new ASN1OctetString("foo")));
assertEquals(l.getEntryCount(), 0);
assertEquals(entryListener.getEntryCount(), 0);
assertEquals(entryListener.getMissingChangesCount(), 0);
assertEquals(entryListener.getOtherCount(), 1);
}
use of com.unboundid.ldap.sdk.IntermediateResponse in project ldapsdk by pingidentity.
the class ChangelogEntryIntermediateResponseTestCase method testDecodeValueSequenceWithMalformedElements.
/**
* Tests the behavior when attempting to decode an intermediate response
* with a value sequence with a value sequence containing malformed elements.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeValueSequenceWithMalformedElements() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1OctetString("foo"), new ASN1OctetString("foo"), new ASN1OctetString("foo"), new ASN1OctetString("foo"));
new ChangelogEntryIntermediateResponse(new IntermediateResponse(ChangelogEntryIntermediateResponse.CHANGELOG_ENTRY_INTERMEDIATE_RESPONSE_OID, new ASN1OctetString(valueSequence.encode())));
}
use of com.unboundid.ldap.sdk.IntermediateResponse in project ldapsdk by pingidentity.
the class ChangelogEntryIntermediateResponseTestCase method testDecodeValueSequenceInvalidElementCount.
/**
* Tests the behavior when attempting to decode an intermediate response
* with a value sequence with an unexpected number of elements.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeValueSequenceInvalidElementCount() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1OctetString("foo"));
new ChangelogEntryIntermediateResponse(new IntermediateResponse(ChangelogEntryIntermediateResponse.CHANGELOG_ENTRY_INTERMEDIATE_RESPONSE_OID, new ASN1OctetString(valueSequence.encode())));
}
Aggregations