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

Examples of org.apache.directory.api.ldap.model.entry.StringValue


    @Test
    public void testPutStringAttributeTypeValueArray() throws Exception
    {
        Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );

        Value<String> strValue1 = new StringValue( atDC, "test1" );
        Value<String> strValue2 = new StringValue( atDC, "test2" );
        Value<String> strValue3 = new StringValue( atDC, "test3" );
        Value<String> strNullValue = new StringValue( atDC, null );

        Value<byte[]> binValue1 = new BinaryValue( atPwd, BYTES1 );

        try
        {
View Full Code Here


    @Test
    public void testPutStringValueArray() throws LdapException
    {
        Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );

        Value<String> strValue1 = new StringValue( atDC, "test1" );
        Value<String> strValue2 = new StringValue( atDC, "test2" );
        Value<String> strValue3 = new StringValue( atDC, "test3" );
        Value<String> strNullValue = new StringValue( atDC, null );

        Value<byte[]> binValue1 = new BinaryValue( atPwd, BYTES1 );

        try
        {
View Full Code Here

            assertTrue( true );
        }

        // Add a single value
        atCN = schemaManager.lookupAttributeTypeRegistry( "cn" );
        Value<?> ssv = new StringValue( atCN, "test" );
        entry.put( atCN, ssv );

        assertEquals( 2, entry.size() );
        assertEquals( "cn", entry.get( atCN ).getUpId() );
        assertEquals( 1, entry.get( atCN ).size() );
        assertEquals( "test", entry.get( atCN ).get().getString() );

        // Add more than one value
        entry.put( atCN, new StringValue( atCN, "test1" ), new StringValue( atCN, "test2" ), new StringValue( atCN,
            "test3" ) );

        assertEquals( 2, entry.size() );
        assertEquals( "cn", entry.get( atCN ).getUpId() );
        assertEquals( 3, entry.get( atCN ).size() );
        assertTrue( entry.contains( "cn", "test1" ) );
        assertTrue( entry.contains( "cn", "test2" ) );
        assertTrue( entry.contains( "cn", "test3" ) );

        // Add twice the same value
        Attribute sa = entry.put( atCN, new StringValue( atCN, "test1" ), new StringValue( atCN, "test2" ),
            new StringValue( atCN, "test1" ) );

        assertEquals( 3, sa.size() );
        assertTrue( sa.contains( "test1", "test2", "test3" ) );
        assertEquals( 2, entry.size() );
        assertEquals( "cn", entry.get( atCN ).getUpId() );
View Full Code Here

        {
            assertTrue( true );
        }

        // Test that we can add some new attributes with values
        Value<String> test1 = new StringValue( atDC, "test1" );
        Value<String> test2 = new StringValue( atDC, "test2" );
        Value<String> test3 = new StringValue( atDC, "test3" );

        Attribute result = entry.put( "DC", atDC, test1, test2, test3 );
        assertNotNull( result );
        assertEquals( "dc", result.getUpId() );
        assertEquals( 1, entry.size() );
View Full Code Here

        assertEquals( "domainComponent", entry.get( atDC ).getUpId() );
        assertTrue( entry.containsAttribute( "dc" ) );
        assertNull( entry.get( atDC ).get().getValue() );

        // Test that we can add some new attributes with values
        Value<String> test1 = new StringValue( atDC, "test1" );
        Value<String> test2 = new StringValue( atDC, "test2" );
        Value<String> test3 = new StringValue( atDC, "test3" );

        Attribute result = entry.put( "DC", test1, test2, test3 );
        assertNotNull( result );
        assertEquals( "domainComponent", result.getUpId() );
        assertEquals( 1, entry.size() );
View Full Code Here

    @Test
    public void testRemoveAttributeTypeValueArray() throws Exception
    {
        Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );

        Value<String> strValue1 = new StringValue( atEMail, "test1" );
        Value<String> strValue2 = new StringValue( atEMail, "test2" );
        Value<String> strValue3 = new StringValue( atEMail, "test3" );
        Value<String> strNullValue = new StringValue( atEMail, null );

        Value<byte[]> binValue1 = new BinaryValue( atPwd, BYTES1 );

        Attribute attrPWD = new DefaultAttribute( atEMail, "test1", ( String ) null, "test2" );
View Full Code Here

    @Test
    public void testRemoveStringValueArray() throws Exception
    {
        Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );

        Value<String> strValue1 = new StringValue( atEMail, "test1" );
        Value<String> strValue2 = new StringValue( atEMail, "test2" );
        Value<String> strValue3 = new StringValue( atEMail, "test3" );
        Value<String> strNullValue = new StringValue( atEMail, null );

        Value<byte[]> binValue1 = new BinaryValue( atPwd, BYTES1 );

        Attribute attrPWD = new DefaultAttribute( atEMail, "test1", ( String ) null, "test2" );
View Full Code Here

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

        byte[] b1 = Strings.getBytesUtf8( "test1" );
        byte[] b2 = Strings.getBytesUtf8( "test2" );

        Value<String> test1 = new StringValue( atCN, "test1" );
        Value<String> test2 = new StringValue( atCN, "test2" );

        Value<byte[]> testB1 = new BinaryValue( atPassword, b1 );
        Value<byte[]> testB2 = new BinaryValue( atPassword, b2 );

        // test a removal of an non existing attribute
View Full Code Here

    {
        Entry entry = new DefaultEntry( schemaManager, EXAMPLE_DN );

        assertEquals( "Entry\n    dn[n]: dc=example,dc=com\n\n", entry.toString() );

        Value<String> strValueTop = new StringValue( "top" );
        Value<String> strValuePerson = new StringValue( "person" );

        Value<byte[]> binValue1 = new BinaryValue( BYTES1 );
        Value<byte[]> binValue2 = new BinaryValue( BYTES2 );
        Value<byte[]> binNullValue = new BinaryValue( ( byte[] ) null );
View Full Code Here

    public List<ReplicaEventLog> getReplicaEventLogs() throws Exception
    {
        List<ReplicaEventLog> replicas = new ArrayList<ReplicaEventLog>();

        // Search for all the consumers
        ExprNode filter = new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue(
            SchemaConstants.ADS_REPL_EVENT_LOG ) );
        SearchRequest searchRequest = new SearchRequestImpl();
        searchRequest.setBase( REPL_CONSUMER_DN );
        searchRequest.setScope( SearchScope.ONELEVEL );
        searchRequest.setFilter( filter );
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.entry.StringValue

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.