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

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


     * Test a null AttributeTypeAndValue
     */
    @Test
    public void testAttributeTypeAndValueNull()
    {
        Ava atav = new Ava();
        assertEquals( "", atav.toString() );
        assertEquals( "", atav.getUpName() );
        assertEquals( -1, atav.getStart() );
        assertEquals( 0, atav.getLength() );
    }
View Full Code Here


    @Test
    public void testAttributeTypeAndValueNullType() throws LdapException
    {
        try
        {
            new Ava( null, null, (String)null, (String)null );
            fail();
        }
        catch ( LdapException ine )
        {
            assertTrue( true );
View Full Code Here

    @Test
    public void testAttributeTypeAndValueInvalidType() throws LdapException
    {
        try
        {
            new Ava( "  ", " ", (String)null, (String)null );
            fail();
        }
        catch ( LdapException ine )
        {
            assertTrue( true );
View Full Code Here

     * Test a valid type for an AttributeTypeAndValue
     */
    @Test
    public void testAttributeTypeAndValueValidType() throws LdapException
    {
        Ava atav = new Ava( "A", "a", (String)null, (String)null );
        assertEquals( "a=", atav.toString() );
        assertEquals( "A=", atav.getUpName() );
       
        atav = new Ava( "  A  ", "a", (String)null, (String)null );
        assertEquals( "a=", atav.toString() );
        assertEquals( "  A  =", atav.getUpName() );
       
        atav = new Ava( "  A  ", null, (String)null, (String)null );
        assertEquals( "a=", atav.toString() );
        assertEquals( "  A  =", atav.getUpName() );
       
        atav = new Ava( null, "a", (String)null, (String)null );
        assertEquals( "a=", atav.toString() );
        assertEquals( "a=", atav.getUpName() );
       
    }
View Full Code Here

    @Test
    public void testLdapRDNEmpty()
    {
        try
        {
            new Ava( "", "", "", "" );
            fail( "Should not occurs ... " );
        }
        catch ( LdapException ine )
        {
            assertTrue( true );
View Full Code Here

     * test a simple AttributeTypeAndValue : a = b
     */
    @Test
    public void testLdapRDNSimple() throws LdapException
    {
        Ava atav = new Ava( "a", "a", "b", "b" );
        assertEquals( "a=b", atav.toString() );
        assertEquals( "a=b", atav.getUpName() );
        assertEquals( 0, atav.getStart() );
        assertEquals( 3, atav.getLength() );
    }
View Full Code Here

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

        assertEquals( 0, atav1.compareTo( atav2 ) );
    }
View Full Code Here

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

        assertEquals( 0, atav1.compareTo( atav2 ) );
    }
View Full Code Here

     * superior
     */
    @Test
    public void testCompareAtav1TypeSuperior() throws LdapException
    {
        Ava atav1 = new Ava( "b", "b", "b", "b" );
           
        Ava atav2 = new Ava( "a", "a", "b", "b" );

        assertEquals( 1, atav1.compareTo( atav2 ) );
    }
View Full Code Here

     * superior
     */
    @Test
    public void testCompareAtav2TypeSuperior() throws LdapException
    {
        Ava atav1 = new Ava( "a", "a", "b", "b" );
        Ava atav2 = new Ava( "b", "b", "b", "b" );

        assertEquals( -1, atav1.compareTo( atav2 ) );
    }
View Full Code Here

TOP

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