01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.harmony.jndi.provider.ldap.event;
19:
20: import org.apache.harmony.jndi.provider.ldap.LdapControl;
21: import org.apache.harmony.jndi.provider.ldap.asn1.ASN1TestUtils;
22: import org.apache.harmony.jndi.provider.ldap.asn1.LdapASN1Constant;
23:
24: import junit.framework.TestCase;
25:
26: public class PersistentSearchControlTest extends TestCase {
27:
28: public void test_encodeValues_$LObject() {
29: PersistentSearchControl controls = new PersistentSearchControl();
30:
31: ASN1TestUtils.checkEncode(controls,
32: LdapASN1Constant.PersistentSearchControl);
33:
34: ASN1TestUtils.checkEncode(new LdapControl(controls),
35: LdapASN1Constant.Control);
36: }
37:
38: public void test_constructor() {
39: PersistentSearchControl controls = new PersistentSearchControl();
40: assertTrue(controls.isChangesOnly());
41: assertEquals(1 | 2 | 4 | 8, controls.getChangeTypes());
42: assertEquals(PersistentSearchControl.OID, controls.getID());
43: assertTrue(controls.isCritical());
44: assertTrue(controls.isReturnECs());
45: }
46: }
|