From 1fed9123be8b183ad5e4c3be8d2d28301f43bcb2 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Wed, 18 Apr 2007 12:53:11 +0000
Subject: [PATCH] Implement some simple tests for the DNBuilder class. This change required modifications to the LDAPProfile class so that test implementations could be mocked up. The DNBuilder class was also modified so that the LDAPProfile instance could be configured at run-time.
---
opendj-sdk/opends/src/server/org/opends/server/admin/server/DNBuilder.java | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/admin/server/DNBuilder.java b/opendj-sdk/opends/src/server/org/opends/server/admin/server/DNBuilder.java
index 31bc078..4219b2e 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/admin/server/DNBuilder.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/admin/server/DNBuilder.java
@@ -96,8 +96,23 @@
* Create a new DN builder.
*/
public DNBuilder() {
+ this(LDAPProfile.getInstance());
+ }
+
+
+
+ /**
+ * Create a new DN builder with the provided LDAP profile.
+ * <p>
+ * This constructor is package private and only intended for testing
+ * purposes against a mock LDAP profile.
+ *
+ * @param profile
+ * The LDAP profile to use when building the DN.
+ */
+ DNBuilder(LDAPProfile profile) {
this.dn = DN.nullDN();
- this.profile = LDAPProfile.getInstance();
+ this.profile = profile;
}
--
Gitblit v1.10.0