mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
21.12.2007 0ebfbbfd2dda7a836b8d25d9473612e8cb8c85c5
opends/tests/unit-tests-testng/src/server/org/opends/server/backends/SchemaBackendTestCase.java
@@ -5330,6 +5330,48 @@
  /**
   * Tests the ability to properly handle adding and removing a schema
   * definition in which the definition has extra spaces.  This was added as a
   * test case for issue #2171.
   *
   * @throws  Exception  If an unexpected problem occurs.
   */
  @Test()
  public void testAddAndDeleteDefinitionWithExtraSpaces()
         throws Exception
  {
    int resultCode = TestCaseUtils.applyModifications(
      "dn: cn=schema",
      "changetype: modify",
      "add: objectClasses",
      "objectClasses: ( testaddanddeletedefinitionwithextraspaces-oid",
      "  NAME 'testAddAndDeleteDefinitionWithExtraSpaces'  SUP person",
      "  MAY ( street $ c) X-ORIGIN 'user defined' )");
    assertEquals(resultCode, 0);
    assertNotNull(DirectoryServer.getObjectClass(
                       "testaddanddeletedefinitionwithextraspaces"));
    assertNotNull(DirectoryServer.getObjectClass(
                       "testaddanddeletedefinitionwithextraspaces-oid"));
    resultCode = TestCaseUtils.applyModifications(
      "dn: cn=schema",
      "changetype: modify",
      "delete: objectClasses",
      "objectClasses: ( testaddanddeletedefinitionwithextraspaces-oid",
      "  NAME 'testAddAndDeleteDefinitionWithExtraSpaces'  SUP person",
      "  MAY ( street $ c) X-ORIGIN 'user defined' )");
    assertEquals(resultCode, 0);
    assertNull(DirectoryServer.getObjectClass(
                    "testaddanddeletedefinitionwithextraspaces"));
    assertNull(DirectoryServer.getObjectClass(
                    "testaddanddeletedefinitionwithextraspaces-oid"));
  }
  /**
   * Tests the {@code exportLDIF} method with a valid configuration.
   *
   * @throws  Exception  If an unexpected problem occurs.