/** * Utility method which is called by the testcase sending an ADD request. * * @param authentication The flag to set the authentication on and off. * @return The error code of operation performed. * @throws Exception If an unexpected problem occurs. */ private int performAddOperation(boolean authentication) throws Exception { String filePath = TestCaseUtils.createTempFile( "dn: o=rejectTestCase,o=test", "objectclass: top", "objectclass: organization", "o: rejectTestCase", "description: Reject Test Case"); String[] args = null; if (authentication) args = new String[] { "--noPropertiesFile", "-h", "127.0.0.1", "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), "-D", "cn=directory manager", "-w", "password", "-a", "-f", filePath, }; else args = new String[] { "--noPropertiesFile", "-h", "127.0.0.1", "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), "-a", "-f", filePath, }; return LDAPModify.mainModify(args, false, null, null); }
/** * Utility method which is called by the testcase sending a MODRDN request. * * @param authentication The flag to set the authentication on and off. * @return The error code of operation performed. * @throws Exception If an unexpected problem occurs. */ private int performModRdnOperation(boolean authentication) throws Exception { String path = TestCaseUtils.createTempFile( "dn: o=rejectTestCase,o=Test", "changetype: modrdn", "newrdn: o=mod_rejectTestCase", "deleteoldrdn: 0"); String[] args = null; if (authentication) args = new String[] { "--noPropertiesFile", "-h", "127.0.0.1", "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), "-D", "cn=directory manager", "-w", "password", "-f", path }; else args = new String[] { "--noPropertiesFile", "-h", "127.0.0.1", "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), "-f", path }; return LDAPModify.mainModify(args, false, null, null); }