26 Sep, 2013

7 commits

  • Undoing the rushed r9606 because:
    - In buildAndPublishMissingChanges(), the parameter was used in the tests
    - There were unintended changes in this
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9607 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • 
    LDAPReplicationDomain.java:
    In buildAndPublishMissingChanges(), removed ReplicationBroker parameter and used broker field instead.
    
    
    *Test.java:
    Removed try / catch / fail test anti pattern.
    Inlined local variables.
    
    AssuredReplicationPluginTest.java:
    Extracted methods assertBlockedForLessThanTimeout() assertBlockedLongerThanTimeout(), 
    Inlined sleep().
    In getErrorsByServers(), improved the code.
    
    ReplicationServerTest.java:
    Split changelogChaining() test into changelogChaining0() and changelogChaining1() to match the previous double testing + then simplified the code.
    Extracted methods receiveReplicationMsgs(), assertOnlyTopologyMsgsReceived().
    Used CSNGenerator.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9606 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • *Msg.java:
    Used DN.toNormalizedString() instead of DN.toString() for better perfs.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9605 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • …ble stack trace when handshake fails
    
    * make the connection close logic more tolerant of underlying Grizzly behavior, although the bug is unreproducible with the latest SDK + Grizzly 2.3.4.
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9604 41b1ffd8-f28e-4786-ab96-9950f0a78031
    matthew
     
  • Fixed ConcurrentModificationException.
    Fixed wrong expected value (copy/paste was here).
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9603 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Factorized common code in tests:
    - Added inner class MonitorAssertions with fluent interface to help assert the monitor attribute values.
    - Extracted methods assertNoServerErrors(), assertServerErrorsSafeDataMode(), assertServerErrorsSafeReadMode().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9602 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • String baseDn => DN baseDN
    
    The change mostly affects package org.opends.server.replication.protocol and dependent classes.
    
    
    ModifyCommonMsg.java:
    In getMods(), called decodeMods()
    
    ReplicationTestCase.java:
    Converted removeDomain(Entry) to removeDomain(Entry...).
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9601 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

25 Sep, 2013

3 commits

  • Extracted toServerState() method.
    Renamed getDbServerState() to getLatestServerState().
    
    ReplicationDomainCfgDefn_fr.properties:
    Upgraded "property.replication-server.description" to match the latest english description.
    
    *.java:
    Consequence of renaming ReplicationServerDomain.getDbServerState().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9600 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Now the replication code uses HostPort class for comparisons instead of "host:port" Strings.
    Changed all the HostPort variable/parameter names to *Address instead of *URL. Left all the relevant String variable/parameter names to *URL.
    
    
    HostPort.java:
    Removed LocalAddress(String), not used anymore.
    Moved getLocalAddress() here from ReplicationServer.
    Created localAddress() static method.
    Extracted method toInetSocketAddress() and moved it here.
    
    ReplicationServer.java:
    Created converting method toHostPorts() + used it everywhere replicationServerUrls was accessed.
    Replaced getNormalizedLocalURL() and normalizeServerURL() with simply calling HostPort.localAddress() and HostPort.valueOf().
    In getConnectedRSUrls(), changed return type from Set<String> to Set<HostPort>.
    In connect() and disconnectRemovedReplicationServers(), used HostPort as a parameter instead of String.
    
    ReplicationServerDomain.java:
    In stopReplicationServers(), used HostPort as a parameter instead of String.
    
    ReplicationServerHandler.java:
    Extracted method toServerAddressURL().
    
    ReplicationBroker.java:
    Consequence of the change to HostPort.
    
    
    ReplSessionSecurity.java:
    In isSslEncryption() removed unused parameter.
    Used StaticUtils.close().
    
    ReplicationServerConfiguration.xml, ReplicationServerCfgDefn.properties:
    Added precisions on how to specify the "replication-server" property.
    
    ReplicationServerDynamicConfTest.java, ReplServerFakeConfiguration.java:
    Updated because this test was failing.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9599 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Review CR-2353
    
    * Removed constraints on the mandatory presence of a PIN, to allow use of empty PIN. 
       These contraints were implemented in several places :
      - configuration files : FileBasedKeyManagerProviderConfiguration.xml, PKCS11KeyManagerProviderConfiguration.xml
      - corresponding provider classes : FileBasedKeyManagerProvider.java, PKCS11KeyManagerProvider.java
      - setup tool : CertificateManager.java, InstallDS.java (for CLI), SecurityOptionsDialog.java (for GUI) 
    
    * Removed corresponding admin messages that are no more used in FileBasedKeyManagerProviderCfgDefn.properties and PKCS11KeyManagerProviderCfgDefn.properties
    * Removed corresponding messages that are no more used in extension.properties and quicksetup.properties
    * Added management of issue JDK-6879539 that prevents usage of empty PIN. This issue occurs on JDK older than JDK7.
    * Modified unit tests according to new behavior : FileBasedKeyManagerProviderTestCase.java, CertificateManagerTestCase.java
    
    * Added a new utility method StaticUtils#stackTraceContainsCause to check if an exception contains a given cause.
    
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9598 41b1ffd8-f28e-4786-ab96-9950f0a78031
    nicolas.capponi@forgerock.com
     

