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

Jean-Noël Rouvignac
10.37.2016 94e292e54fe5320cc5657f773d91a80ad6ac3c0f
SchemaTestCase.java: Added tests for Schema.getAttributeType()

The tests were carried over from the server's test suite.
1 files modified
22 ■■■■ changed files
opendj-sdk/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/SchemaTestCase.java 22 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/test/java/org/forgerock/opendj/ldap/schema/SchemaTestCase.java
@@ -21,7 +21,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2014 ForgeRock AS.
 *      Copyright 2014-2016 ForgeRock AS.
 */
package org.forgerock.opendj.ldap.schema;
@@ -38,9 +38,7 @@
import static org.mockito.Matchers.*;
import static org.mockito.Mockito.*;
/**
 * Tests the Schema class.
 */
/** Tests the Schema class. */
@SuppressWarnings("javadoc")
public class SchemaTestCase extends AbstractSchemaTestCase {
    @Test(description = "Unit test for OPENDJ-1477")
@@ -107,4 +105,20 @@
        connection.close();
    }
    @Test
    public void getAttributeTypeWithDifferentNamesReturnSame() throws Exception {
        Schema schema = CoreSchema.getInstance();
        AttributeType cnAttrType = schema.getAttributeType("cn");
        assertThat(cnAttrType).isSameAs(schema.getAttributeType("commonname"));
        assertThat(cnAttrType).isSameAs(schema.getAttributeType("commonName"));
        assertThat(cnAttrType).isSameAs(schema.getAttributeType("CN"));
    }
    @Test
    public void getAttributeTypeWithDifferentPlaceholderNames() throws Exception {
        Schema schema = CoreSchema.getInstance().asNonStrictSchema();
        AttributeType placeHolderAttrType = schema.getAttributeType("placeholder");
        assertThat(placeHolderAttrType).isEqualTo(schema.getAttributeType("PLACEHOLDER"));
        assertThat(placeHolderAttrType).isNotEqualTo(schema.getAttributeType("another_placeholder"));
    }
}