use of com.github.zhenwei.core.asn1.ASN1Sequence in project ldapsdk by pingidentity.
the class MatchingEntryCountResponseControlTestCase method testDecodeNegativeZeroUpperBound.
/**
* Tests the behavior when trying to decode a control whose value sequence
* contains an upper bound value of zero.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeNegativeZeroUpperBound() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Integer((byte) 0x82, -1));
new MatchingEntryCountResponseControl("1.3.6.1.4.1.30221.2.5.37", false, new ASN1OctetString(valueSequence.encode()));
}
use of com.github.zhenwei.core.asn1.ASN1Sequence in project ldapsdk by pingidentity.
the class MatchingEntryCountResponseControlTestCase method testDecodeValueInvalidCountType.
/**
* Tests the behavior when trying to decode a control whose value sequence
* contains an invalid count type.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeValueInvalidCountType() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Integer((byte) 0x84, 12345));
new MatchingEntryCountResponseControl("1.3.6.1.4.1.30221.2.5.37", false, new ASN1OctetString(valueSequence.encode()));
}
use of com.github.zhenwei.core.asn1.ASN1Sequence in project ldapsdk by pingidentity.
the class UndeleteRequestControlTestCase method testDecodeValueSequenceBadElement.
/**
* Tests the behavior when attempting to decode a control whose value has an
* invalid sequence element.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeValueSequenceBadElement() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Integer((byte) 0x82, -1), new ASN1OctetString((byte) 0x83, "unexpected type"));
new UndeleteRequestControl(new Control(UndeleteRequestControl.UNDELETE_REQUEST_OID, true, new ASN1OctetString(valueSequence.encode())));
}
use of com.github.zhenwei.core.asn1.ASN1Sequence in project ldapsdk by pingidentity.
the class OverrideSearchLimitsRequestControlTestCase method testDecodeControlEmptyPropertyValue.
/**
* Tests the behavior when trying to decode a control whose value sequence
* contains a property with an empty value.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeControlEmptyPropertyValue() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Sequence(new ASN1OctetString("name"), new ASN1OctetString("")));
final Control c = new Control("1.3.6.1.4.1.30221.2.5.56", false, new ASN1OctetString(valueSequence.encode()));
new OverrideSearchLimitsRequestControl(c);
}
use of com.github.zhenwei.core.asn1.ASN1Sequence in project ldapsdk by pingidentity.
the class OverrideSearchLimitsRequestControlTestCase method testDecodeControlDuplicatePropertyName.
/**
* Tests the behavior when trying to decode a control whose value sequence
* contains multiple properties with the same name.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test(expectedExceptions = { LDAPException.class })
public void testDecodeControlDuplicatePropertyName() throws Exception {
final ASN1Sequence valueSequence = new ASN1Sequence(new ASN1Sequence(new ASN1OctetString("name1"), new ASN1OctetString("value1")), new ASN1Sequence(new ASN1OctetString("name2"), new ASN1OctetString("value2")), new ASN1Sequence(new ASN1OctetString("name1"), new ASN1OctetString("value3")));
final Control c = new Control("1.3.6.1.4.1.30221.2.5.56", false, new ASN1OctetString(valueSequence.encode()));
new OverrideSearchLimitsRequestControl(c);
}
Aggregations