use of com.unboundid.ldap.sdk.IntermediateResponse in project ldapsdk by pingidentity.
the class DebugTestCase method testDebugLDAPResult8EnabledOnlyLDAP.
/**
* Tests the eighth {@code debugLDAPResult} method with the debugger enabled
* and a debug type set that includes only the LDAP type.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testDebugLDAPResult8EnabledOnlyLDAP() throws Exception {
Debug.setEnabled(true, EnumSet.of(DebugType.LDAP));
testLogHandler.resetMessageCount();
assertTrue(Debug.debugEnabled(DebugType.LDAP));
Debug.debugLDAPResult(Level.FINEST, new IntermediateResponse("1.2.3.4", null));
assertTrue(testLogHandler.getMessageCount() >= 1);
}
use of com.unboundid.ldap.sdk.IntermediateResponse in project ldapsdk by pingidentity.
the class StreamProxyValuesIntermediateResponseTestCase method testDecodeInvalidResult.
/**
* Tests the behavior when trying to decode an intermediate response with an
* invalid result value.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeInvalidResult() throws Exception {
ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Enumerated((byte) 0x81, -1));
ASN1OctetString value = new ASN1OctetString(valueSequence.encode());
IntermediateResponse r = new IntermediateResponse("1.3.6.1.4.1.30221.2.6.9", value);
new StreamProxyValuesIntermediateResponse(r);
}
use of com.unboundid.ldap.sdk.IntermediateResponse in project ldapsdk by pingidentity.
the class StreamProxyValuesIntermediateResponseTestCase method testDecodeInvalidElementType.
/**
* Tests the behavior when trying to decode an intermediate response with an
* invalid element type.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeInvalidElementType() throws Exception {
ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Enumerated((byte) 0x81, 0), new ASN1OctetString((byte) 0x8F));
ASN1OctetString value = new ASN1OctetString(valueSequence.encode());
IntermediateResponse r = new IntermediateResponse("1.3.6.1.4.1.30221.2.6.9", value);
new StreamProxyValuesIntermediateResponse(r);
}
use of com.unboundid.ldap.sdk.IntermediateResponse in project ldapsdk by pingidentity.
the class StreamDirectoryValuesIntermediateResponseTestCase method testConstructor2NoValue.
/**
* Tests the behavior of the second constructor with a response that does not
* have a value.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testConstructor2NoValue() throws Exception {
IntermediateResponse r = new IntermediateResponse(StreamDirectoryValuesIntermediateResponse.STREAM_DIRECTORY_VALUES_INTERMEDIATE_RESPONSE_OID, null);
new StreamDirectoryValuesIntermediateResponse(r);
}
use of com.unboundid.ldap.sdk.IntermediateResponse in project ldapsdk by pingidentity.
the class StreamDirectoryValuesIntermediateResponseTestCase method testConstructor2ValueInvalidType.
/**
* Tests the behavior of the second constructor with a response whose value
* contains an element with an invalid type.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testConstructor2ValueInvalidType() throws Exception {
ASN1Element[] elements = { new ASN1Enumerated((byte) 0x81, 0), new ASN1OctetString((byte) 0x85, "foo") };
IntermediateResponse r = new IntermediateResponse(StreamDirectoryValuesIntermediateResponse.STREAM_DIRECTORY_VALUES_INTERMEDIATE_RESPONSE_OID, new ASN1OctetString(new ASN1Sequence(elements).encode()));
new StreamDirectoryValuesIntermediateResponse(r);
}
Aggregations