| | |
| | | log("Broker " + serverID + " receives and trashes " + msg); |
| | | } |
| | | } |
| | | catch (SocketTimeoutException e) |
| | | { |
| | | log("SocketTimeoutException while waiting fro entries" + |
| | | stackTraceToSingleLineString(e)); |
| | | } |
| | | catch(Exception e) |
| | | { |
| | | log("receiveUpdatedEntries" + stackTraceToSingleLineString(e)); |
| | |
| | | DirectoryServer.getConfigHandler().addEntry(synchroServerEntry, null); |
| | | assertNotNull(DirectoryServer.getConfigEntry(synchroServerEntry.getDN()), |
| | | "Unable to add the synchronized server"); |
| | | super.configEntryList.add(synchroServerEntry.getDN()); |
| | | |
| | | replDomain = ReplicationDomain.retrievesReplicationDomain(baseDn); |
| | | |
| | |
| | | /** |
| | | * Tests the import side of the Initialize task |
| | | */ |
| | | @Test(enabled=false) |
| | | @Test(enabled=true) |
| | | public void initializeImport() throws Exception |
| | | { |
| | | String testCase = "InitializeImport"; |
| | |
| | | /** |
| | | * Tests the export side of the Initialize task |
| | | */ |
| | | @Test(enabled=false) |
| | | @Test(enabled=true) |
| | | public void initializeExport() throws Exception |
| | | { |
| | | String testCase = "Replication/InitializeExport"; |
| | |
| | | /** |
| | | * Tests the import side of the InitializeTarget task |
| | | */ |
| | | @Test(enabled=false) |
| | | @Test(enabled=true) |
| | | public void initializeTargetExport() throws Exception |
| | | { |
| | | String testCase = "Replication/InitializeTargetExport"; |
| | |
| | | /** |
| | | * Tests the import side of the InitializeTarget task |
| | | */ |
| | | @Test(enabled=false) |
| | | @Test(enabled=true) |
| | | public void initializeTargetExportAll() throws Exception |
| | | { |
| | | String testCase = "Replication/InitializeTargetExportAll"; |
| | |
| | | server2 = openReplicationSession(DN.decode("dc=example,dc=com"), |
| | | server2ID, 100, getChangelogPort(changelog1ID), 1000, emptyOldChanges); |
| | | |
| | | ReplicationBroker server3 = openReplicationSession(DN.decode("dc=example,dc=com"), |
| | | if (server3==null) |
| | | server3 = openReplicationSession(DN.decode("dc=example,dc=com"), |
| | | server3ID, 100, getChangelogPort(changelog1ID), 1000, emptyOldChanges); |
| | | |
| | | Thread.sleep(1000); |
| | |
| | | /** |
| | | * Tests the import side of the InitializeTarget task |
| | | */ |
| | | @Test(enabled=false) |
| | | @Test(enabled=true) |
| | | public void initializeTargetImport() throws Exception |
| | | { |
| | | String testCase = "InitializeTargetImport"; |
| | |
| | | /** |
| | | * Tests the import side of the InitializeTarget task |
| | | */ |
| | | @Test(enabled=false) |
| | | @Test(enabled=true) |
| | | public void initializeConfigErrors() throws Exception |
| | | { |
| | | String testCase = "InitializeConfigErrors"; |
| | |
| | | * ReplServerInfoMessage(s) exchanged by the replication |
| | | * servers. |
| | | */ |
| | | @Test(enabled=false) |
| | | @Test(enabled=true) |
| | | public void testReplServerInfos() throws Exception |
| | | { |
| | | String testCase = "Replication/TestReplServerInfos"; |
| | |
| | | |
| | | // Connects lDAP1 to replServer1 |
| | | connectServer1ToChangelog(changelog1ID); |
| | | |
| | | |
| | | // Connects lDAP2 to replServer2 |
| | | ReplicationBroker broker2 = |
| | | openReplicationSession(DN.decode("dc=example,dc=com"), |
| | |
| | | @Test(enabled=false) |
| | | public void initializeTargetExportMultiSS() throws Exception |
| | | { |
| | | String testCase = "Replication/InitializeTargetExportMultiSS"; |
| | | |
| | | log("Starting " + testCase); |
| | | |
| | | // Create 2 changelogs |
| | | changelog1 = createChangelogServer(changelog1ID); |
| | | |
| | | changelog2 = createChangelogServer(changelog2ID); |
| | | |
| | | // Creates config to synchronize suffix |
| | | connectServer1ToChangelog(changelog1ID); |
| | | |
| | | // Add in S1 the entries to be exported |
| | | addTestEntriesToDB(); |
| | | |
| | | // S1 is the server we are running in, S2 is simulated by a broker |
| | | // connected to changelog2 |
| | | if (server2 == null) |
| | | try |
| | | { |
| | | server2 = openReplicationSession(DN.decode("dc=example,dc=com"), |
| | | server2ID, 100, getChangelogPort(changelog2ID), 1000, emptyOldChanges); |
| | | String testCase = "Replication/InitializeTargetExportMultiSS"; |
| | | |
| | | log("Starting " + testCase); |
| | | |
| | | // Create 2 changelogs |
| | | changelog1 = createChangelogServer(changelog1ID); |
| | | |
| | | changelog2 = createChangelogServer(changelog2ID); |
| | | |
| | | // Creates config to synchronize suffix |
| | | connectServer1ToChangelog(changelog1ID); |
| | | |
| | | // Add in S1 the entries to be exported |
| | | addTestEntriesToDB(); |
| | | |
| | | // S1 is the server we are running in, S2 is simulated by a broker |
| | | // connected to changelog2 |
| | | if (server2 == null) |
| | | { |
| | | server2 = openReplicationSession(DN.decode("dc=example,dc=com"), |
| | | server2ID, 100, getChangelogPort(changelog2ID), 1000, emptyOldChanges); |
| | | } |
| | | |
| | | Thread.sleep(1000); |
| | | |
| | | // Launch in S1 the task that will initialize S2 |
| | | addTask(taskInitTargetS2, ResultCode.SUCCESS, null); |
| | | |
| | | // Wait for task completion |
| | | waitTaskState(taskInitTargetS2, TaskState.COMPLETED_SUCCESSFULLY, null); |
| | | |
| | | // Tests that entries have been received by S2 |
| | | receiveUpdatedEntries(server2, server2ID, updatedEntries); |
| | | |
| | | log("Successfully ending " + testCase); |
| | | } |
| | | finally |
| | | { |
| | | afterTest(); |
| | | |
| | | Thread.sleep(1000); |
| | | |
| | | // Launch in S1 the task that will initialize S2 |
| | | addTask(taskInitTargetS2, ResultCode.SUCCESS, null); |
| | | |
| | | // Wait for task completion |
| | | waitTaskState(taskInitTargetS2, TaskState.COMPLETED_SUCCESSFULLY, null); |
| | | |
| | | // Tests that entries have been received by S2 |
| | | receiveUpdatedEntries(server2, server2ID, updatedEntries); |
| | | |
| | | afterTest(); |
| | | |
| | | changelog2.shutdown(); |
| | | changelog2 = null; |
| | | |
| | | log("Successfully ending " + testCase); |
| | | |
| | | changelog2.shutdown(); |
| | | changelog2 = null; |
| | | } |
| | | } |
| | | |
| | | @Test(enabled=false) |
| | | @Test(enabled=true) |
| | | public void initializeExportMultiSS() throws Exception |
| | | { |
| | | String testCase = "Replication/InitializeExportMultiSS"; |