| | |
| | | (ECLWorkflowElement) DirectoryServer |
| | | .getWorkflowElement(ECLWorkflowElement.ECL_WORKFLOW_ELEMENT); |
| | | if (wfe != null) |
| | | { |
| | | wfe.getReplicationServer().enableECL(); |
| | | } |
| | | |
| | | // Test all types of ops. |
| | | ECLAllOps(); // Do not clean the db for the next test |
| | |
| | | ECLCompatTestLimits(0,0, false); |
| | | } |
| | | |
| | | //======================================================= |
| | | // Objectives |
| | | // - Test that everything id ok with no changes |
| | | // Procedure |
| | | // - Does a SEARCH from 3 different remote ECL session, |
| | | // - Verify DoneMsg is received on each session. |
| | | /** |
| | | * Objectives |
| | | * - Test that everything is ok with no changes |
| | | * Procedure |
| | | * - Does a SEARCH from 3 different remote ECL session, |
| | | * - Verify DoneMsg is received on each session. |
| | | */ |
| | | private void ECLRemoteEmpty() throws Exception |
| | | { |
| | | String tn = "ECLRemoteEmpty"; |
| | |
| | | } |
| | | } |
| | | |
| | | //======================================================= |
| | | // Objectives |
| | | // - Test that everything id ok with changes on 2 suffixes |
| | | // Procedure |
| | | // - From 1 remote ECL session, |
| | | // - Test simple update to be received from 2 suffixes |
| | | /** |
| | | * Objectives |
| | | * - Test that everything is ok with changes on 2 suffixes |
| | | * Procedure |
| | | * - From 1 remote ECL session, |
| | | * - Test simple update to be received from 2 suffixes |
| | | */ |
| | | private void ECLRemoteNonEmpty() throws Exception |
| | | { |
| | | String tn = "ECLRemoteNonEmpty"; |
| | |
| | | assertTrue(entries != null, "Entries returned when test2 is ECL disabled."); |
| | | assertTrue(entries.size()==1, "#Entry="+entries.size()+"when expected is 1"); |
| | | if (entries != null) |
| | | { |
| | | for (SearchResultEntry resultEntry : entries) |
| | | { |
| | | // Expect |
| | | debugInfo(tn, "Entry returned when test2 is private =" |
| | | + resultEntry.toLDIFString()); |
| | | } |
| | | } |
| | | |
| | | // |
| | | // Test lastExternalChangelogCookie attribute of the ECL |
| | | // (does only refer to non private backend) |
| | | MultiDomainServerState expectedLastCookie = |
| | |
| | | { |
| | | // Cleaning |
| | | if (domain2 != null && baseDn2 != null) |
| | | { |
| | | MultimasterReplication.deleteDomain(baseDn2); |
| | | } |
| | | if (backend2 != null) |
| | | removeTestBackend2(backend2); |
| | | { |
| | | removeTestBackend2(backend2); |
| | | } |
| | | |
| | | stop(server01); |
| | | replicationServer.clearDb(); |
| | |
| | | // we expect msg1 + msg4 + msg5 |
| | | assertEquals(searchOp.getSearchEntries().size(), 3); |
| | | |
| | | // |
| | | // Test startState ("first cookie") of the ECL |
| | | // |
| | | // -- |
| | | s1test2 = openReplicationSession( |
| | | DN.decode(TEST_ROOT_DN_STRING2), 1203, |
| | |
| | | assertTrue(startState.getChangeNumber(s2test2.getServerId()).getSeqnum()==2); |
| | | assertTrue(startState.getChangeNumber(s1test2.getServerId()).getSeqnum()==6); |
| | | |
| | | // |
| | | // Test lastExternalChangelogCookie attribute of the ECL |
| | | // |
| | | MultiDomainServerState expectedLastCookie = |
| | | new MultiDomainServerState("o=test:"+cn5+" "+cn9+";o=test2:"+cn3+" "+cn8+";"); |
| | | |
| | |
| | | .get("o=test:;","<"+ newCookie + "o=test:;>").toString(); |
| | | assertTrue(searchOp.getErrorMessage().toString().equalsIgnoreCase(expectedError), |
| | | "Expected: " + expectedError + "Server output:" + |
| | | searchOp.getErrorMessage().toString()); |
| | | searchOp.getErrorMessage()); |
| | | } |
| | | finally |
| | | { |
| | |
| | | null); |
| | | } |
| | | |
| | | //======================================================= |
| | | // Test ECL content after replication changelogdb triming |
| | | /** Test ECL content after replication changelogdb triming */ |
| | | private void ECLAfterChangelogTrim() throws Exception |
| | | { |
| | | String tn = "ECLAfterChangelogTrim"; |
| | |
| | | |
| | | // Sleep longer than this delay - so that the changelog is trimmed |
| | | Thread.sleep(1000); |
| | | // |
| | | LDIFWriter ldifWriter = getLDIFWriter(); |
| | | |
| | | // --- |
| | |
| | | // 4. Assert that a request with the current last cookie returns nothing |
| | | cookie = readLastCookie(); |
| | | debugInfo(tn, "2. Search with last cookie=" + cookie + "\""); |
| | | searchOp = searchOnCookieChangelog("(targetDN=*)", tn, cookie, SUCCESS); |
| | | searchOp = searchOnCookieChangelog("(targetDN=*)", cookie, tn, SUCCESS); |
| | | |
| | | entries = searchOp.getSearchEntries(); |
| | | if (entries != null) |
| | |
| | | stop(server01); |
| | | // And reset changelog purge delay for the other tests. |
| | | if (d1 != null) |
| | | { |
| | | d1.setPurgeDelay(15 * 1000); |
| | | } |
| | | if (d2 != null) |
| | | { |
| | | d2.setPurgeDelay(15 * 1000); |
| | | } |
| | | |
| | | replicationServer.clearDb(); |
| | | } |
| | |
| | | String cookie = ""; |
| | | LDIFWriter ldifWriter = getLDIFWriter(); |
| | | |
| | | // |
| | | Set<String> lastcookieattribute = new LinkedHashSet<String>(); |
| | | lastcookieattribute.add("lastExternalChangelogCookie"); |
| | | |
| | |
| | | checkValue(resultEntry,"targetentryuuid",tn+"uuid4"); |
| | | checkValue(resultEntry,"newrdn","uid=ECLAllOpsnew4"); |
| | | if (newSuperior != null) |
| | | checkValue(resultEntry,"newsuperior",TEST_ROOT_DN_STRING2); |
| | | { |
| | | checkValue(resultEntry, "newsuperior", TEST_ROOT_DN_STRING2); |
| | | } |
| | | checkValue(resultEntry,"deleteoldrdn","true"); |
| | | checkValue(resultEntry,"changenumber","0"); |
| | | } |
| | |
| | | while(true) { |
| | | String s = br.readLine(); |
| | | if(s == null) |
| | | { |
| | | break; |
| | | } |
| | | if(!s.startsWith("#")) |
| | | { |
| | | continue; |
| | | } |
| | | String[] a=s.split(": "); |
| | | if(a.length != 2) |
| | | { |
| | | break; |
| | | } |
| | | ctrlList.add(a[1]); |
| | | } |
| | | } catch (IOException e) { |
| | |
| | | |
| | | oStream.reset(); |
| | | eStream.reset(); |
| | | int retVal = |
| | | LDAPSearch.mainSearch(args3, false, oStream, eStream); |
| | | Assert.assertEquals(0, retVal, "Returned error: " + eStream.toString()); |
| | | int retVal = LDAPSearch.mainSearch(args3, false, oStream, eStream); |
| | | Assert.assertEquals(0, retVal, "Returned error: " + eStream); |
| | | return oStream.toString(); |
| | | } |
| | | |
| | |
| | | "11111111-1112-1113-1114-111111111114"); |
| | | debugInfo(tn, " publishing " + delMsg.getChangeNumber()); |
| | | server01.publish(delMsg); |
| | | this.sleep(500); // let's be sure the message is in the RS |
| | | sleep(500); // let's be sure the message is in the RS |
| | | |
| | | // Creates cookie control |
| | | String cookie = ""; |
| | |
| | | LDAPMessage message; |
| | | message = new LDAPMessage(2, searchRequest, controls); |
| | | w.writeMessage(message); |
| | | this.sleep(500); |
| | | sleep(500); |
| | | |
| | | SearchResultEntryProtocolOp searchResultEntry = null; |
| | | SearchResultDoneProtocolOp searchResultDone = null; |
| | | |
| | | if (changesOnly == false) |
| | | if (!changesOnly) |
| | | { |
| | | // Wait for change 1 |
| | | debugInfo(tn, "Waiting for init search expected to return change 1"); |
| | |
| | | message = null; |
| | | |
| | | { |
| | | while ((searchEntries<1) && (message = r.readMessage()) != null) |
| | | while (searchEntries < 1 && (message = r.readMessage()) != null) |
| | | { |
| | | debugInfo(tn, "Init search Result=" + |
| | | message.getProtocolOpType() + message + " " + searchEntries); |
| | |
| | | debugInfo(tn, " publishing " + delMsg.getChangeNumber()); |
| | | server01.publish(delMsg); |
| | | this.gblCN = cn; |
| | | this.sleep(1000); |
| | | sleep(1000); |
| | | |
| | | debugInfo(tn, delMsg.getChangeNumber() + |
| | | " published , psearch will now wait for new entries"); |
| | |
| | | searchResultEntry = null; |
| | | searchResultDone = null; |
| | | message = null; |
| | | while ((searchEntries<1) && (message = r.readMessage()) != null) |
| | | while (searchEntries < 1 && (message = r.readMessage()) != null) |
| | | { |
| | | debugInfo(tn, "psearch search Result=" + |
| | | message.getProtocolOpType() + message); |
| | |
| | | // Check we received change 2 |
| | | for (LDAPAttribute a : searchResultEntry.getAttributes()) |
| | | { |
| | | if (a.getAttributeType().equalsIgnoreCase("targetDN")) |
| | | if ("targetDN".equalsIgnoreCase(a.getAttributeType())) |
| | | { |
| | | for (ByteString av : a.getValues()) |
| | | { |
| | | assertTrue(av.toString().equalsIgnoreCase(expectedDn), |
| | | "Entry returned by psearch is " + av.toString() + |
| | | "Entry returned by psearch is " + av + |
| | | " when expected is " + expectedDn); |
| | | } |
| | | } |
| | | } |
| | | debugInfo(tn, "Second search done successfully : " + searchResultEntry); |
| | | server01.stop(); |
| | | close(s); |
| | | while (!s.isClosed()) sleep(100); |
| | | waitForClose(s); |
| | | |
| | | // TODO: Testing ACI is disabled because it is currently failing when |
| | | // ran in the precommit target while it works well when running alone. |
| | |
| | | "11111111-1111-1111-1111-111111111111"); |
| | | debugInfo(tn, " publishing " + delMsg1); |
| | | server01.publish(delMsg1); |
| | | this.sleep(500); // let's be sure the message is in the RS |
| | | sleep(500); // let's be sure the message is in the RS |
| | | |
| | | // Produce update 2 |
| | | ChangeNumber cn2 = |
| | |
| | | "22222222-2222-2222-2222-222222222222"); |
| | | debugInfo(tn, " publishing " + delMsg2); |
| | | server02.publish(delMsg2); |
| | | this.sleep(500); // let's be sure the message is in the RS |
| | | sleep(500); // let's be sure the message is in the RS |
| | | |
| | | // Produce update 3 |
| | | ChangeNumber cn3 = |
| | |
| | | "33333333-3333-3333-3333-333333333333"); |
| | | debugInfo(tn, " publishing " + delMsg3); |
| | | server02.publish(delMsg3); |
| | | this.sleep(500); // let's be sure the message is in the RS |
| | | sleep(500); // let's be sure the message is in the RS |
| | | |
| | | // Creates cookie control |
| | | String cookie = ""; |
| | |
| | | LDAPMessage message; |
| | | message = new LDAPMessage(2, searchRequest1, controls); |
| | | w1.writeMessage(message); |
| | | this.sleep(500); |
| | | sleep(500); |
| | | |
| | | message = new LDAPMessage(2, searchRequest2, controls); |
| | | w2.writeMessage(message); |
| | | this.sleep(500); |
| | | sleep(500); |
| | | |
| | | message = new LDAPMessage(2, searchRequest3, controls); |
| | | w3.writeMessage(message); |
| | | this.sleep(500); |
| | | sleep(500); |
| | | |
| | | SearchResultEntryProtocolOp searchResultEntry = null; |
| | | SearchResultDoneProtocolOp searchResultDone = null; |
| | | |
| | | if (changesOnly == false) |
| | | if (!changesOnly) |
| | | { |
| | | debugInfo(tn, "Search1 Persistent filter="+searchRequest1.getFilter().toString() |
| | | debugInfo(tn, "Search1 Persistent filter=" + searchRequest1.getFilter() |
| | | + " expected to return change " + cn1); |
| | | searchEntries = 0; |
| | | message = null; |
| | | |
| | | { |
| | | while ((searchEntries<1) && (message = r1.readMessage()) != null) |
| | | while (searchEntries < 1 && (message = r1.readMessage()) != null) |
| | | { |
| | | debugInfo(tn, "Search1 Result=" + |
| | | message.getProtocolOpType() + " " + message); |
| | |
| | | searchEntries = 0; |
| | | message = null; |
| | | { |
| | | debugInfo(tn, "Search 2 Persistent filter="+searchRequest2.getFilter().toString() |
| | | debugInfo(tn, "Search 2 Persistent filter=" + searchRequest2.getFilter() |
| | | + " expected to return change " + cn2 + " & " + cn3); |
| | | while ((searchEntries<2) && (message = r2.readMessage()) != null) |
| | | while (searchEntries < 2 && (message = r2.readMessage()) != null) |
| | | { |
| | | debugInfo(tn, "Search 2 Result=" + |
| | | message.getProtocolOpType() + message); |
| | |
| | | searchEntries = 0; |
| | | message = null; |
| | | { |
| | | debugInfo(tn, "Search3 Persistent filter="+searchRequest3.getFilter().toString() |
| | | debugInfo(tn, "Search3 Persistent filter=" + searchRequest3.getFilter() |
| | | + " expected to return change top + " + cn1 + " & " + cn2 + " & " + cn3); |
| | | while ((searchEntries<4) && (message = r3.readMessage()) != null) |
| | | while (searchEntries < 4 && (message = r3.readMessage()) != null) |
| | | { |
| | | debugInfo(tn, "Search3 Result=" + |
| | | message.getProtocolOpType() + " " + message); |
| | |
| | | "44444444-4444-4444-4444-444444444444"); |
| | | debugInfo(tn, " publishing " + delMsg11); |
| | | server01.publish(delMsg11); |
| | | this.sleep(500); |
| | | sleep(500); |
| | | debugInfo(tn, delMsg11.getChangeNumber() + " published additionally "); |
| | | |
| | | // Produces additional change |
| | |
| | | "55555555-5555-5555-5555-555555555555"); |
| | | debugInfo(tn, " publishing " + delMsg12 ); |
| | | server02.publish(delMsg12); |
| | | this.sleep(500); |
| | | sleep(500); |
| | | debugInfo(tn, delMsg12.getChangeNumber() + " published additionally "); |
| | | |
| | | // Produces additional change |
| | |
| | | "66666666-6666-6666-6666-666666666666"); |
| | | debugInfo(tn, " publishing " + delMsg13); |
| | | server02.publish(delMsg13); |
| | | this.sleep(500); |
| | | sleep(500); |
| | | debugInfo(tn, delMsg13.getChangeNumber() + " published additionally "); |
| | | |
| | | // wait 11 |
| | |
| | | searchResultEntry = null; |
| | | searchResultDone = null; |
| | | message = null; |
| | | while ((searchEntries<1) && (message = r1.readMessage()) != null) |
| | | while (searchEntries < 1 && (message = r1.readMessage()) != null) |
| | | { |
| | | debugInfo(tn, "Search 11 Result=" + |
| | | message.getProtocolOpType() + " " + message); |
| | |
| | | searchResultEntry = null; |
| | | searchResultDone = null; |
| | | message = null; |
| | | while ((searchEntries<2) && (message = r2.readMessage()) != null) |
| | | while (searchEntries < 2 && (message = r2.readMessage()) != null) |
| | | { |
| | | debugInfo(tn, "psearch search 12 Result=" + |
| | | message.getProtocolOpType() + " " + message); |
| | |
| | | searchResultEntry = null; |
| | | searchResultDone = null; |
| | | message = null; |
| | | while ((searchEntries<3) && (message = r3.readMessage()) != null) |
| | | while (searchEntries < 3 && (message = r3.readMessage()) != null) |
| | | { |
| | | debugInfo(tn, "psearch search 13 Result=" + |
| | | message.getProtocolOpType() + " " + message); |
| | |
| | | // Check we received change 13 |
| | | for (LDAPAttribute a : searchResultEntry.getAttributes()) |
| | | { |
| | | if (a.getAttributeType().equalsIgnoreCase("targetDN")) |
| | | if ("targetDN".equalsIgnoreCase(a.getAttributeType())) |
| | | { |
| | | for (ByteString av : a.getValues()) |
| | | { |
| | | assertTrue(av.toString().equalsIgnoreCase(expectedDn13), |
| | | "Entry returned by psearch 13 is " + av.toString() + |
| | | "Entry returned by psearch 13 is " + av + |
| | | " when expected is " + expectedDn13); |
| | | } |
| | | } |
| | |
| | | finally |
| | | { |
| | | stop(server01, server02); |
| | | |
| | | if (s1 != null) |
| | | { |
| | | close(s1); |
| | | while (!s1.isClosed()) sleep(100); |
| | | } |
| | | if (s2 != null) |
| | | { |
| | | close(s2); |
| | | while (!s2.isClosed()) sleep(100); |
| | | } |
| | | if (s3 != null) |
| | | { |
| | | close(s3); |
| | | while (!s3.isClosed()) sleep(100); |
| | | } |
| | | waitForClose(s1, s2, s3); |
| | | replicationServer.clearDb(); |
| | | } |
| | | debugInfo(tn, "Ends test successfully"); |
| | | } |
| | | |
| | | // utility - bind as required |
| | | private void waitForClose(Socket... sockets) throws InterruptedException |
| | | { |
| | | for (Socket s : sockets) |
| | | { |
| | | if (s != null) |
| | | { |
| | | close(s); |
| | | while (!s.isClosed()) |
| | | { |
| | | sleep(100); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** utility - bind as required */ |
| | | private void bindAsManager(LDAPWriter w, org.opends.server.tools.LDAPReader r) |
| | | throws Exception |
| | | { |
| | |
| | | "cn=Directory Manager", "password", LDAPResultCode.SUCCESS); |
| | | } |
| | | |
| | | // utility - bind as required |
| | | /** utility - bind as required */ |
| | | private void bindAsWhoEver(LDAPWriter w, org.opends.server.tools.LDAPReader r, |
| | | String bindDN, String password, int expected) throws Exception |
| | | { |
| | |
| | | DirectoryServer.deregisterBackend(memoryBackend); |
| | | } |
| | | |
| | | //======================================================= |
| | | private void ChangeTimeHeartbeatTest() throws Exception |
| | | { |
| | | String tn = "ChangeTimeHeartbeatTest"; |
| | |
| | | { |
| | | stop(s1test2, s2test2); |
| | | if (backend2 != null) |
| | | { |
| | | removeTestBackend2(backend2); |
| | | } |
| | | stop(s1test, s2test); |
| | | |
| | | replicationServer.clearDb(); |
| | |
| | | checkValue(resultEntry,"replicaidentifier","1201"); |
| | | checkValue(resultEntry,"targetdn","uid="+tn+"1," + TEST_ROOT_DN_STRING); |
| | | checkValue(resultEntry,"changetype","delete"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+cn1.toString()+";"); |
| | | checkValue(resultEntry, "changelogcookie", "o=test:" + cn1 + ";"); |
| | | checkValue(resultEntry,"targetentryuuid",user1entryUUID); |
| | | checkValue(resultEntry,"changenumber",String.valueOf(firstDraftChangeNumber+0)); |
| | | checkValue(resultEntry,"targetuniqueid",user1entryUUID); |
| | |
| | | checkValue(resultEntry,"replicaidentifier","1201"); |
| | | checkValue(resultEntry,"targetdn","uid="+tn+"2," + TEST_ROOT_DN_STRING); |
| | | checkValue(resultEntry,"changetype","add"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+gblCN.toString()+";"); |
| | | checkValue(resultEntry, "changelogcookie", "o=test:" + gblCN + ";"); |
| | | checkValue(resultEntry,"targetentryuuid",user1entryUUID); |
| | | checkValue(resultEntry,"changenumber",String.valueOf(firstDraftChangeNumber+1)); |
| | | } else if (i==3) |
| | |
| | | checkValue(resultEntry,"replicaidentifier","1201"); |
| | | checkValue(resultEntry,"targetdn","uid="+tn+"3," + TEST_ROOT_DN_STRING); |
| | | checkValue(resultEntry,"changetype","modify"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+cn3.toString()+";"); |
| | | checkValue(resultEntry, "changelogcookie", "o=test:" + cn3 + ";"); |
| | | checkValue(resultEntry,"targetentryuuid",user1entryUUID); |
| | | checkValue(resultEntry,"changenumber",String.valueOf(firstDraftChangeNumber+2)); |
| | | } else if (i==4) |
| | |
| | | checkValue(resultEntry,"replicaidentifier","1201"); |
| | | checkValue(resultEntry,"targetdn","uid="+tn+"4," + TEST_ROOT_DN_STRING); |
| | | checkValue(resultEntry,"changetype","modrdn"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+cn4.toString()+";"); |
| | | checkValue(resultEntry, "changelogcookie", "o=test:" + cn4 + ";"); |
| | | checkValue(resultEntry,"targetentryuuid",user1entryUUID); |
| | | checkValue(resultEntry,"newrdn","uid="+tn+"new4"); |
| | | checkValue(resultEntry,"newsuperior",TEST_ROOT_DN_STRING2); |
| | |
| | | debugInfo(tn, "Result entry returned:" + resultEntry.toLDIFString()); |
| | | ldifWriter.writeEntry(resultEntry); |
| | | // check the entry has the right content |
| | | assertTrue(resultEntry.getDN().toNormalizedString().equalsIgnoreCase( |
| | | "changenumber=6,cn=changelog")); |
| | | assertTrue("changenumber=6,cn=changelog".equalsIgnoreCase(resultEntry |
| | | .getDN().toNormalizedString())); |
| | | checkValue(resultEntry,"replicationcsn",gblCN.toString()); |
| | | checkValue(resultEntry,"replicaidentifier","1201"); |
| | | checkValue(resultEntry,"changetype","add"); |
| | |
| | | |
| | | String targetdn = getAttributeValue(resultEntry, "targetdn"); |
| | | |
| | | if ((targetdn.endsWith("cn=robert hue,o=test3")) |
| | | ||(targetdn.endsWith("cn=robert hue2,o=test3"))) |
| | | if (targetdn.endsWith("cn=robert hue,o=test3") |
| | | || targetdn.endsWith("cn=robert hue2,o=test3")) |
| | | { |
| | | Entry targetEntry = parseIncludedAttributes(resultEntry, targetdn); |
| | | |
| | |
| | | checkValues(targetEntry, "objectclass", eoc); |
| | | |
| | | String changeType = getAttributeValue(resultEntry, "changetype"); |
| | | if (changeType.equals("delete")) |
| | | if ("delete".equals(changeType)) |
| | | { |
| | | // We are using "*" for deletes so should get back 4 attributes. |
| | | assertEquals(targetEntry.getAttributes().size(), 4); |
| | |
| | | |
| | | // Cleaning |
| | | if (domain21 != null) |
| | | { |
| | | domain21.shutdown(); |
| | | } |
| | | |
| | | if (domain2 != null) |
| | | { |
| | | MultimasterReplication.deleteDomain(baseDn2); |
| | | } |
| | | removeTestBackend2(backend2); |
| | | |
| | | if (domain3 != null) |
| | | { |
| | | MultimasterReplication.deleteDomain(baseDn3); |
| | | } |
| | | removeTestBackend2(backend3); |
| | | } |
| | | finally |
| | |
| | | String[] ldif = new String[ldifAttributeLines.length + 1]; |
| | | System.arraycopy(ldifAttributeLines, 0, ldif, 1, ldifAttributeLines.length); |
| | | ldif[0] = "dn: " + targetdn; |
| | | Entry targetEntry = TestCaseUtils.makeEntry(ldif); |
| | | return targetEntry; |
| | | return TestCaseUtils.makeEntry(ldif); |
| | | } |
| | | |
| | | private void waitOpResult(Operation operation, ResultCode expectedResult) |
| | | throws Exception |
| | | { |
| | | int ii=0; |
| | | while((operation.getResultCode()==ResultCode.UNDEFINED) || |
| | | (operation.getResultCode()!=expectedResult)) |
| | | while (operation.getResultCode() == ResultCode.UNDEFINED |
| | | || operation.getResultCode() != expectedResult) |
| | | { |
| | | sleep(50); |
| | | ii++; |
| | | if (ii>10) |
| | | assertEquals(operation.getResultCode(), expectedResult, |
| | | operation.getErrorMessage().toString()); |
| | | { |
| | | assertEquals(operation.getResultCode(), expectedResult, operation |
| | | .getErrorMessage().toString()); |
| | | } |
| | | } |
| | | } |
| | | } |