| | |
| | | import static org.testng.Assert.assertNotNull; |
| | | import static org.testng.Assert.assertTrue; |
| | | import static org.testng.Assert.fail; |
| | | import static org.opends.server.loggers.ErrorLogger.logError; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.ByteArrayOutputStream; |
| | |
| | | // Write additional changes and read ECL from a provided draft change number |
| | | ts = ECLCompatWriteReadAllOps(5);replicationServer.clearDb(); |
| | | |
| | | // ECLIncludeAttributes();replicationServer.clearDb(); |
| | | ECLIncludeAttributes();replicationServer.clearDb(); |
| | | } |
| | | |
| | | @Test(enabled=true, groups="slow", dependsOnMethods = { "ECLReplicationServerTest"}) |
| | |
| | | ECLRemoteNonEmpty();replicationServer.clearDb(); |
| | | |
| | | // Test with a mix of domains, a mix of DSes |
| | | //ECLTwoDomains(); |
| | | ECLTwoDomains(); |
| | | // changelogDb required NOT empty for the next test |
| | | |
| | | // Test ECL after changelog triming |
| | |
| | | // test success |
| | | waitOpResult(searchOp, ResultCode.SUCCESS); |
| | | // test 4 entries returned |
| | | String cookie1 = "o=test:"+cn1.toString()+";o=test2:;"; |
| | | String cookie2 = "o=test:"+cn2.toString()+";o=test2:;"; |
| | | String cookie3 = "o=test:"+cn3.toString()+";o=test2:;"; |
| | | String cookie4 = "o=test:"+cn4.toString()+";o=test2:;"; |
| | | String cookie1 = "o=test:"+cn1.toString()+";"; |
| | | String cookie2 = "o=test:"+cn2.toString()+";"; |
| | | String cookie3 = "o=test:"+cn3.toString()+";"; |
| | | String cookie4 = "o=test:"+cn4.toString()+";"; |
| | | |
| | | assertEquals(searchOp.getSearchEntries().size(), 4); |
| | | LinkedList<SearchResultEntry> entries = searchOp.getSearchEntries(); |
| | |
| | | s2 = new Socket("127.0.0.1", TestCaseUtils.getServerLdapPort()); |
| | | org.opends.server.tools.LDAPReader r2 = new org.opends.server.tools.LDAPReader(s2); |
| | | LDAPWriter w2 = new LDAPWriter(s2); |
| | | s2.setSoTimeout(15000); |
| | | s2.setSoTimeout(30000); |
| | | bindAsManager(w2, r2); |
| | | |
| | | // Connects and bind |
| | |
| | | private static void removeTestBackend2(Backend backend) |
| | | { |
| | | MemoryBackend memoryBackend = (MemoryBackend)backend; |
| | | memoryBackend.clearMemoryBackend(); |
| | | memoryBackend.finalizeBackend(); |
| | | DirectoryServer.deregisterBackend(memoryBackend); |
| | | } |
| | |
| | | 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()+";o=test2:;"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+cn1.toString()+";"); |
| | | checkValue(resultEntry,"targetentryuuid",user1entryUUID); |
| | | checkValue(resultEntry,"changenumber",String.valueOf(firstDraftChangeNumber+0)); |
| | | checkValue(resultEntry,"targetuniqueid","11111111-11121113-11141111-11111115"); |
| | |
| | | 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()+";o=test2:;"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+gblCN.toString()+";"); |
| | | 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()+";o=test2:;"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+cn3.toString()+";"); |
| | | 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()+";o=test2:;"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+cn4.toString()+";"); |
| | | checkValue(resultEntry,"targetentryuuid",user1entryUUID); |
| | | checkValue(resultEntry,"newrdn","uid="+tn+"new4"); |
| | | checkValue(resultEntry,"newsuperior",TEST_ROOT_DN_STRING2); |
| | |
| | | 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()+";o=test2:;"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+cn1.toString()+";"); |
| | | checkValue(resultEntry,"targetentryuuid",user1entryUUID); |
| | | checkValue(resultEntry,"changenumber",String.valueOf(firstDraftChangeNumber+0)); |
| | | checkValue(resultEntry,"targetuniqueid","11111111-11121113-11141111-11111115"); |
| | |
| | | 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()+";o=test2:;"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+gblCN.toString()+";"); |
| | | 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()+";o=test2:;"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+cn3.toString()+";"); |
| | | 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()+";o=test2:;"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+cn4.toString()+";"); |
| | | checkValue(resultEntry,"targetentryuuid",user1entryUUID); |
| | | checkValue(resultEntry,"newrdn","uid="+tn+"new4"); |
| | | checkValue(resultEntry,"newsuperior",TEST_ROOT_DN_STRING2); |
| | |
| | | checkValue(resultEntry,"replicationcsn",gblCN.toString()); |
| | | checkValue(resultEntry,"replicaidentifier","1201"); |
| | | checkValue(resultEntry,"changetype","add"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+gblCN.toString()+";o=test2:;"); |
| | | checkValue(resultEntry,"changelogcookie","o=test:"+gblCN.toString()+";"); |
| | | checkValue(resultEntry,"targetentryuuid",user1entryUUID); |
| | | checkValue(resultEntry,"changenumber","6"); |
| | | } |
| | |
| | | waitOpResult(searchOp, ResultCode.SUCCESS); |
| | | LinkedList<SearchResultEntry> entries = searchOp.getSearchEntries(); |
| | | |
| | | sleep(2000); |
| | | |
| | | assertTrue(entries != null); |
| | | String s = tn + " entries returned= "; |