Search in sources :

Example 46 with ASN1Null

use of com.unboundid.asn1.ASN1Null in project ldapsdk by pingidentity.

the class DebugTestCase method testDebugASN1Read1EnabledOnlyASN1.

/**
 * Tests the first {@code debugASN1Read} 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 testDebugASN1Read1EnabledOnlyASN1() throws Exception {
    Debug.setEnabled(true, EnumSet.of(DebugType.ASN1));
    testLogHandler.resetMessageCount();
    assertTrue(Debug.debugEnabled(DebugType.ASN1));
    Debug.debugASN1Read(new ASN1Null());
    assertTrue(testLogHandler.getMessageCount() >= 1);
}
Also used : ASN1Null(com.unboundid.asn1.ASN1Null) Test(org.testng.annotations.Test)

Example 47 with ASN1Null

use of com.unboundid.asn1.ASN1Null in project ldapsdk by pingidentity.

the class DebugTestCase method testDebugASN1Write1EnabledWithoutASN1.

/**
 * Tests the first {@code debugASN1Write} method with the debugger enabled
 * and a debug type set that does not include the ASN.1 type.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test()
public void testDebugASN1Write1EnabledWithoutASN1() throws Exception {
    Debug.setEnabled(true, EnumSet.of(DebugType.OTHER));
    testLogHandler.resetMessageCount();
    assertFalse(Debug.debugEnabled(DebugType.ASN1));
    Debug.debugASN1Write(new ASN1Null());
    assertTrue(testLogHandler.getMessageCount() >= 0);
}
Also used : ASN1Null(com.unboundid.asn1.ASN1Null) Test(org.testng.annotations.Test)

Example 48 with ASN1Null

use of com.unboundid.asn1.ASN1Null in project ldapsdk by pingidentity.

the class PasswordValidationDetailsResponseControlTestCase method testDecodeControlInvalidValidationResponseType.

/**
 * Tests the behavior when trying to decode a control whose value contains an
 * invalid validation response type.
 *
 * @throws  Exception  If an unexpected problem occurs.
 */
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeControlInvalidValidationResponseType() throws Exception {
    final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Null((byte) 0x12));
    new PasswordValidationDetailsResponseControl().decodeControl("1.3.6.1.4.1.30221.2.5.41", false, new ASN1OctetString(valueSequence.encode()));
}
Also used : ASN1OctetString(com.unboundid.asn1.ASN1OctetString) ASN1Sequence(com.unboundid.asn1.ASN1Sequence) ASN1Null(com.unboundid.asn1.ASN1Null) Test(org.testng.annotations.Test)

Example 49 with ASN1Null

use of com.unboundid.asn1.ASN1Null in project ldapsdk by pingidentity.

the class DebugTestCase method testDebugASN1Read2EnabledAll.

/**
 * Tests the second {@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 testDebugASN1Read2EnabledAll() throws Exception {
    Debug.setEnabled(true);
    testLogHandler.resetMessageCount();
    assertTrue(Debug.debugEnabled(DebugType.ASN1));
    Debug.debugASN1Read(Level.FINEST, new ASN1Null());
    assertTrue(testLogHandler.getMessageCount() >= 1);
}
Also used : ASN1Null(com.unboundid.asn1.ASN1Null) Test(org.testng.annotations.Test)

Example 50 with ASN1Null

use of com.unboundid.asn1.ASN1Null in project ldapsdk by pingidentity.

the class DebugTestCase method testDebugASN1Write2EnabledOnlyASN1.

/**
 * Tests the second {@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 testDebugASN1Write2EnabledOnlyASN1() throws Exception {
    Debug.setEnabled(true, EnumSet.of(DebugType.ASN1));
    testLogHandler.resetMessageCount();
    assertTrue(Debug.debugEnabled(DebugType.ASN1));
    Debug.debugASN1Write(Level.FINEST, new ASN1Null());
    assertTrue(testLogHandler.getMessageCount() >= 1);
}
Also used : ASN1Null(com.unboundid.asn1.ASN1Null) Test(org.testng.annotations.Test)

Aggregations

ASN1Null (com.unboundid.asn1.ASN1Null)69 Test (org.testng.annotations.Test)65 ASN1BitString (com.unboundid.asn1.ASN1BitString)36 ASN1OctetString (com.unboundid.asn1.ASN1OctetString)33 DN (com.unboundid.ldap.sdk.DN)33 OID (com.unboundid.util.OID)32 ASN1Sequence (com.unboundid.asn1.ASN1Sequence)28 ASN1ObjectIdentifier (com.unboundid.asn1.ASN1ObjectIdentifier)23 ASN1Integer (com.unboundid.asn1.ASN1Integer)21 ASN1Element (com.unboundid.asn1.ASN1Element)20 ASN1BigInteger (com.unboundid.asn1.ASN1BigInteger)15 ASN1GeneralizedTime (com.unboundid.asn1.ASN1GeneralizedTime)9 ASN1UTCTime (com.unboundid.asn1.ASN1UTCTime)6 ArrayList (java.util.ArrayList)6 ASN1Null (com.github.zhenwei.core.asn1.ASN1Null)5 Date (java.util.Date)5 ASN1ObjectIdentifier (com.github.zhenwei.core.asn1.ASN1ObjectIdentifier)3 ASN1OctetString (com.github.zhenwei.core.asn1.ASN1OctetString)3 AlgorithmParameters (java.security.AlgorithmParameters)3 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)3