From 9eb4e7cc27b14c99ac2ee9f3df672533959a95d9 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Wed, 14 Mar 2007 20:01:57 +0000
Subject: [PATCH] Update the schema and memory backends so that they will properly set the matched DN field in the response if the backend doesn't have the entry specified as the search base DN but does have an ancestor for that entry.

---
 opends/tests/unit-tests-testng/src/server/org/opends/server/backends/SchemaBackendTestCase.java |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/SchemaBackendTestCase.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/SchemaBackendTestCase.java
index 265f827..35f7e23 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/SchemaBackendTestCase.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/SchemaBackendTestCase.java
@@ -429,6 +429,33 @@
 
 
   /**
+   * Performs a set of searches in the schema backend to ensure that they
+   * correctly set the matched DN in the response.
+   *
+   * @throws  Exception  If an unexpected problem occurs.
+   */
+  @Test()
+  public void testSearchMatchedDN()
+         throws Exception
+  {
+    InternalClientConnection conn =
+         InternalClientConnection.getRootConnection();
+    DN baseDN = DN.decode("o=bogus,cn=schema");
+    SearchFilter filter =
+         SearchFilter.createFilterFromString("(objectClass=*)");
+
+    for (SearchScope scope : SearchScope.values())
+    {
+      InternalSearchOperation searchOperation =
+           conn.processSearch(baseDN, scope, filter);
+      assertNotNull(searchOperation.getMatchedDN(),
+                    "No matched DN for scope " + scope);
+    }
+  }
+
+
+
+  /**
    * Tests the behavior of the schema backend with regard to the
    * ds-cfg-show-all-attributes configuration.
    *

--
Gitblit v1.10.0