From f16f71611a4a5f48e97f843ea22e465be8e9a2f4 Mon Sep 17 00:00:00 2001
From: Ian Packer <ian.packer@forgerock.com>
Date: Mon, 15 Jun 2015 14:55:52 +0000
Subject: [PATCH] CR-7233: Additional test to cover OPENDJ-1797 in the SDK-based entry validation

---
 opendj-sdk/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/EntrySchemaCheckingTestCase.java |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/opendj-sdk/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/EntrySchemaCheckingTestCase.java b/opendj-sdk/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/EntrySchemaCheckingTestCase.java
index f54cb49..6c65249 100644
--- a/opendj-sdk/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/EntrySchemaCheckingTestCase.java
+++ b/opendj-sdk/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/EntrySchemaCheckingTestCase.java
@@ -924,6 +924,28 @@
     }
 
     /**
+     * Tests schema checking for an entry that contains an undefined objectclass
+     * when there is no structural objectclass and no structural objectclass checking.
+     *
+     * @throws Exception
+     *             If an unexpected problem occurs.
+     */
+    @Test
+    public void testUndefinedObjectClassNoStructural() throws Exception {
+        // @formatter:off
+        final Entry e = newEntry(
+                "dn: o=test",
+                "objectClass: top",
+                "objectClass: xxxundefinedxxx");
+        // @formatter:on
+
+        assertDoesNotConformToSchema(e, defaultPolicy().requireSingleStructuralObjectClass(Action.IGNORE));
+
+        e.removeAttribute("objectClass", "xxxundefinedxxx");
+        assertConformsToSchema(e, defaultPolicy().requireSingleStructuralObjectClass(Action.IGNORE));
+    }
+
+    /**
      * Tests schema checking for an entry with a valid single structural
      * objectclass.
      *

--
Gitblit v1.10.0