| | |
| | | Socket s = null; |
| | | try { |
| | | s = new Socket("127.0.0.1", TestCaseUtils.getServerLdapPort()); |
| | | s.setSoTimeout(3000); |
| | | TestCaseUtils.configureSocket(s); |
| | | ASN1Reader r = ASN1.getReader(s.getInputStream()); |
| | | ASN1Writer w = ASN1.getWriter(s.getOutputStream()); |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Configures a socket for use in unit tests. This should only be used if the |
| | | * socket is not expected to timeout. |
| | | * |
| | | * @param s |
| | | * The socket. |
| | | * @throws Exception |
| | | * If an unexpected exception occurred while configuring the socket. |
| | | */ |
| | | public static void configureSocket(Socket s) throws Exception |
| | | { |
| | | s.setSoTimeout(60 * 1000); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Adds the provided entry to the Directory Server using an internal |
| | | * operation. |
| | |
| | | |
| | | return buffer.toString(); |
| | | } |
| | | |
| | | |
| | | public static void enableBackend(String backendID) |
| | | { |
| | | dsconfig("set-backend-prop", "--backend-name", backendID, |
| | | "--set", "enabled:true"); |
| | | } |
| | | |
| | | |
| | | public static void disableBackend(String backendID) |
| | | { |
| | | dsconfig("set-backend-prop", "--backend-name", backendID, |