| | |
| | | debugInfo(testCase + " ** TEST ** The part of the topology with the right gen ID should work well"); |
| | | |
| | | // Now create a change that must be replicated |
| | | assertConnectedToReplicationDomain(); |
| | | waitConnectionToReplicationDomain(baseDN, 1000); |
| | | addTestEntriesToDB(createEntry(UUID.randomUUID())); |
| | | |
| | | // Verify that RS1 does contain the change related to this ADD. |
| | |
| | | "Expecting that DS3 with old gen ID is in bad gen id from RS1"); |
| | | |
| | | debugInfo("Add entries to DS1, update should not be sent to DS2 and DS3 that are in bad gen id"); |
| | | assertConnectedToReplicationDomain(); |
| | | waitConnectionToReplicationDomain(baseDN, 1000); |
| | | addTestEntriesToDB(createEntry(UUID.randomUUID())); |
| | | |
| | | debugInfo("RS1 must have stored that update."); |
| | |
| | | } |
| | | } |
| | | |
| | | private void assertConnectedToReplicationDomain() |
| | | /** |
| | | * Waits for the connection from server1 to the replication domain to |
| | | * establish itself up automagically. |
| | | */ |
| | | private void waitConnectionToReplicationDomain(DN baseDN, int timeout) |
| | | { |
| | | long start = System.currentTimeMillis(); |
| | | while (System.currentTimeMillis() - start <= timeout) |
| | | { |
| | | LDAPReplicationDomain domain = MultimasterReplication.findDomain(baseDN, null); |
| | | if (domain != null && domain.isConnected()) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | assertTrue(MultimasterReplication.findDomain(baseDN, null).isConnected(), |
| | | "The server should be connected to replication domain" + baseDN |
| | | + " at this point"); |
| | | "After waiting " + (System.currentTimeMillis() - start) |
| | | + " ms, server should have been connected to replication domain " |
| | | + baseDN); |
| | | } |
| | | |
| | | private Entry createSetGenerationIdTask(Long genId, String additionalAttribute) throws Exception |
| | |
| | | assertEquals(readGenIdFromSuffixRootEntry(), -1, |
| | | "genId attribute should not be retrievable since there are NO entry in the backend"); |
| | | |
| | | assertConnectedToReplicationDomain(); |
| | | waitConnectionToReplicationDomain(baseDN, 1000); |
| | | addTestEntriesToDB(updatedEntries); |
| | | assertEquals(readGenIdFromSuffixRootEntry(), EMPTY_DN_GENID, |
| | | "genId attribute should be retrievable since there IS one entry in the backend"); |