use of com.github.zhenwei.core.asn1.ASN1Enumerated in project ldapsdk by pingidentity.
the class GetChangelogBatchExtendedRequestTestCase method testDecodeValueSequenceInvalidChangeType.
/**
* Provides test coverage for an attempt to decode an extended request with a
* value sequence with an invalid change type.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeValueSequenceInvalidChangeType() throws Exception {
final ASN1Set changeTypeSet = new ASN1Set((byte) 0xA4, new ASN1Enumerated(0), new ASN1Enumerated(5));
final ASN1Sequence valueSequence = new ASN1Sequence(new EndOfChangelogStartingPoint().encode(), new ASN1Integer(0), changeTypeSet);
new GetChangelogBatchExtendedRequest(new ExtendedRequest(GetChangelogBatchExtendedRequest.GET_CHANGELOG_BATCH_REQUEST_OID, new ASN1OctetString(valueSequence.encode())));
}
use of com.github.zhenwei.core.asn1.ASN1Enumerated in project ldapsdk by pingidentity.
the class GetSubtreeAccessibilityExtendedResultTestCase method testGetAccessibilityValueSequenceMissingBaseDN.
/**
* Tests the behavior when trying to decode a result whose value sequence is
* missing a base DN element.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testGetAccessibilityValueSequenceMissingBaseDN() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Enumerated((byte) 0x81, 1), new ASN1OctetString((byte) 0x82, "uid=bypass,dc=example,dc=com"), new ASN1OctetString((byte) 0x83, "20120101012345.678Z"));
new GetSubtreeAccessibilityExtendedResult(new ExtendedResult(1234, ResultCode.OTHER, null, null, null, GetSubtreeAccessibilityExtendedResult.GET_SUBTREE_ACCESSIBILITY_RESULT_OID, new ASN1OctetString(new ASN1Sequence(valueSequence).encode()), null));
}
use of com.github.zhenwei.core.asn1.ASN1Enumerated in project ldapsdk by pingidentity.
the class GetConfigurationExtendedResultTestCase method testDecodeInvalidConfigType.
/**
* Tests the behavior when trying to decode a result whose value sequence
* recognizes an unexpected configuration type.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeInvalidConfigType() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Enumerated((byte) 0x80, 123), new ASN1OctetString((byte) 0x81, "config.ldif"), new ASN1OctetString((byte) 0x82, TEST_CONFIG_FILE_BYTES));
new GetConfigurationExtendedResult(new ExtendedResult(123, ResultCode.SUCCESS, null, null, null, "1.3.6.1.4.1.30221.2.6.29", new ASN1OctetString(valueSequence.encode()), null));
}
use of com.github.zhenwei.core.asn1.ASN1Enumerated in project ldapsdk by pingidentity.
the class GetSubtreeAccessibilityExtendedResultTestCase method testGetAccessibilityValueSequenceMissingEffectiveTime.
/**
* Tests the behavior when trying to decode a result whose value sequence has
* an invalid accessibility state element.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testGetAccessibilityValueSequenceMissingEffectiveTime() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1OctetString((byte) 0x80, "ou=subtree,dc=example,dc=com"), new ASN1Enumerated((byte) 0x81, 1), new ASN1OctetString((byte) 0x82, "uid=bypass,dc=example,dc=com"));
new GetSubtreeAccessibilityExtendedResult(new ExtendedResult(1234, ResultCode.OTHER, null, null, null, GetSubtreeAccessibilityExtendedResult.GET_SUBTREE_ACCESSIBILITY_RESULT_OID, new ASN1OctetString(new ASN1Sequence(valueSequence).encode()), null));
}
use of com.github.zhenwei.core.asn1.ASN1Enumerated in project ldapsdk by pingidentity.
the class MultiUpdateExtendedRequestTestCase method testDecodeInvalidErrorBehavior.
/**
* Tests the behavior when trying to decode a multi-update extended request
* that contains an invalid error behavior value.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeInvalidErrorBehavior() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Enumerated(1234), new ASN1Sequence(new ASN1Sequence(new ASN1OctetString(LDAPMessage.PROTOCOL_OP_TYPE_DELETE_REQUEST, "uid=test.user,ou=People,dc=example,dc=com"))));
new MultiUpdateExtendedRequest(new ExtendedRequest(MultiUpdateExtendedRequest.MULTI_UPDATE_REQUEST_OID, new ASN1OctetString(valueSequence.encode())));
}
Aggregations