26 Aug, 2013
2 commits
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9456 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Introduced interfaces ChangelogDB and ChangelogDBIterator to remove direct dependencies to org.opends.server.replication.server.changelog.je . The interfaces remain similar to the old classes DraftCNDbHandler and DraftCNDbIterator, but: - I plan to introduce more changes to rework a bit these interfaces - They reduce the number of accessible methods for client code ChangelogDB.java: ADDED Renamed getValue() to getPreviousCookie(). ChangelogDBIterator.java: ADDED Renamed releaseCursor() to close(). *.java: Consequence of the use of the new interfaces. Renamed instance variables, local variables and method parameters to accommodate the new classes. Also renamed variables and methods to better explicit their role. Also reworked javadocs and comments. ReplicationServer.java: Extracted method contains(). In getEligibleCN(), reworked the code to avoid computing debug information if debug is off. Renamed local variables. Removed useless comments. DraftCNDB.java: Removed unused instance member ReplicationServer. DraftCNDbHandler.java: Now implements ChangelogDB. Consequence of change to DraftCNDB. Extracted method debugException(). Removed releaseReadCursor() (Replaced by StaticUtils.close()). DraftCNDbIterator.java: Now implements ChangelogDBIterator. TestCaseUtils.java: In deleteDirectory(), added a null check and an exists check. DbHandlerTest.java, DraftCNDbHandlerTest.java: Extracted method createCleanDir(). Removed now useless checks before calling TestCaseUtils.deleteDirectory(). Called StaticUtils.close(). Extracted method assertIteratorReadsInOrder(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9455 41b1ffd8-f28e-4786-ab96-9950f0a78031
23 Aug, 2013
2 commits
-
Removed test on number of entries returned: Eclipse gives me 33, command line run gives me 34, while Jenkins run gives me 32!!! What a deterministic test! git-svn-id: https://svn.forgerock.org/opendj/trunk@9453 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Fixed a bug introduced in r9449. ReplicationServerTest.java: Extracted several methods to simplify this test. git-svn-id: https://svn.forgerock.org/opendj/trunk@9452 41b1ffd8-f28e-4786-ab96-9950f0a78031
22 Aug, 2013
2 commits
-
Renamed releaseCursor() to close(). Now extends Closeable. *.java: Consequence of the change to ReplicationIterator. MessageHandler.java: Removed releaseAllIterators() in favour of StaticUtils.close(). ReplicationBackend.java: In getEntry(), used early exit. Used StaticUtils.close(). Removed useless comments / code. Used interfaces rather than concrete classes. Extracted methods computeDN() and writeChangeRecord(). ReplicationServerDomain.java: Removed sleep() replaced with StaticUtils.sleep(). StaticUtils.java: Made close(Collection) more generic + now log exceptions happening when closing. git-svn-id: https://svn.forgerock.org/opendj/trunk@9446 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Code cleanup. MonitoringPublisher.java: Removed one call to a setter. ReplicationDomainMonitor.java: Renamed computeDomainMonitorData() to recomputeMonitorData(). ReplicationServerDomain.java: Renamed replyWithMonitorMsg() to replyWithTopologyMonitorMsg(). ReplicationDomainTest.java: Extracted methods createReplicationServer(), assertExpectedServerStatuses(), disable(), remove(). Replaced assertTrue() with assertEquals(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9439 41b1ffd8-f28e-4786-ab96-9950f0a78031
20 Aug, 2013
2 commits
-
Fixed off-by-one error. FractionalReplicationTest.java: Removed try / catch / fail test anti pattern. Removed useless comments. Extracted method waitTillEntryHasSynchroAttribute(). Made attributes private. git-svn-id: https://svn.forgerock.org/opendj/trunk@9432 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
It was due to a side effect of the last commit as well as several locations where cleanup wasn't properly done after a test. git-svn-id: https://svn.forgerock.org/opendj/trunk@9429 41b1ffd8-f28e-4786-ab96-9950f0a78031
19 Aug, 2013
1 commit
-
…nknown function paramter - Added README to explain how to start the STAF daemon and run the tests git-svn-id: https://svn.forgerock.org/opendj/trunk@9425 41b1ffd8-f28e-4786-ab96-9950f0a78031
14 Aug, 2013
3 commits
-
Renamed directoryServers to connectedDSs. Renamed replicationServers to connectedRSs. Removed the useless getConnectedLDAPservers(), replaced with getConnectedDSs(). Renamed a few local variables. DataServerHandler.java: Consequence of removing to ReplicationServerDomain.getConnectedLDAPservers() Extracted method changeStatus() from changeStatusFromStatusAnalyzer() and changeStatusForResetGenId(). Extracted method getStatusMachineEvent() from changeStatusForResetGenId(). InitOnLineTest.java Consequence of removing to ReplicationServerDomain.getConnectedLDAPservers(). Removed useless try / catch / fail. Extracted methods getCompletionTime(), assertAttributeValue(). Used Assertions.assertThat(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9418 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
- Updated i18n/datacomparison reference file git-svn-id: https://svn.forgerock.org/opendj/trunk@9417 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Removed ReplicationServerDomain.getReplicationServer() to follow the Law of Demeter: "Only talk to your immediate friends." to promote loose coupling. Changed approxFirstMissingDate from Long object to long primitive. ReplicationServerDomain.java: Removed getReplicationServer(). Added getLocalRSMonitorInstanceName() and getLocalRSServerId(). *.java: Used the newly added ReplicationServerDomain.getLocalRSMonitorInstanceName() and ReplicationServerDomain.getLocalRSServerId(). LightweightServerHandler.java: Removed getLocalRSMonitorInstanceName(). MonitorMsg.java, MonitorData.java: Changed firstMissingDate from Long object to long primitive. Used StringBuilder in toString(). SynchronizationMsgTest.java Changed approxFirstMissingDate from Long object to long primitive. Extracted methods newList(), newSet(), getEntryAttributes(), assertAttributesEqual(). Used assertEquals() instead of assertTrue(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9415 41b1ffd8-f28e-4786-ab96-9950f0a78031
13 Aug, 2013
3 commits
-
Moved all JE changelog related classes to the new package org.opends.server.replication.server.changelog.je DbHandler.java, DraftCNData.java, DraftCNDB.java, DraftCNDbHandler.java, DraftCNDbIterator.java, JEReplicationIterator.java, package-info.java, ReplicationData.java, ReplicationDB.java, ReplicationDbEnv.java, ReplicationDraftCNKey.java, DbHandlerTest.java, DraftCNDbHandlerTest.java: Moved to package org.opends.server.replication.server.changelog.je ReplicationServer.java: Updated the imports. Made getTrimAge() public. Removed use of "this" from method invocation. Moved handleUnexpectedChangelogException() to ReplicationDbEnv. DraftCNDB.java, ReplicationDB.java: Moved handleUnexpectedDatabaseException() to ReplicationDbEnv. ReplicationDbEnv.java: Moved handleUnexpectedChangelogException() here from ReplicationServer, and renamed it to shutdownOnException(). Moved handleUnexpectedDatabaseException() here from DraftCNDB and ReplicationDB, and renamed it to shutdownOnException(). ECLServerHandler.java, ReplicationServerDomain.java, ExternalChangeLogTest.java: Updated the imports. git-svn-id: https://svn.forgerock.org/opendj/trunk@9411 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Extracted interface org.opends.server.replication.server.changelog.api.ReplicationIterator from org.opends.server.replication.server.ReplicationIterator and used it in all the places where the class was used. Renamed ReplicationIterator class to JEReplicationIterator. Moved ReplicationIteratorComparator from package org.opends.server.replication.server to org.opends.server.replication.server.changelog.api. MessageHandler.java: Minimal code cleanup. git-svn-id: https://svn.forgerock.org/opendj/trunk@9409 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Extracted constants SERVER_ID_1 and SERVER_ID_2. Renamed getAttributeValue() to getAttributeValueOrNull(). Extracted new getAttributeValue() from getAttributeValueOrNull(), checkValue() and checkPossibleValues(). In ECLGetEligibleCountTest(), extracted constants to better explicit the code + removed the count local variable + extracted method now() Removed useless code blocks. ReplicationServerDomain.java: In getEligibleCount(), removed a useless if statement. git-svn-id: https://svn.forgerock.org/opendj/trunk@9406 41b1ffd8-f28e-4786-ab96-9950f0a78031
12 Aug, 2013
1 commit
-
Removed another 200 lines. Extracted several methods: newSet(), generateChangeNumbers(), checkDn(), assertDnEquals(), debugAndWriteEntries(), createDomain(), runDeleteOperation(), assertOnlyDoneMsgReceived. Removed useless / unused / plain wrong code. Removed commented out code. assertTrue() => assertEquals(). Used assertj assertThat(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9398 41b1ffd8-f28e-4786-ab96-9950f0a78031
09 Aug, 2013
6 commits
-
In ECLTwoDomains(), inverted 2 parameters to fix another test failure. git-svn-id: https://svn.forgerock.org/opendj/trunk@9396 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
In ECLAfterChangelogTrim(), inverted 2 parameters to fix a test failure. Used AutoRefactor plugin. Extracted method waitForClose(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9394 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Improved javadocs. ExternalChangeLogTest.java: In ECLTwoDomains(), fixed the test. Extracted runModifyOperation() and createMods(). PersistentSearchChangeType.java, ChangeOperationType.java: Improved javadocs. Increased vertical density. Code cleanup. LDAPReplicationDomain.java: Added comments / javadocs. DraftCNDB.java: Used static import to put if conditions on just one line. git-svn-id: https://svn.forgerock.org/opendj/trunk@9393 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Knocked off 500 lines of code by extracting various methods. This makes the code easier to read even though it is still sometimes puzzling. git-svn-id: https://svn.forgerock.org/opendj/trunk@9392 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Removed 400 lines of code by: - Used TestCaseUtils.findFreePort(). - Removed try / catch / fail test anti pattern + let the exceptions go up the stack. - Extracted methods stop(), assertEntries(). - Used interfaces instead of concrete classes. - Converting comments to javadocs. - Removed useless parameters in readLastCookie(). - Removed unnecessary creations of new String objects. - Removed unnecessary calls to toString() in string concatenations. - Reduced variable scopes. - Put code on one line to ease reading. git-svn-id: https://svn.forgerock.org/opendj/trunk@9390 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Used TestCaseUtils.findFreePort() instead of TestCaseUtils.bindFreePort(). Used StaticUtils.close(). Various refactorings: - Extracted a few simple methods - Comments to javadocs - Removed dead code - Inlined unnecessary local variables git-svn-id: https://svn.forgerock.org/opendj/trunk@9389 41b1ffd8-f28e-4786-ab96-9950f0a78031
08 Aug, 2013
1 commit
-
Changed count() return type from int to long. Removed a useless parameter from ReplicationIterator ctor. Various code cleanups in other classes. ReplicationDB.java: Extracted methods: - intializeCounters() from ctor. - insertCounterRecordIfNeeded() and newCounterRecord() from addEntries(). - toChangeNumber(byte[]) - getRegularRecord() from getPreviousChangeNumber(). - findFirstCounterRecordAfterStartPoint(), findFirstCounterRecordBeforeStopPoint() and computeDistance() from count(). Created method createReplicationKey() and moved ReplicationKey code there. In readFirstChange(), readLastChange(), getPreviousChangeNumber(), Renamed closeLockedCursor() to closeAndReleaseReadLock(). Renamed isaCounter() to isACounterRecord(). Changed count() return type from int to long. ReplicationKey.java: REMOVED Moved code to ReplicationDB.createReplicationKey(). ReplicationIterator.java In ctor, removed unused parameter id. DbHandler.java: Consequence of the change to ReplicationIterator ctor. Consequence of the change to ReplicationDB.count(). DbHandlerTest.java: Consequence of the change to ReplicationDB.count(). Extracted methods configureReplicationServer(), getReplicationDbPath(), createDirectory(), assertFoundInOrder(), assertNotFound(). TestCaseUtils.java: Added findFreePort(), findFreePorts(). bindFreePort() now delegates to bindPort(). ReplicationDbEnv.java: Renamed local variables for increased readability. git-svn-id: https://svn.forgerock.org/opendj/trunk@9386 41b1ffd8-f28e-4786-ab96-9950f0a78031
07 Aug, 2013
3 commits
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9381 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Inlined the testModify() method that does not take a Modification parameter. In the remaining testModify() method, moved the Modification parameter to be the last parameter. In buildMod(), removed a condition that became unnecessary after modifying the method calls to not pass down null. Transformed multi-line comments into one line comments where it fits. git-svn-id: https://svn.forgerock.org/opendj/trunk@9377 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
In testHistorical(), removed the EntryHistorical parameter (unused). Merged buildModWith2Vals() into buildMod(). Extracted method buildSyncHist() and assertContainsOnlyValues(). Removed useless try / catch. Removed useless if statements. Put all the calls to testModify() over one line only to ease readability. git-svn-id: https://svn.forgerock.org/opendj/trunk@9376 41b1ffd8-f28e-4786-ab96-9950f0a78031
06 Aug, 2013
1 commit
-
In getDomainIterator(), never return null. Extracted methods findExportContainers() and findSearchContainers() Comments => javadocs. Concrete classes => interfaces. *.java: Removed null checks on the result of ReplicationServer.getDomainIterator(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9373 41b1ffd8-f28e-4786-ab96-9950f0a78031
05 Aug, 2013
2 commits
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9360 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9359 41b1ffd8-f28e-4786-ab96-9950f0a78031
02 Aug, 2013
3 commits
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9354 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9353 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9350 41b1ffd8-f28e-4786-ab96-9950f0a78031
01 Aug, 2013
4 commits
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9347 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
LDAPAttribute.java: In ctor, used attribute.getNameWithOptions() to remove duplicated code. *.java: Used interfaces instead of concrete classes. git-svn-id: https://svn.forgerock.org/opendj/trunk@9343 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9342 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Partly reverted r9316, but improved the original code by testing that the result of ldapcompare is COMPARE_TRUE. git-svn-id: https://svn.forgerock.org/opendj/trunk@9335 41b1ffd8-f28e-4786-ab96-9950f0a78031
31 Jul, 2013
4 commits
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9332 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9331 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
=> fixed fractional-replication/exclude testcase => fixed aci/compare_entry testcase git-svn-id: https://svn.forgerock.org/opendj/trunk@9330 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9322 41b1ffd8-f28e-4786-ab96-9950f0a78031