Package org.apache.directory.shared.ldap.model.schema

Examples of org.apache.directory.shared.ldap.model.schema.AttributeType


            + "        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE)";

        parser.parse( attributeTypeData );
        List<AttributeType> attributeTypes = parser.getAttributeTypes();
        Map<String, AttributeType> mapAttributeTypes = mapAttributeTypes( attributeTypes );
        AttributeType attributeType = mapAttributeTypes.get( "1.3.6.1.4.1.8104.1.1.37" );

        assertNotNull( attributeType );
        assertEquals( "1.3.6.1.4.1.8104.1.1.37", attributeType.getOid() );
        assertEquals( "versionNumber", attributeType.getName() );
        assertEquals( "versionNumber ", attributeType.getDescription() );
        assertEquals( "1.3.6.1.4.1.1466.115.121.1.15", attributeType.getSyntaxOid() );
        assertTrue( attributeType.isSingleValued() );
    }
View Full Code Here


     * Test the clone method
     */
    @Test
    public void testClone() throws LdapException
    {
        AttributeType at1 = EntryUtils.getBytesAttributeType();
        BinaryValue bv = new BinaryValue( at1, null );
        BinaryValue bv1 = bv.clone();

        assertEquals( bv, bv1 );

View Full Code Here

        int atrSize = schemaManager.getAttributeTypeRegistry().size();
        int goidSize = schemaManager.getGlobalOidRegistry().size();

        // Try to delete an AT which is contained by a disabled schema
        AttributeType attributeType = new AttributeType( "gecos" );
        attributeType.setOid( "1.3.6.1.1.1.1.2" );

        // It should fail
        assertFalse( schemaManager.delete( attributeType ) );

        assertFalse( isAttributeTypePresent( schemaManager, "gecos" ) );
View Full Code Here

     * Test the equals method
     */
    @Test
    public void testEquals() throws LdapInvalidAttributeValueException
    {
        AttributeType at1 = EntryUtils.getBytesAttributeType();

        BinaryValue value1 = new BinaryValue( at1, new byte[]
            { 0x01, ( byte ) 0x02 } );
        BinaryValue value2 = new BinaryValue( at1, new byte[]
            { 0x01, ( byte ) 0x02 } );
View Full Code Here

     * Test the getNormValue method
     */
    @Test
    public void testGetNormalizedValue() throws LdapInvalidAttributeValueException
    {
        AttributeType attribute = EntryUtils.getBytesAttributeType();

        BinaryValue value = new BinaryValue( attribute, null );
        assertNull( value.getNormValue() );

        value = new BinaryValue( attribute, StringConstants.EMPTY_BYTES );
View Full Code Here

     * Test the getNormValue method
     */
    @Test
    public void testGetNormalizedValueCopy() throws LdapInvalidAttributeValueException
    {
        AttributeType attribute = EntryUtils.getBytesAttributeType();

        BinaryValue value = new BinaryValue( attribute, null );
        assertNull( value.getNormValue() );

        value = new BinaryValue( attribute, StringConstants.EMPTY_BYTES );
View Full Code Here

        int atrSize = schemaManager.getAttributeTypeRegistry().size();
        int goidSize = schemaManager.getGlobalOidRegistry().size();

        // Try to delete an AT which has descendant
        // (modifiersName has one descendant : schemaModifiersName)
        AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( "modifiersName" );

        // It should fail
        assertFalse( schemaManager.delete( attributeType ) );

        assertTrue( isAttributeTypePresent( schemaManager, "modifiersName" ) );
View Full Code Here

     * Test the getNormValue method
     */
    @Test
    public void testGetNormalizedValueReference() throws LdapInvalidAttributeValueException
    {
        AttributeType attribute = EntryUtils.getBytesAttributeType();

        BinaryValue value = new BinaryValue( attribute, null );
        assertNull( value.getNormReference() );

        value = new BinaryValue( attribute, StringConstants.EMPTY_BYTES );
View Full Code Here

     * Test the getAttributeType method
     */
    @Test
    public void testgetAttributeType()
    {
        AttributeType attribute = EntryUtils.getBytesAttributeType();
        BinaryValue sbv = new BinaryValue( attribute );

        assertEquals( attribute, sbv.getAttributeType() );
    }
View Full Code Here

        List<Throwable> errors = schemaManager.getErrors();
        assertFalse( errors.isEmpty() );
        assertTrue( errors.get( 0 ) instanceof LdapProtocolErrorException );

        // Now delete the using AT : it should be OK
        AttributeType at = new AttributeType( AT_OID );
        assertTrue( schemaManager.delete( at ) );

        assertEquals( atrSize - 1, schemaManager.getAttributeTypeRegistry().size() );
        assertEquals( goidSize - 1, schemaManager.getGlobalOidRegistry().size() );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.schema.AttributeType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.