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

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


    public void testAddAtBytesElipsis() throws Exception
    {
        Dn dn = new Dn( schemaManager, "cn=test" );
        DefaultEntry entry = new DefaultEntry( schemaManager, dn );

        AttributeType atPassword = schemaManager.lookupAttributeTypeRegistry( "userPassword" );
        AttributeType atJpegPhoto = schemaManager.lookupAttributeTypeRegistry( "jpegPhoto" );

        byte[] test1 = Strings.getBytesUtf8( "test1" );
        byte[] test2 = Strings.getBytesUtf8( "test2" );
        byte[] test3 = Strings.getBytesUtf8( "test3" );
View Full Code Here


    public void testAddAtServerValueElipsis() throws Exception
    {
        Dn dn = new Dn( schemaManager, "cn=test" );
        DefaultEntry entry = new DefaultEntry( schemaManager, dn );

        AttributeType atPassword = schemaManager.lookupAttributeTypeRegistry( "userPassword" );

        byte[] b1 = Strings.getBytesUtf8( "test1" );
        byte[] b2 = Strings.getBytesUtf8( "test2" );
        byte[] b3 = Strings.getBytesUtf8( "test3" );
View Full Code Here

    public void testAddUpIdBytesElipsis() throws Exception
    {
        Dn dn = new Dn( schemaManager, "cn=test" );
        DefaultEntry entry = new DefaultEntry( schemaManager, dn );

        AttributeType atPassword = schemaManager.lookupAttributeTypeRegistry( "userPassword" );

        byte[] test1 = Strings.getBytesUtf8( "test1" );
        byte[] test2 = Strings.getBytesUtf8( "test2" );
        byte[] test3 = Strings.getBytesUtf8( "test3" );
View Full Code Here

    public void testAddUpIdServerValueElipsis() throws Exception
    {
        Dn dn = new Dn( schemaManager, "cn=test" );
        Entry entry = new DefaultEntry( schemaManager, dn );

        AttributeType atPassword = schemaManager.lookupAttributeTypeRegistry( "userPassword" );

        byte[] b1 = Strings.getBytesUtf8( "test1" );
        byte[] b2 = Strings.getBytesUtf8( "test2" );
        byte[] b3 = Strings.getBytesUtf8( "test3" );
View Full Code Here

    public void testAddUpIdAtBytesElipsis() throws Exception
    {
        Dn dn = new Dn( schemaManager, "cn=test" );
        DefaultEntry entry = new DefaultEntry( schemaManager, dn );

        AttributeType atPassword = schemaManager.lookupAttributeTypeRegistry( "userPassword" );

        byte[] test1 = Strings.getBytesUtf8( "test1" );
        byte[] test2 = Strings.getBytesUtf8( "test2" );
        byte[] test3 = Strings.getBytesUtf8( "test3" );
View Full Code Here

    public void testAddUpIdAtServerValueElipsis() throws Exception
    {
        Dn dn = new Dn( schemaManager, "cn=test" );
        Entry entry = new DefaultEntry( schemaManager, dn );

        AttributeType atPassword = schemaManager.lookupAttributeTypeRegistry( "userPassword" );

        byte[] b1 = Strings.getBytesUtf8( "test1" );
        byte[] b2 = Strings.getBytesUtf8( "test2" );
        byte[] b3 = Strings.getBytesUtf8( "test3" );
View Full Code Here

        expected.add( atPwd );
        expected.add( atC );

        for ( Attribute attribute : attributes )
        {
            AttributeType attributeType = attribute.getAttributeType();

            assertTrue( expected.contains( attributeType ) );
        }
    }
View Full Code Here

        while ( iterator.hasNext() )
        {
            Attribute attribute = iterator.next();

            AttributeType attributeType = attribute.getAttributeType();
            assertTrue( expectedIds.contains( attributeType ) );
            expectedIds.remove( attributeType );
        }

        assertEquals( 0, expectedIds.size() );
View Full Code Here

            assertTrue( true );
        }

        // Adding some serverAttributes
        //AttributeType atCo = registries.lookupAttributeTypeRegistry( "countryName" );
        AttributeType atGN = schemaManager.lookupAttributeTypeRegistry( "givenname" );
        AttributeType atStreet = schemaManager.lookupAttributeTypeRegistry( "2.5.4.9" );

        Attribute sa = new DefaultAttribute( atL, "france" );
        entry.put( sa );

        assertEquals( 1, entry.size() );
        assertNotNull( entry.get( "l" ) );
        assertEquals( "france", entry.get( "l" ).get().getString() );

        Attribute sb = new DefaultAttribute( atC, "countryTest" );
        Attribute sc = new DefaultAttribute( atGN, "test" );
        Attribute sd = new DefaultAttribute( atStreet, "testStreet" );
        entry.put( sb, sc, sd );

        assertEquals( 4, entry.size() );
        assertNotNull( entry.get( atC ) );
        assertEquals( "countryTest", entry.get( atC ).get().getString() );
        assertNotNull( entry.get( atGN ) );
        assertEquals( "test", entry.get( atGN ).get().getString() );
        assertNotNull( entry.get( atStreet ) );
        assertEquals( "testStreet", entry.get( atStreet ).get().getString() );

        // Test a replacement
        Attribute sbb = new DefaultAttribute( atC, "countryTestTest" );
        Attribute scc = new DefaultAttribute( atGN, "testtest" );
        List<Attribute> result = entry.put( sbb, scc );

        assertEquals( 2, result.size() );
        assertEquals( "countryTest", result.get( 0 ).get().getString() );
        assertEquals( "test", result.get( 1 ).get().getString() );
        assertEquals( 4, entry.size() );
        assertNotNull( entry.get( atC ) );
        assertEquals( "countryTestTest", entry.get( atC ).get().getString() );
        assertNotNull( entry.get( atGN ) );
        assertEquals( "testtest", entry.get( atGN ).get().getString() );
        assertNotNull( entry.get( atStreet ) );
        assertEquals( "testStreet", entry.get( atStreet ).get().getString() );

        // test an ObjectClass replacement
        AttributeType OBJECT_CLASS_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASS_AT );
        Attribute oc = new DefaultAttribute( "OBJECTCLASS", OBJECT_CLASS_AT, "person", "inetorgperson" );
        List<Attribute> oldOc = entry.put( oc );

        assertNotNull( oldOc );
        assertEquals( 0, oldOc.size() );
View Full Code Here

    public void tesPutUpIdBytesElipsis() throws Exception
    {
        Dn dn = new Dn( schemaManager, "cn=test" );
        DefaultEntry entry = new DefaultEntry( schemaManager, dn );

        AttributeType atPassword = schemaManager.lookupAttributeTypeRegistry( "userPassword" );

        // Adding a null value should be possible
        entry.put( "userPassword", ( byte[] ) null );
        assertEquals( 1, entry.size() );
        assertEquals( "userPassword", entry.get( atPassword ).getUpId() );
View Full Code Here

TOP

Related Classes of org.apache.directory.api.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.