| | |
| | | import org.opends.server.controls.VLVResponseControl; |
| | | import org.opends.server.protocols.internal.InternalClientConnection; |
| | | import org.opends.server.protocols.internal.InternalSearchOperation; |
| | | import org.opends.server.protocols.ldap.LDAPFilter; |
| | | import org.opends.server.protocols.ldap.LDAPResultCode; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.protocols.ldap.LDAPControl; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.core.SearchOperation; |
| | | import org.opends.server.types.*; |
| | | import org.testng.annotations.BeforeClass; |
| | | import org.testng.annotations.Test; |
| | |
| | | { |
| | | for(int j = 0; j < values.getValues().length; j++) |
| | | { |
| | | byte[] value; |
| | | ByteString value; |
| | | if(i < 4) |
| | | { |
| | | value = svs1.getValue(i * 3 + j); |
| | |
| | | { |
| | | value = svs2.getValue((i - 4) * 3 + j); |
| | | } |
| | | byte[] oValue = null; |
| | | ByteString oValue = null; |
| | | if(values.getValues()[j] != null) |
| | | { |
| | | oValue = values.getValues()[j].getNormalizedValueBytes(); |
| | | oValue = values.getValues()[j].getNormalizedValue(); |
| | | } |
| | | assertEquals(value, oValue); |
| | | } |
| | |
| | | { |
| | | if (c.getOID().equals(OID_SERVER_SIDE_SORT_RESPONSE_CONTROL)) |
| | | { |
| | | sortResponse = ServerSideSortResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | sortResponse = ServerSideSortResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | sortResponse = (ServerSideSortResponseControl)c; |
| | | } |
| | | } |
| | | else if (c.getOID().equals(OID_VLV_RESPONSE_CONTROL)) |
| | | { |
| | | vlvResponse = VLVResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | vlvResponse = VLVResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | vlvResponse = (VLVResponseControl)c; |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | if (c.getOID().equals(OID_SERVER_SIDE_SORT_RESPONSE_CONTROL)) |
| | | { |
| | | sortResponse = ServerSideSortResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | sortResponse = ServerSideSortResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | sortResponse = (ServerSideSortResponseControl)c; |
| | | } |
| | | } |
| | | else if (c.getOID().equals(OID_VLV_RESPONSE_CONTROL)) |
| | | { |
| | | vlvResponse = VLVResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | vlvResponse = VLVResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | vlvResponse = (VLVResponseControl)c; |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | if (c.getOID().equals(OID_SERVER_SIDE_SORT_RESPONSE_CONTROL)) |
| | | { |
| | | sortResponse = ServerSideSortResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | sortResponse = ServerSideSortResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | sortResponse = (ServerSideSortResponseControl)c; |
| | | } |
| | | } |
| | | else if (c.getOID().equals(OID_VLV_RESPONSE_CONTROL)) |
| | | { |
| | | vlvResponse = VLVResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | vlvResponse = VLVResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | vlvResponse = (VLVResponseControl)c; |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | if (c.getOID().equals(OID_VLV_RESPONSE_CONTROL)) |
| | | { |
| | | vlvResponse = VLVResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | vlvResponse = VLVResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | vlvResponse = (VLVResponseControl)c; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | if (c.getOID().equals(OID_VLV_RESPONSE_CONTROL)) |
| | | { |
| | | vlvResponse = VLVResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | vlvResponse = VLVResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | vlvResponse = (VLVResponseControl)c; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | if (c.getOID().equals(OID_VLV_RESPONSE_CONTROL)) |
| | | { |
| | | vlvResponse = VLVResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | vlvResponse = VLVResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | vlvResponse = (VLVResponseControl)c; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | if (c.getOID().equals(OID_SERVER_SIDE_SORT_RESPONSE_CONTROL)) |
| | | { |
| | | sortResponse = ServerSideSortResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | sortResponse = ServerSideSortResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | sortResponse = (ServerSideSortResponseControl)c; |
| | | } |
| | | } |
| | | else if (c.getOID().equals(OID_VLV_RESPONSE_CONTROL)) |
| | | { |
| | | vlvResponse = VLVResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | vlvResponse = VLVResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | vlvResponse = (VLVResponseControl)c; |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | ArrayList<Control> requestControls = new ArrayList<Control>(); |
| | | requestControls.add(new ServerSideSortRequestControl(sortOrder)); |
| | | requestControls.add(new VLVRequestControl(0, 3, new ASN1OctetString("a"))); |
| | | requestControls.add(new VLVRequestControl(0, 3, ByteString.valueOf("a"))); |
| | | |
| | | InternalSearchOperation internalSearch = |
| | | new InternalSearchOperation(conn, conn.nextOperationID(), |
| | |
| | | { |
| | | if (c.getOID().equals(OID_SERVER_SIDE_SORT_RESPONSE_CONTROL)) |
| | | { |
| | | sortResponse = ServerSideSortResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | sortResponse = ServerSideSortResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | sortResponse = (ServerSideSortResponseControl)c; |
| | | } |
| | | } |
| | | else if (c.getOID().equals(OID_VLV_RESPONSE_CONTROL)) |
| | | { |
| | | vlvResponse = VLVResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | vlvResponse = VLVResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | vlvResponse = (VLVResponseControl)c; |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | ArrayList<Control> requestControls = new ArrayList<Control>(); |
| | | requestControls.add(new ServerSideSortRequestControl(sortOrder)); |
| | | requestControls.add(new VLVRequestControl(0, 3, |
| | | new ASN1OctetString("aaccf"))); |
| | | ByteString.valueOf("aaccf"))); |
| | | |
| | | InternalSearchOperation internalSearch = |
| | | new InternalSearchOperation(conn, conn.nextOperationID(), |
| | |
| | | { |
| | | if (c.getOID().equals(OID_SERVER_SIDE_SORT_RESPONSE_CONTROL)) |
| | | { |
| | | sortResponse = ServerSideSortResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | sortResponse = ServerSideSortResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | sortResponse = (ServerSideSortResponseControl)c; |
| | | } |
| | | } |
| | | else if (c.getOID().equals(OID_VLV_RESPONSE_CONTROL)) |
| | | { |
| | | vlvResponse = VLVResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | vlvResponse = VLVResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | vlvResponse = (VLVResponseControl)c; |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | ArrayList<Control> requestControls = new ArrayList<Control>(); |
| | | requestControls.add(new ServerSideSortRequestControl(sortOrder)); |
| | | requestControls.add(new VLVRequestControl(0, 3, |
| | | new ASN1OctetString("albert"))); |
| | | ByteString.valueOf("albert"))); |
| | | |
| | | InternalSearchOperation internalSearch = |
| | | new InternalSearchOperation(conn, conn.nextOperationID(), |
| | |
| | | { |
| | | if (c.getOID().equals(OID_SERVER_SIDE_SORT_RESPONSE_CONTROL)) |
| | | { |
| | | sortResponse = ServerSideSortResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | sortResponse = ServerSideSortResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | sortResponse = (ServerSideSortResponseControl)c; |
| | | } |
| | | } |
| | | else if (c.getOID().equals(OID_VLV_RESPONSE_CONTROL)) |
| | | { |
| | | vlvResponse = VLVResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | vlvResponse = VLVResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | vlvResponse = (VLVResponseControl)c; |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | ArrayList<Control> requestControls = new ArrayList<Control>(); |
| | | requestControls.add(new ServerSideSortRequestControl(sortOrder)); |
| | | requestControls.add(new VLVRequestControl(1, 3, |
| | | new ASN1OctetString("albert"))); |
| | | ByteString.valueOf("albert"))); |
| | | |
| | | InternalSearchOperation internalSearch = |
| | | new InternalSearchOperation(conn, conn.nextOperationID(), |
| | |
| | | { |
| | | if (c.getOID().equals(OID_SERVER_SIDE_SORT_RESPONSE_CONTROL)) |
| | | { |
| | | sortResponse = ServerSideSortResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | sortResponse = ServerSideSortResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | sortResponse = (ServerSideSortResponseControl)c; |
| | | } |
| | | } |
| | | else if (c.getOID().equals(OID_VLV_RESPONSE_CONTROL)) |
| | | { |
| | | vlvResponse = VLVResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | vlvResponse = VLVResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | vlvResponse = (VLVResponseControl)c; |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | ArrayList<Control> requestControls = new ArrayList<Control>(); |
| | | requestControls.add(new ServerSideSortRequestControl(sortOrder)); |
| | | requestControls.add(new VLVRequestControl(0, 3, new ASN1OctetString("zz"))); |
| | | requestControls.add(new VLVRequestControl(0, 3, ByteString.valueOf("zz"))); |
| | | |
| | | InternalSearchOperation internalSearch = |
| | | new InternalSearchOperation(conn, conn.nextOperationID(), |
| | |
| | | { |
| | | if (c.getOID().equals(OID_VLV_RESPONSE_CONTROL)) |
| | | { |
| | | vlvResponse = VLVResponseControl.decodeControl(c); |
| | | if(c instanceof LDAPControl) |
| | | { |
| | | vlvResponse = VLVResponseControl.DECODER.decode(c.isCritical(), ((LDAPControl)c).getValue()); |
| | | } |
| | | else |
| | | { |
| | | vlvResponse = (VLVResponseControl)c; |
| | | } |
| | | } |
| | | } |
| | | |