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

Examples of org.apache.directory.api.ldap.model.entry.DefaultAttribute.apply()


    {
        Attribute attr = new DefaultAttribute( atCN );

        try
        {
            attr.apply( null );
            fail();
        }
        catch ( IllegalArgumentException iae )
        {
            assertTrue( true );
View Full Code Here


        catch ( IllegalArgumentException iae )
        {
            assertTrue( true );
        }

        attr.apply( atSN );

        assertTrue( attr.isInstanceOf( atSN ) );
        assertEquals( "2.5.4.4", attr.getId() );
        assertEquals( "sn", attr.getUpId() );
    }
View Full Code Here

    {
        Attribute attr1 = new DefaultAttribute( atDC );
        Attribute attr2 = new DefaultAttribute( atSN );
        assertNotSame( attr1.hashCode(), attr2.hashCode() );

        attr2.apply( atDC );
        assertEquals( attr1.hashCode(), attr2.hashCode() );

        attr1.add( ( String ) null );
        assertNotSame( attr1.hashCode(), attr2.hashCode() );
View Full Code Here

            { 0x01 } ) );
        assertTrue( attr.isValid( atCN ) );

        // test a SINGLE-VALUE attribute. CountryName is SINGLE-VALUE
        attr.clear();
        attr.apply( atC );
        attr.add( "FR" );
        assertTrue( attr.isValid( atC ) );
        assertEquals( 0, attr.add( "US" ) );
        assertFalse( attr.contains( "US" ) );
        assertTrue( attr.isValid( atC ) );
View Full Code Here

            { 0x01 } ) );
        assertTrue( attr.isValid( atCN ) );

        // test a SINGLE-VALUE attribute. CountryName is SINGLE-VALUE
        attr.clear();
        attr.apply( atC );
        attr.add( "FR" );
        assertTrue( attr.isValid( atC ) );
        assertEquals( 0, attr.add( "US" ) );
        assertFalse( attr.contains( "US" ) );
        assertTrue( attr.isValid( atC ) );
View Full Code Here

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

        Attribute attribute2 = new DefaultAttribute( cn );
        attribute2.readExternal( in );
        attribute2.apply( cn );

        assertEquals( attribute1, attribute2 );
    }

View Full Code Here

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

        Attribute attribute2 = new DefaultAttribute( cn );
        attribute2.readExternal( in );
        attribute2.apply( cn );

        assertEquals( attribute1, attribute2 );
        assertEquals( "CommonName", attribute2.getUpId() );
    }
View Full Code Here

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

        Attribute attribute2 = new DefaultAttribute( cn );
        attribute2.readExternal( in );
        attribute2.apply( cn );

        assertEquals( attribute1, attribute2 );
        assertEquals( "CN", attribute2.getUpId() );
    }
View Full Code Here

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

        Attribute attribute2 = new DefaultAttribute( userCertificate );
        attribute2.readExternal( in );
        attribute2.apply( userCertificate );

        assertEquals( attribute1, attribute2 );
    }

View Full Code Here

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

        Attribute attribute2 = new DefaultAttribute( userCertificate );
        attribute2.readExternal( in );
        attribute2.apply( userCertificate );

        assertEquals( attribute1, attribute2 );
    }

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.