24 Sep, 2013

8 commits

  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9594 41b1ffd8-f28e-4786-ab96-9950f0a78031
    matthew
     
  • Changes after review from Matt.
    
    *.java:
    Changed terminology for easier reading:
    - First => Oldest
    - Last => Newest
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9590 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Changes after review from Matt.
    
    *.java:
    Changed terminology for easier reading:
    - First => Oldest
    - Last => Newest
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9589 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Silencing annoying warnings in Continuous Integration.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9588 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Silencing annoying warnings in Continuous Integration.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9587 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • 
    ReplicationTestCase.java
    Added remove(ReplicationServer...) and stop(ReplicationBroker...).
    
    *Test.java:
    Used the new methods from ReplicationTestCase.
    Used Arrays.fill().
    Removed various redundant methods that had been extracted in the past:
    - GroupIdHandshakeTest.clear()
    - ReplicationServerFailoverTest.clear()
    - ExternalChangeLogTest.stop()
    - ReplicationServerTest.stop()
    - ReplicationServerTest.removeRsAndChangeLog()
    - ReplicationDomainTest.remove())
    
    AssuredReplicationServerTest.java:
    Removed all the rs*Port fields, replaced by rsPorts.
    Removed all the fakeRd* fields, replaced by fakeRDs.
    Extracted methods disableService(), shutdown(), assertFakeDSReceivedAndAcked(), assertFakeRDNbReceivedUpdates(), assertFakeRSNbReceivedUpdates(), checkDSNothingReceivedOrSent(), assertContainsOnly().
    Used more the checkDSSentAndAcked(), checkDSReceivedAndAcked().
    Inlined on createFakeReplicationDomain().
    Removed all sorts of assertNotNull() where the code could never be null.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9582 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Changed after review from Matt.
    
    ChangelogDB.java:
    Removed setReplicationDBDirectory(), now set in JEChangelogDB constructor.
    Renamed getDBDirName() to getDBDirectoryName().
    Improved javadocs.
    
    JEChangelogDB.java:
    Consequence of the changes to ChangelogDB.
    Renamed dbDirName to dbDirectoryName.
    Made 2 fields final.
    Added makeDir().
    
    ReplicationServer.java:
    Consequence of the changes to ChangelogDB.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9581 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • HostPort.java:
    Improved javadocs.
    Improved host normalization for and used remote IP addresses for remote hosts (complies with code from ReplicationServer.java.disconnectRemovedReplicationServers()).
    Renamed normalizedHost() tpo normalizeHost().
    Removed trimming for serverURLs.
    In valueOf(), added a special case to reject unbracketed IPV6 addresses.
    Extracted constant LOCALHOST to avoid typos.
    Reworked the code from isLocalAddress(), equals(), hashCode().
    
    HostPortTest.java:
    Reworked some tests.
    Added new tests.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9580 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

23 Sep, 2013

