Package org.apache.directory.shared.ldap.entry

Examples of org.apache.directory.shared.ldap.entry.StringValue


    @Test
    public void testEvaluatorWithoutDescendants() throws Exception
    {
        AttributeType at = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.C_POSTALCODE_AT_OID );
        LessEqNode node = new LessEqNode( SchemaConstants.C_POSTALCODE_AT_OID, new StringValue( at, "2" ) );

        LessEqEvaluator evaluator = new LessEqEvaluator( node, store, schemaManager );
        ForwardIndexEntry<String, ServerEntry, Long> indexEntry = new ForwardIndexEntry<String, ServerEntry, Long>();
        assertEquals( node, evaluator.getExpression() );
        assertEquals( SchemaConstants.C_POSTALCODE_AT_OID, evaluator.getAttributeType().getOid() );
View Full Code Here


    @Test
    public void testEvaluatorNotIndexed() throws Exception
    {
        AttributeType at = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.POSTOFFICEBOX_AT_OID );
        LessEqNode node = new LessEqNode( SchemaConstants.POSTOFFICEBOX_AT_OID, new StringValue( at, "3" ) );

        LessEqEvaluator evaluator = new LessEqEvaluator( node, store, schemaManager );
        ForwardIndexEntry<String, ServerEntry, Long> indexEntry = new ForwardIndexEntry<String, ServerEntry, Long>();
        assertEquals( node, evaluator.getExpression() );
        assertEquals( SchemaConstants.POSTOFFICEBOX_AT_OID, evaluator.getAttributeType().getOid() );
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( 1, 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( 1, 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
        EntryAttribute 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( 1, entry.size() );
        assertEquals( "cn", entry.get( atCN ).getUpId() );
View Full Code Here

        assertTrue( schemaManager.add( syntax ) );
        assertTrue( schemaManager.add( at ) );

        try
        {
            LessEqNode node = new LessEqNode( at.getOid(), new StringValue( at, "3" ) );

            new LessEqEvaluator( node, store, schemaManager );
        }
        finally
        {
View Full Code Here

        List<String> names = new ArrayList<String>();
        names.add( "bogus" );
        desc.setNames( names );
        desc.setObsolete( false );

        LessEqNode node = new LessEqNode( at.getOid(), new StringValue( at, "3" ) );
        new LessEqEvaluator( node, store, schemaManager );
        schemaManager.delete( at );
    }
View Full Code Here

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

        EntryAttribute result = entry.put( "CN", atCN, test1, test2, test3 );
        assertNotNull( result );
        assertEquals( "cn", result.getUpId() );
        assertEquals( 1, entry.size() );
View Full Code Here

        assertEquals( "commonName", entry.get( atCN ).getUpId() );
        assertTrue( entry.containsAttribute( "cn" ) );
        assertNull( entry.get( atCN ).get().get() );

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

        EntryAttribute result = entry.put( "CN", test1, test2, test3 );
        assertNotNull( result );
        assertEquals( "commonName", result.getUpId() );
        assertEquals( 1, entry.size() );
View Full Code Here

    @Test
    public void testRemoveAttributeTypeValueArray() throws Exception
    {
        ServerEntry entry = new DefaultServerEntry( schemaManager, EXAMPLE_DN );
       
        Value<String> strValue1 = new StringValue( atCN, "test1" );
        Value<String> strValue2 = new StringValue( atCN, "test2" );
        Value<String> strValue3 = new StringValue( atCN, "test3" );
        Value<String> strNullValue = new StringValue( atCN, null);

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

        EntryAttribute attrPWD = new DefaultServerAttribute( atCN, "test1", (String)null, "test2" );
View Full Code Here

    @Test
    public void testRemoveStringValueArray() throws Exception
    {
        ServerEntry entry = new DefaultServerEntry( schemaManager, EXAMPLE_DN );
       
        Value<String> strValue1 = new StringValue( atCN, "test1" );
        Value<String> strValue2 = new StringValue( atCN, "test2" );
        Value<String> strValue3 = new StringValue( atCN, "test3" );
        Value<String> strNullValue = new StringValue( atCN, null);

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

        EntryAttribute attrPWD = new DefaultServerAttribute( atCN, "test1", (String)null, "test2" );
View Full Code Here

        AttributeType atPassword = schemaManager.lookupAttributeTypeRegistry( "userPassword" );
       
        byte[] b1 = StringTools.getBytesUtf8( "test1" );
        byte[] b2 = StringTools.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

TOP

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