use of com.unboundid.asn1.ASN1Null in project ldapsdk by pingidentity.
the class DebugTestCase method testDebugASN1Write1EnabledOnlyASN1.
/**
* Tests the first {@code debugASN1Write} method with the debugger enabled
* and a debug type set that includes only the ASN.1 type.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testDebugASN1Write1EnabledOnlyASN1() throws Exception {
Debug.setEnabled(true, EnumSet.of(DebugType.ASN1));
testLogHandler.resetMessageCount();
assertTrue(Debug.debugEnabled(DebugType.ASN1));
Debug.debugASN1Write(new ASN1Null());
assertTrue(testLogHandler.getMessageCount() >= 1);
}
use of com.unboundid.asn1.ASN1Null in project ldapsdk by pingidentity.
the class DebugTestCase method testDebugASN1Read2EnabledIncludeASN1.
/**
* Tests the second {@code debugASN1Read} method with the debugger enabled
* and a debug type set that includes the ASN.1 type among others.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testDebugASN1Read2EnabledIncludeASN1() throws Exception {
Debug.setEnabled(true, EnumSet.of(DebugType.ASN1, DebugType.OTHER));
testLogHandler.resetMessageCount();
assertTrue(Debug.debugEnabled(DebugType.ASN1));
Debug.debugASN1Read(Level.FINEST, new ASN1Null());
assertTrue(testLogHandler.getMessageCount() >= 1);
}
use of com.unboundid.asn1.ASN1Null in project ldapsdk by pingidentity.
the class DebugTestCase method testDebugASN1Read1EnabledAll.
/**
* Tests the first {@code debugASN1Read} method with the debugger enabled
* and a debug type set of all types.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testDebugASN1Read1EnabledAll() throws Exception {
Debug.setEnabled(true);
testLogHandler.resetMessageCount();
assertTrue(Debug.debugEnabled(DebugType.ASN1));
Debug.debugASN1Read(new ASN1Null());
assertTrue(testLogHandler.getMessageCount() >= 1);
}
use of com.unboundid.asn1.ASN1Null in project ldapsdk by pingidentity.
the class MultiUpdateExtendedRequestTestCase method testDecodeInvalidRequestType.
/**
* Tests the behavior when trying to decode a multi-update extended request
* that contains an invalid request element.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeInvalidRequestType() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Enumerated(0), new ASN1Sequence(new ASN1Sequence(new ASN1Null(LDAPMessage.PROTOCOL_OP_TYPE_UNBIND_REQUEST))));
new MultiUpdateExtendedRequest(new ExtendedRequest(MultiUpdateExtendedRequest.MULTI_UPDATE_REQUEST_OID, new ASN1OctetString(valueSequence.encode())));
}
use of com.unboundid.asn1.ASN1Null in project ldapsdk by pingidentity.
the class X509CertificateTestCase method testDecodeValueSequenceFirstElementNotSequence.
/**
* Tests the behavior when trying to decode a sequence whose first element
* cannot itself be parsed as a sequence.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { CertException.class })
public void testDecodeValueSequenceFirstElementNotSequence() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1OctetString("not a sequence"), new ASN1Sequence(new ASN1ObjectIdentifier(new OID("1.2.3.4")), new ASN1Null()), new ASN1BitString(new boolean[1024]));
new X509Certificate(valueSequence.encode());
}
Aggregations