| | |
| | | throws Exception |
| | | { |
| | | VLVRequestControl vlvRequest = |
| | | new VLVRequestControl(true, 0, 9, 1, 0, ByteString.valueOf("foo")); |
| | | new VLVRequestControl(true, 0, 9, 1, 0, ByteString.valueOfUtf8("foo")); |
| | | |
| | | assertEquals(vlvRequest.isCritical(), true); |
| | | assertEquals(vlvRequest.getBeforeCount(), 0); |
| | |
| | | throws Exception |
| | | { |
| | | VLVRequestControl vlvRequest = |
| | | new VLVRequestControl(0, 9, ByteString.valueOf("a")); |
| | | new VLVRequestControl(0, 9, ByteString.valueOfUtf8("a")); |
| | | |
| | | assertEquals(vlvRequest.isCritical(), false); |
| | | assertEquals(vlvRequest.getBeforeCount(), 0); |
| | |
| | | throws Exception |
| | | { |
| | | VLVRequestControl vlvRequest = |
| | | new VLVRequestControl(true, 0, 9, ByteString.valueOf("a"), null); |
| | | new VLVRequestControl(true, 0, 9, ByteString.valueOfUtf8("a"), null); |
| | | |
| | | assertEquals(vlvRequest.isCritical(), true); |
| | | assertEquals(vlvRequest.getBeforeCount(), 0); |
| | |
| | | throws Exception |
| | | { |
| | | VLVRequestControl vlvRequest = |
| | | new VLVRequestControl(true, 0, 9, ByteString.valueOf("a"), |
| | | ByteString.valueOf("foo")); |
| | | new VLVRequestControl(true, 0, 9, ByteString.valueOfUtf8("a"), |
| | | ByteString.valueOfUtf8("foo")); |
| | | |
| | | assertEquals(vlvRequest.isCritical(), true); |
| | | assertEquals(vlvRequest.getBeforeCount(), 0); |
| | |
| | | ByteStringBuilder builder = new ByteStringBuilder(); |
| | | ASN1Writer writer = ASN1.getWriter(builder); |
| | | VLVResponseControl vlvResponse = new VLVResponseControl(true, 0, 15, 0, |
| | | ByteString.valueOf("foo")); |
| | | ByteString.valueOfUtf8("foo")); |
| | | vlvResponse.writeValue(writer); |
| | | |
| | | ASN1Reader reader = ASN1.getReader(builder.toByteString()); |
| | |
| | | throws Exception |
| | | { |
| | | VLVResponseControl vlvResponse = |
| | | new VLVResponseControl(true, 0, 15, 0, ByteString.valueOf("foo")); |
| | | new VLVResponseControl(true, 0, 15, 0, ByteString.valueOfUtf8("foo")); |
| | | |
| | | assertEquals(vlvResponse.isCritical(), true); |
| | | assertEquals(vlvResponse.getTargetPosition(), 0); |
| | |
| | | |
| | | SearchRequest request = newSearchRequest("dc=example,dc=com", SearchScope.WHOLE_SUBTREE, "(objectClass=person)") |
| | | .addControl(new ServerSideSortRequestControl("givenName")) |
| | | .addControl(new VLVRequestControl(0, 3, ByteString.valueOf("a"))); |
| | | .addControl(new VLVRequestControl(0, 3, ByteString.valueOfUtf8("a"))); |
| | | InternalSearchOperation internalSearch = getRootConnection().processSearch(request); |
| | | assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | |
| | | SearchRequest request = newSearchRequest("dc=example,dc=com", SearchScope.WHOLE_SUBTREE, "(objectClass=person)") |
| | | .addControl(new ServerSideSortRequestControl("givenName")) |
| | | .addControl(new VLVRequestControl(0, 3, ByteString.valueOf("aaccf"))); |
| | | .addControl(new VLVRequestControl(0, 3, ByteString.valueOfUtf8("aaccf"))); |
| | | InternalSearchOperation internalSearch = getRootConnection().processSearch(request); |
| | | assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | |
| | | SearchRequest request = newSearchRequest("dc=example,dc=com", SearchScope.WHOLE_SUBTREE, "(objectClass=person)") |
| | | .addControl(new ServerSideSortRequestControl("givenName")) |
| | | .addControl(new VLVRequestControl(0, 3, ByteString.valueOf("albert"))); |
| | | .addControl(new VLVRequestControl(0, 3, ByteString.valueOfUtf8("albert"))); |
| | | InternalSearchOperation internalSearch = getRootConnection().processSearch(request); |
| | | assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | |
| | | SearchRequest request = newSearchRequest("dc=example,dc=com", SearchScope.WHOLE_SUBTREE, "(objectClass=person)") |
| | | .addControl(new ServerSideSortRequestControl("givenName")) |
| | | .addControl(new VLVRequestControl(1, 3, ByteString.valueOf("albert"))); |
| | | .addControl(new VLVRequestControl(1, 3, ByteString.valueOfUtf8("albert"))); |
| | | InternalSearchOperation internalSearch = getRootConnection().processSearch(request); |
| | | assertEquals(internalSearch.getResultCode(), ResultCode.SUCCESS); |
| | | |
| | |
| | | |
| | | SearchRequest request = newSearchRequest("dc=example,dc=com", SearchScope.WHOLE_SUBTREE, "(objectClass=person)") |
| | | .addControl(new ServerSideSortRequestControl("sn")) |
| | | .addControl(new VLVRequestControl(0, 3, ByteString.valueOf("zz"))); |
| | | .addControl(new VLVRequestControl(0, 3, ByteString.valueOfUtf8("zz"))); |
| | | InternalSearchOperation internalSearch = getRootConnection().processSearch(request); |
| | | |
| | | // It will be successful because the control isn't critical. |