6 commits

  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9579 41b1ffd8-f28e-4786-ab96-9950f0a78031
    matthew
     
  • LDAPURL.java:
    Weakened urlDecode() visibility from private to package to allow easy unit testing.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9578 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Review CR-2344
    
    NPE occurs in AdministrationConnector#createSelfSignedCertificateIfNeeded method.
    To avoid this, now attempt to create certificate only if initial setup has not been changed. 
    
    * AdministrationConnector.java : 
      - completed method createSelfSignedCertificateIfNeeded to add more checks to detect when initial setup has changed
      - added method hasDefaultConfigChanged to isolate the check
    
    * No unit test added, functional test to be added
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9577 41b1ffd8-f28e-4786-ab96-9950f0a78031
    nicolas.capponi@forgerock.com
     
  • Let's make the build happier.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9576 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Augmented HostPort class to support the use cases mentioned in OPENDJ-1134.
    Moved host splitting and port range validation to HostPort class.
    
    
    HostPort.java:
    Added valueOf() to parses a "host:port" URL + Added extractPort(), normalizePort(), normalizedHost(), removeExtraChars().
    Moved isLocalAddress() code here from StaticUtils.
    Added normalizedHost field, toNormalizedString() and toString(String) + modified hashCode() and equals() to ensure stability of the results returned by hashCode() and equals().
    Added allAddresses() to hide HostPort(int).
    Moved isEquivalentTo() code here from ReplicationBroker.isSameReplicationServerUrl().
    
    HostPortTest.java:
    Added.
    
    StaticUtils.java:
    Moved isLocalAddress() and related code to the HostPort class.
    
    ReplicationBroker.java:
    Moved some isSameReplicationServerUrl() to HostPort as isEquivalentTo().
    
    *.java:
    Used the new HostPort ctor everywhere.
    It simplified the code in many places and also helped remove duplicated code.
    
    ComputeBestServerTest.java:
    Added ports to serverURLs to ensure tests still pass.
    
    *Test.java:
    Removed the test anti-pattern try/catch/fail.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9575 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Refactored code to make it more readable.
    Extracted several methods to reduce code duplication.
    Inlined local variables.
    Extracted constants.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9574 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

21 Sep, 2013

2 commits


20 Sep, 2013

7 commits


19 Sep, 2013

7 commits

  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9559 41b1ffd8-f28e-4786-ab96-9950f0a78031
    csovant
     
  • ExternalChangeLogTest.java:
    Reverted the @Test annotation added in r9543.
    Used different backendId and baseDN from other tests to avoid clashing tests in concurrent test runs.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9557 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • JEChangelogDB.java:
    In getCursorFrom(), renamed local variable "it" to "cursor".
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9556 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • …ile when execution path contains whitespace (which is the case when running on Jenkins)
    * Avoid reading twice the value of trustStorePathArg and keyStorePathArg in getConnectionFactory method
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9555 41b1ffd8-f28e-4786-ab96-9950f0a78031
    nicolas.capponi@forgerock.com
     
  • 
    Note this change does not cater for:
    - the bind operations where the password is used to authenticate. The password is held in memory for as long as it takes to complete the bind operation (and the OS flushing the network packets, etc.)
    - REST operations where the web container (and the OS network stack) holds a HTTPServletRequest object for as long as it takes to process the request.
    
    
    AuthenticationInfo.java:
    Removed simplePassword and saslCredentials fields + getters (never used) to ensure they are not held for the lifetime of an LDAP connection.
    In few methods, reversed conditions to ensure accessed variables are all directly put under a null check.
    
    CollectClientConnectionsFilter.java
    Wiped out the password ASAP, even though this is a bit pointless since the password is held by the web container for the lifetime of a REST call, either in the headers or via HTTP basic authentication.
    
    *.java:
    Consequence of the changes to AuthenticationInfo ctors.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9554 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • In findCookie(), reverted an if statement to use an early exit in case of error. It improves readability by making this code consistent with the other code in this method.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9553 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Review CR-1243
    
    NPE happens when no trust password is given.
    
    * ConnectionFactoryProvider.java : 
      - test for null value before converting to charArray
      - fixed a unrelated copy-paste error (using trustStorePathArg instead of keyStorePathArg)
    
    * Added a test class ConnectionFactoryProviderTest.java to check behavior in case no trust password is given
    * Added a dummy-trustore in test resources, as this is needed for correct behavior of tested method getConnectionFactory
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9552 41b1ffd8-f28e-4786-ab96-9950f0a78031
    nicolas.capponi@forgerock.com