Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*
* Copyright 2008-2009 Sun Microsystems, Inc.
* Portions copyright 2014-2016 ForgeRock AS.
* Portions Copyright 2026 3A Systems, LLC.
*/
package org.forgerock.opendj.config;

Expand Down Expand Up @@ -227,8 +228,11 @@ public LocalizableMessage visitString(StringPropertyDefinition d, Void p) {
if (isDetailed) {
LocalizableMessageBuilder builder = new LocalizableMessageBuilder();
builder.append(d.getPatternUsage());
builder.append(" - ");
builder.append(d.getPatternSynopsis());
// The pattern synopsis is optional.
if (d.getPatternSynopsis() != null) {
builder.append(" - ");
builder.append(d.getPatternSynopsis());
}
return builder.toMessage();
} else {
return LocalizableMessage.raw(d.getPatternUsage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions Copyright [year] [name of copyright owner]".
*
* Copyright 2008 Sun Microsystems, Inc.
* Portions Copyright 2024-2026 3A Systems, LLC
*/
package org.forgerock.opendj.config;

Expand All @@ -35,8 +36,7 @@ public void testValidateValuePatternMatches() {
d.validateValue("abc");
}

// TODO : I18N problem
@Test(enabled = false, expectedExceptions = PropertyException.class)
@Test(expectedExceptions = PropertyException.class)
public void testValidateValuePatternDoesNotMatch() {
StringPropertyDefinition d = getDefinition(true, "^[a-z]+$");
d.validateValue("abc123");
Expand All @@ -48,8 +48,7 @@ public void testDecodeValuePatternMatches() {
assertEquals(d.decodeValue("abc"), "abc");
}

// TODO : I18N problem
@Test(enabled = false, expectedExceptions = PropertyException.class)
@Test(expectedExceptions = PropertyException.class)
public void testDecodeValuePatternDoesNotMatch() {
StringPropertyDefinition d = getDefinition(true, "^[a-z]+$");
d.decodeValue("abc123");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*
* Copyright 2008 Sun Microsystems, Inc.
* Portions copyright 2011-2016 ForgeRock AS.
* Portions Copyright 2024-2026 3A Systems, LLC
*/
package org.forgerock.opendj.config;

Expand Down Expand Up @@ -67,7 +68,7 @@ Object[][] enumerateManageObjectDefns() throws Exception {
"org.forgerock.opendj.config.std.meta.RootCfgDefn", "org.forgerock.opendj.config.std.meta.GlobalCfgDefn", });

/** TODO : does not work because can't retrieve object class objects */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this TODO be removed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — thanks. Removed, but the TODO turned out to point at a real problem, so I did more than delete it (e1c6fe8):

  • The test only stayed green because its assertion was inverted (errors.length() != 0), i.e. it passed precisely when a definition had problems. With the correct == 0 it fails for all 37 definitions.
  • The cause is exactly what the TODO said: the ds-cfg-* LDAP schema is not on the opendj-config test class path, so object classes / attribute types resolve only as placeholders (verified: getObjectClass("ds-cfg-backend") → 0 required / 0 optional attrs; getAttributeType("ds-cfg-java-class").isPlaceHolder() == true). That schema is generated in opendj-server-legacy.

So I reworked it into a naming-convention validator: fixed the assertion to == 0, dropped the schema-dependent checks (attribute-exists / single-vs-multi-valued / mandatory / allowed-attribute), and kept the checks verifiable from the definitions and their LDAP profiles alone. Fixing the assertion surfaced three real issues, now fixed:

  • CLASS_OBJECT_CLASS_EXCEPTIONS referenced the obsolete org.forgerock.opendj.config.std.meta package, so root/global were no longer excluded → updated to org.forgerock.opendj.server.config.meta.
  • http-endpoint's authorization-mechanism intentionally maps to ds-cfg-http-authorization-mechanism → added an LDAP_ATTRIBUTE_NAME_EXCEPTIONS list for such deliberate deviations.

37/37 green now, and a negative-control run (removing the http exception) confirms the check still fails on a real deviation.

@Test(enabled = false, dataProvider = "enumerateManageObjectDefns")
@Test(dataProvider = "enumerateManageObjectDefns")
public void validateConfigObjectDefinitions(AbstractManagedObjectDefinition<?, ?> objectDef) {
String objName = objectDef.getName();
StringBuilder errors = new StringBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions Copyright [year] [name of copyright owner]".
*
* Copyright 2011-2016 ForgeRock AS.
* Portions Copyright 2026 3A Systems, LLC
*/

package org.forgerock.opendj.ldif;
Expand Down Expand Up @@ -452,7 +453,7 @@ public void testSetIncludeBranchDoesntAllowNull() throws Exception {
* @throws Exception
* If the test failed unexpectedly.
*/
@Test(enabled = false)
@Test
public void testSetAddUserFriendlyComments() throws Exception {
final List<String> actual = new ArrayList<>();
final LDIFChangeRecordWriter writer = new LDIFChangeRecordWriter(actual);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ public void testWriteComment() throws Exception {
* @throws Exception
* If the test failed unexpectedly.
*/
@Test(enabled = false)
@Test
public void testSetAddUserFriendlyComments() throws Exception {
final List<String> actual = new ArrayList<>();
final LDIFEntryWriter writer = new LDIFEntryWriter(actual);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* information: "Portions Copyright [year] [name of copyright owner]".
*
* Copyright 2013-2015 ForgeRock AS.
* Portions Copyright 2024-2026 3A Systems, LLC
*/
package org.forgerock.opendj.ldif;

Expand Down Expand Up @@ -39,7 +40,7 @@
import org.testng.annotations.Test;

@SuppressWarnings("javadoc")
public class TemplateTagTestcase extends SdkTestCase {
public class TemplateTagTestCase extends SdkTestCase {

private static final int LINE_NUMBER = 10;
private static final TemplateFile NULL_TEMPLATE_FILE = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* Copyright 2010 Sun Microsystems, Inc.
* Portions Copyright 2011-2016 ForgeRock AS.
* Portions Copyright 2019-2024 3A Systems, LLC.
* Portions Copyright 2019-2026 3A Systems, LLC.
*/

package org.forgerock.opendj.grizzly;
Expand Down Expand Up @@ -308,7 +308,7 @@ public void testSynchronousConnection(ConnectionFactory factory) throws Exceptio
* @throws Exception
* If an unexpected error occurred.
*/
@Test(enabled = false)
@Test
public void testSchemaUsage() throws Exception {
// Create a connection factory: this should always use the default
// schema, even if it is updated.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*
* Copyright 2010 Sun Microsystems, Inc.
* Portions copyright 2012-2016 ForgeRock AS.
* Portions Copyright 2023-2026 3A Systems, LLC.
*/

package org.forgerock.opendj.grizzly;
Expand Down Expand Up @@ -43,7 +44,7 @@ public class DefaultTCPNIOTransportTestCase extends SdkTestCase {
* @throws Exception
* If an unexpected error occurred.
*/
@Test(enabled = false)
@Test
public void testGetInstance() throws Exception {
// Create a transport.
final ReferenceCountedObject<TCPNIOTransport>.Reference transport = DEFAULT_TRANSPORT.acquire();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*
* Copyright 2010 Sun Microsystems, Inc.
* Portions Copyright 2011-2016 ForgeRock AS.
* Portions Copyright 2017-2026 3A Systems, LLC
*/
package org.forgerock.opendj.grizzly;

Expand Down Expand Up @@ -273,7 +274,7 @@ public void testLDAPListenerBasic() throws Exception {
* @throws Exception
* If an unexpected exception occurred.
*/
@Test(enabled = false)
@Test
public void testLDAPListenerLoadBalanceDuringHandleAccept() throws Exception {
// Online server listener.
final MockServerConnection onlineServerConnection = new MockServerConnection();
Expand Down Expand Up @@ -453,7 +454,7 @@ public void handleBind(final Integer requestContext, final int version,
* @throws Exception
* If an unexpected exception occurred.
*/
@Test(enabled = false)
@Test
public void testLDAPListenerProxyDuringHandleAccept() throws Exception {
final MockServerConnection onlineServerConnection = new MockServerConnection();
final MockServerConnectionFactory onlineServerConnectionFactory =
Expand Down Expand Up @@ -513,10 +514,13 @@ public ServerConnection<Integer> handleAccept(
new ServerConnectionFactoryAdapter(Options.defaultOptions().get(LDAP_DECODE_OPTIONS),
proxyServerConnectionFactory));
try {
// Connect and close.
// Connect to the proxy listener (not to the online server
// directly, otherwise the proxy handleAccept is never invoked)
// and close.
final InetSocketAddress proxyAddr = proxyListener.firstSocketAddress();
final Connection connection =
new LDAPConnectionFactory(onlineServerAddr.getHostName(),
onlineServerAddr.getPort()).getConnection();
new LDAPConnectionFactory(proxyAddr.getHostName(),
proxyAddr.getPort()).getConnection();

assertThat(proxyServerConnection.context.get(10, TimeUnit.SECONDS)).isNotNull();
assertThat(onlineServerConnection.context.get(10, TimeUnit.SECONDS)).isNotNull();
Expand Down
Loading