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

Examples of org.apache.directory.api.ldap.model.name.Ava


     * test a simple AttributeTypeAndValue : a = b
     */
    @Test
    public void testAvaSimpleNorm() throws LdapException
    {
        Ava atav = new Ava( schemaManager, " CommonName ", " This is    a TEST " );
        assertEquals( " CommonName =\\ This is    a TEST\\ ", atav.toString() );
        assertEquals( "2.5.4.3=this is a test", atav.getNormName() );
        assertEquals( " CommonName =\\ This is    a TEST\\ ", atav.getName() );
    }
View Full Code Here


     * Compares two equals atavs
     */
    @Test
    public void testEqualsSameAva() throws LdapException
    {
        Ava atav1 = new Ava( schemaManager, "cn", "b" );
        Ava atav2 = new Ava( schemaManager, "cn", "b" );

        assertTrue( atav1.equals( atav2 ) );
    }
View Full Code Here

     * Compares two equals atavs but with a type in different case
     */
    @Test
    public void testEqualsUpperCaseAT() throws LdapException
    {
        Ava atav1 = new Ava( schemaManager, "cn", "b" );
        Ava atav2 = new Ava( schemaManager, "CN", "b" );

        assertTrue( atav1.equals( atav2 ) );
    }
View Full Code Here

     * Compares two equals atavs but with a type in different case
     */
    @Test
    public void testEqualsSameValues() throws LdapException
    {
        Ava atav1 = new Ava( schemaManager, "cn", "  B  a" );
        Ava atav2 = new Ava( schemaManager, "CN", "b a" );

        assertTrue( atav1.equals( atav2 ) );
    }
View Full Code Here

    @Test
    public void testAvaValuesNoSchema() throws LdapException
    {
        String errors = null;
       
        Ava ava = new Ava( "OU", "Exemple + Rdn\u00E4 " );
       
        if ( !"ou=Exemple \\+ Rdn\u00E4\\ ".equals( ava.getNormName() ) )
        {
            errors = "\nAva.getNormName fails '" + ava.getNormName() + "'";
        }
       
        if ( !"ou".equals( ava.getNormType() ) )
        {
            errors += "\nAva.getNormType fails '" + ava.getNormType() + "'";
        }
       
        if ( !"Exemple + Rdn\u00E4 ".equals( ava.getNormValue().getString() ) )
        {
            errors += "\nAva.getNormValue fails '" + ava.getNormValue().getString() + "'";
        }
       
        if ( !"OU=Exemple \\+ Rdn\u00E4\\ ".equals( ava.getName() ) )
        {
            errors += "\nAva.getUpName fails '" + ava.getName() + "'";
        }
       
        if ( !"OU".equals( ava.getType() ) )
        {
            errors += "\nAva.getUpType fails '" + ava.getType() + "'";
        }
       
        if ( !"Exemple + Rdn\u00E4 ".equals( ava.getValue().getString() ) )
        {
            errors += "\nAva.getUpValue fails '" + ava.getValue() .getString() + "'";
        }
       
        if ( !"ou=Exemple \\+ Rdn\u00E4\\ ".equals( ava.normalize() ) )
        {
            errors += "\nAva.normalize fails '" + ava.normalize() + "'";
        }
       
        if ( !"OU=Exemple \\+ Rdn\u00E4\\ ".equals( ava.toString() ) )
        {
            errors += "\nAva.toString fails '" + ava.toString() + "'";
        }
       
        assertEquals( null, errors );
    }
View Full Code Here

    @Test
    public void testAvaValuesSchemaAware() throws LdapException
    {
        String errors = null;
       
        Ava ava = new Ava( schemaManager, "OU", "Exemple + Rdn\u00E4 " );
       
        if ( !"2.5.4.11=exemple \\+ rdn\u00E4".equals( ava.getNormName() ) )
        {
            errors = "\nAva.getNormName fails '" + ava.getNormName() + "'";
        }
       
        if ( !"2.5.4.11".equals( ava.getNormType() ) )
        {
            errors += "\nAva.getNormType fails '" + ava.getNormType() + "'";
        }
       
        if ( !"exemple + rdn\u00E4".equals( ava.getNormValue().getString() ) )
        {
            errors += "\nAva.getNormValue fails '" + ava.getNormValue().getString() + "'";
        }
       
        if ( !"OU=Exemple \\+ Rdn\u00E4\\ ".equals( ava.getName() ) )
        {
            errors += "\nAva.getUpName fails '" + ava.getName() + "'";
        }
       
        if ( !"OU".equals( ava.getType() ) )
        {
            errors += "\nAva.getUpType fails '" + ava.getType() + "'";
        }
       
        if ( !"Exemple + Rdn\u00E4 ".equals( ava.getValue().getString() ) )
        {
            errors += "\nAva.getUpValue fails '" + ava.getValue().getString() + "'";
        }
       
        if ( !"2.5.4.11=exemple \\+ rdn\u00E4".equals( ava.normalize() ) )
        {
            errors += "\nAva.normalize fails '" + ava.normalize() + "'";
        }
       
        if ( !"OU=Exemple \\+ Rdn\u00E4\\ ".equals( ava.toString() ) )
        {
            errors += "\nAva.toString fails '" + ava.toString() + "'";
        }
       
        assertEquals( null, errors );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.name.Ava

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.