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

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


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

        Ava atav2 = new Ava( schemaManager, "a", "b" );

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


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

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

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

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

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

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


    @Test
    public void testNormalize() throws LdapException
    {
        Ava atav = new Ava( schemaManager, " A ", "a" );

        assertEquals( "a=a", atav.normalize() );

    }
View Full Code Here


    @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( "commonname=\\ This is    a TEST\\ ", atav.getNormName() );
        assertEquals( " CommonName =\\ This is    a TEST\\ ", atav.getName() );
    }
View Full Code Here

     * Test serialization of a simple ATAV
     */
    @Test
    public void testStringAtavSerialization() throws LdapException, IOException, ClassNotFoundException
    {
        Ava atav = new Ava( schemaManager, "CN", "Test" );

        atav.normalize();

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream( baos );

        atav.writeExternal( out );

        ObjectInputStream in = null;

        byte[] data = baos.toByteArray();
        in = new ObjectInputStream( new ByteArrayInputStream( data ) );

        Ava atav2 = new Ava( schemaManager );
        atav2.readExternal( in );

        assertEquals( atav, atav2 );
    }
View Full Code Here

    @Test
    public void testBinaryAtavSerialization() throws LdapException, IOException, ClassNotFoundException
    {
        byte[] upValue = Strings.getBytesUtf8( "  Test  " );

        Ava atav = new Ava( schemaManager, "CN", upValue );

        atav.normalize();

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream( baos );

        atav.writeExternal( out );

        ObjectInputStream in = null;

        byte[] data = baos.toByteArray();
        in = new ObjectInputStream( new ByteArrayInputStream( data ) );

        Ava atav2 = new Ava( schemaManager );
        atav2.readExternal( in );

        assertEquals( atav, atav2 );
    }
View Full Code Here

     * Test serialization of a simple ATAV
     */
    @Test
    public void testNullAtavSerialization() throws LdapException, IOException, ClassNotFoundException
    {
        Ava atav = new Ava();

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream( baos );

        try
        {
            atav.writeExternal( out );
            fail();
        }
        catch ( IOException ioe )
        {
            assertTrue( true );
View Full Code Here


    @Test
    public void testNullNormValueSerialization() throws LdapException, IOException, ClassNotFoundException
    {
        Ava atav = new Ava( schemaManager, "CN", ( String ) null );

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream( baos );

        try
        {
            atav.writeExternal( out );
            fail();
        }
        catch ( IOException ioe )
        {
            String message = ioe.getMessage();
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.