directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r638228 [7/20] - in /directory/sandbox/akarasulu/bigbang/apacheds: ./ apacheds-xbean-spring/src/site/ benchmarks/src/site/ bootstrap-extract/src/site/ bootstrap-partition/src/site/ bootstrap-plugin/src/main/java/org/apache/directory/server/...
Date Tue, 18 Mar 2008 06:13:18 GMT
Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-entry/src/test/java/org/apache/directory/server/core/entry/ServerStringValueTest.java Mon Mar 17 23:12:41 2008
@@ -20,16 +20,10 @@
 package org.apache.directory.server.core.entry;
 
 
-import org.apache.directory.shared.ldap.schema.AbstractAttributeType;
-import org.apache.directory.shared.ldap.schema.AbstractMatchingRule;
-import org.apache.directory.shared.ldap.schema.AbstractSyntax;
+import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.ByteArrayComparator;
 import org.apache.directory.shared.ldap.schema.DeepTrimToLowerNormalizer;
-import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.NoOpNormalizer;
-import org.apache.directory.shared.ldap.schema.Normalizer;
-import org.apache.directory.shared.ldap.schema.Syntax;
 import org.apache.directory.shared.ldap.schema.syntax.AcceptAllSyntaxChecker;
 import org.apache.directory.shared.ldap.schema.syntax.SyntaxChecker;
 import org.junit.Before;
@@ -47,8 +41,12 @@
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashSet;
+import java.util.List;
+
+import jdbm.helper.StringComparator;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertFalse;
@@ -70,331 +68,182 @@
  */
 public class ServerStringValueTest
 {
-    static private S s;
-    static private AT at;
-    static private MR mr;
+    private TestServerEntryUtils.S s;
+    private TestServerEntryUtils.AT at;
+    private TestServerEntryUtils.MR mr;
+
     
     /**
-     * A local Syntax class for tests
+     * Initialize an AttributeType and the associated MatchingRule 
+     * and Syntax
      */
-    static class AT extends AbstractAttributeType
+    @Before public void initAT()
     {
-        public static final long serialVersionUID = 0L;
-        AttributeType superior;
-        Syntax syntax;
-        MatchingRule equality;
-        MatchingRule ordering;
-        MatchingRule substr;
-
-        protected AT( String oid )
-        {
-            super( oid );
-        }
-
-        public AttributeType getSuperior() throws NamingException
-        {
-            return superior;
-        }
-
-
-        public Syntax getSyntax() throws NamingException
-        {
-            return syntax;
-        }
-
-
-        public MatchingRule getEquality() throws NamingException
-        {
-            return equality;
-        }
-
-
-        public MatchingRule getOrdering() throws NamingException
-        {
-            return ordering;
-        }
-
-
-        public MatchingRule getSubstr() throws NamingException
-        {
-            return substr;
-        }
-
-
-        public void setSuperior( AttributeType superior )
-        {
-            this.superior = superior;
-        }
-
-
-        public void setSyntax( Syntax syntax )
-        {
-            this.syntax = syntax;
-        }
-
-
-        public void setEquality( MatchingRule equality )
-        {
-            this.equality = equality;
-        }
-
-
-        public void setOrdering( MatchingRule ordering )
-        {
-            this.ordering = ordering;
-        }
-
-
-        public void setSubstr( MatchingRule substr )
-        {
-            this.substr = substr;
-        }
+        s = new TestServerEntryUtils.S( "1.1.1.1", false );
+        s.setSyntaxChecker( new AcceptAllSyntaxChecker( "1.1.1.1" ) );
+        mr = new TestServerEntryUtils.MR( "1.1.2.1" );
+        mr.syntax = s;
+        mr.comparator = new StringComparator();
+        mr.normalizer = new DeepTrimToLowerNormalizer();
+        at = new TestServerEntryUtils.AT( "1.1.3.1" );
+        at.setEquality( mr );
+        at.setOrdering( mr );
+        at.setSubstr( mr );
+        at.setSyntax( s );
     }
-
+    
     /**
-     * A local MatchingRule class for tests
+     * Test the constructor with a null value
      */
-    static class MR extends AbstractMatchingRule
+    @Test 
+    public void testServerStringValueNullValue()
     {
-        public static final long serialVersionUID = 0L;
-        private Syntax syntax;
-        private Comparator comparator;
-        private Normalizer normalizer;
-
-        protected MR( String oid )
-        {
-            super( oid );
-        }
-
-        public Syntax getSyntax() throws NamingException
-        {
-            return syntax;
-        }
-
-        public Comparator getComparator() throws NamingException
-        {
-            return comparator;
-        }
-
-
-        public Normalizer getNormalizer() throws NamingException
-        {
-            return normalizer;
-        }
-
-
-        public void setSyntax( Syntax syntax )
-        {
-            this.syntax = syntax;
-        }
-
-
-        public void setComparator( Comparator<?> comparator )
-        {
-            this.comparator = comparator;
-        }
-
-
-        public void setNormalizer( Normalizer normalizer )
-        {
-            this.normalizer = normalizer;
-        }
+        AttributeType at = TestServerEntryUtils.getIA5StringAttributeType();
+        
+        ServerStringValue value = new ServerStringValue( at, null );
+        
+        assertNull( value.get() );
+        assertTrue( value.isNull() );
     }
-
-
+    
+    
     /**
-     * A local Syntax class used for the tests
+     * Test the getNormalizedValue method
      */
-    static class S extends AbstractSyntax
+    @Test public void testGetNormalizedValue() throws NamingException
     {
-        public static final long serialVersionUID = 0L;
-        SyntaxChecker checker;
-
-        public S( String oid, boolean humanReadible )
-        {
-            super( oid, humanReadible );
-        }
-
-        public void setSyntaxChecker( SyntaxChecker checker )
-        {
-            this.checker = checker;
-        }
-
-        public SyntaxChecker getSyntaxChecker() throws NamingException
-        {
-            return checker;
-        }
+        AttributeType at = TestServerEntryUtils.getIA5StringAttributeType();
+        
+        ServerStringValue value = new ServerStringValue( at, null );
+        
+        assertFalse( value.isNormalized() );
+        assertNull( value.getNormalizedValue() );
+        assertTrue( value.isNormalized() );
+
+        value.set( "" );
+        assertFalse( value.isNormalized() );
+        assertEquals( "", value.getNormalizedValue() );
+        assertTrue( value.isNormalized() );
+
+        value.set( "TEST" );
+        assertFalse( value.isNormalized() );
+        assertEquals( "test", value.getNormalizedValue() );
+        assertTrue( value.isNormalized() );
     }
+    
 
-    private AttributeType getCaseIgnoringAttributeNoNumbersType()
+    /**
+     * Test the isValid method
+     * 
+     * The SyntaxChecker does not accept values longer than 5 chars.
+     */
+    @Test public void testIsValid() throws NamingException
     {
-        S s = new S( "1.1.1.1", true );
-
-        s.setSyntaxChecker( new SyntaxChecker()
-        {
-            public String getSyntaxOid()
-            {
-                return "1.1.1.1";
-            }
-            public boolean isValidSyntax( Object value )
-            {
-                if ( !( value instanceof String ) )
-                {
-                    return false;
-                }
+        AttributeType at = TestServerEntryUtils.getIA5StringAttributeType();
+        
+        ServerStringValue value = new ServerStringValue( at, null );
+        assertTrue( value.isValid() );
 
-                String strval = ( String ) value;
-                
-                for ( char c:strval.toCharArray() )
-                {
-                    if ( Character.isDigit( c ) )
-                    {
-                        return false;
-                    }
-                }
-                return true;
-            }
+        value.set( "" );
+        assertTrue( value.isValid() );
 
-            public void assertSyntax( Object value ) throws NamingException
-            {
-                if ( ! isValidSyntax( value ) )
-                {
-                    throw new InvalidAttributeValueException();
-                }
-            }
-        } );
+        value.set( "TEST" );
+        assertTrue( value.isValid() );
 
-        final MR mr = new MR( "1.1.2.1" );
-        mr.syntax = s;
-        mr.comparator = new Comparator<String>()
-        {
-            public int compare( String o1, String o2 )
-            {
-                return ( o1 == null ? 
-                    ( o2 == null ? 0 : -1 ) :
-                    ( o2 == null ? 1 : o1.compareTo( o2 ) ) );
-            }
+        value.set( "testlong" );
+        assertFalse( value.isValid() );
+    }
+    
+    
+    /**
+     * Test the normalize method
+     */
+    @Test
+    public void testNormalize() throws NamingException
+    {
+        AttributeType at = TestServerEntryUtils.getIA5StringAttributeType();
+        ServerStringValue ssv = new ServerStringValue( at );
 
-            int getValue( String val )
-            {
-                if ( val.equals( "LOW" ) ) 
-                {
-                    return 0;
-                }
-                else if ( val.equals( "MEDIUM" ) ) 
-                {
-                    return 1;
-                }
-                else if ( val.equals( "HIGH" ) ) 
-                {
-                    return 2;
-                }
-                
-                throw new IllegalArgumentException( "Not a valid value" );
-            }
-        };
+        ssv.normalize();
+        assertEquals( null, ssv.getNormalizedValue() );
         
-        mr.normalizer = new Normalizer()
-        {
-            public static final long serialVersionUID = 1L;
+        ssv.set( "" );
+        ssv.normalize();
+        assertEquals( "", ssv.getNormalizedValue() );
 
-            public Object normalize( Object value ) throws NamingException
-            {
-                if ( value instanceof String )
-                {
-                    return ( ( String ) value ).toLowerCase();
-                }
-
-                throw new IllegalStateException( "expected string to normalize" );
-            }
-        };
-        
-        AT at = new AT( "1.1.3.1" );
-        at.setEquality( mr );
-        at.setSyntax( s );
-        return at;
+        ssv.set(  "  This is    a   TEST  " );
+        ssv.normalize();
+        assertEquals( "this is a test", ssv.getNormalizedValue() );
     }
+    
 
-
-    private AttributeType getIA5StringAttributeType()
+    /**
+     * Test the instanceOf method
+     */
+    @Test
+    public void testInstanceOf() throws NamingException
     {
-        AT at = new AT( "1.1" );
-
-        S s = new S( "1.1.1", true );
-
-        s.setSyntaxChecker( new SyntaxChecker()
-        {
-            public String getSyntaxOid()
-            {
-                return "1.1.1";
-            }
-            public boolean isValidSyntax( Object value )
-            {
-                return ((String)value).length() < 5 ;
-            }
-
-            public void assertSyntax( Object value ) throws NamingException
-            {
-                if ( ! isValidSyntax( value ) )
-                {
-                    throw new InvalidAttributeValueException();
-                }
-            }
-        } );
-
-        final MR mr = new MR( "1.1.2" );
-        mr.syntax = s;
-        mr.comparator = new Comparator<String>()
-        {
-            public int compare( String o1, String o2 )
-            {
-                return ( ( o1 == null ) ? 
-                    ( o2 == null ? 0 : -1 ) :
-                    ( o2 == null ? 1 : o1.compareTo( o2 ) ) );
-            }
-        };
+        AttributeType at = TestServerEntryUtils.getIA5StringAttributeType();
+        ServerStringValue ssv = new ServerStringValue( at );
         
-        mr.normalizer = new Normalizer()
-        {
-            public static final long serialVersionUID = 1L;
-            
-            public Object normalize( Object value ) throws NamingException
-            {
-                if ( value instanceof String )
-                {
-                    return ( ( String ) value ).toLowerCase();
-                }
+        assertTrue( ssv.instanceOf( at ) );
+        
+        at = TestServerEntryUtils.getBytesAttributeType();
+        
+        assertFalse( ssv.instanceOf( at ) );
+    }    
+    
 
-                throw new IllegalStateException( "expected string to normalize" );
-            }
-        };
+    /**
+     * Test the getAttributeType method
+     */
+    @Test
+    public void testgetAttributeType() throws NamingException
+    {
+        AttributeType at = TestServerEntryUtils.getIA5StringAttributeType();
+        ServerStringValue ssv = new ServerStringValue( at );
         
-        at.setEquality( mr );
-        at.setSyntax( s );
-        return at;
-    }
+        assertEquals( at, ssv.getAttributeType() );
+    }    
 
     
     /**
-     * Initialize an AttributeType and the associated MatchingRule 
-     * and Syntax
+     * Test the equals method
      */
-    @Before public void initAT()
+    @Test public void testEquals()
     {
-        s = new S( "1.1.1.1", false );
-        s.setSyntaxChecker( new AcceptAllSyntaxChecker( "1.1.1.1" ) );
-        mr = new MR( "1.1.2.1" );
-        mr.syntax = s;
-        mr.comparator = new ByteArrayComparator();
-        mr.normalizer = new DeepTrimToLowerNormalizer();
-        at = new AT( "1.1.3.1" );
-        at.setEquality( mr );
-        at.setOrdering( mr );
-        at.setSubstr( mr );
-        at.setSyntax( s );
+        AttributeType at1 = TestServerEntryUtils.getIA5StringAttributeType();
+        AttributeType at2 = TestServerEntryUtils.getBytesAttributeType();
+        
+        ServerStringValue value1 = new ServerStringValue( at1, "test" );
+        ServerStringValue value2 = new ServerStringValue( at1, "test" );
+        ServerStringValue value3 = new ServerStringValue( at1, "TEST" );
+        ServerStringValue value4 = new ServerStringValue( at1, "tes" );
+        ServerStringValue value5 = new ServerStringValue( at1, null );
+        ServerBinaryValue valueBytes = new ServerBinaryValue( at2, new byte[]{0x01} );
+        ServerStringValue valueString = new ServerStringValue( at, "test" );
+        
+        assertTrue( value1.equals( value1 ) );
+        assertTrue( value1.equals( value2 ) );
+        assertTrue( value1.equals( value3 ) );
+        assertFalse( value1.equals( value4 ) );
+        assertFalse( value1.equals( value5 ) );
+        assertFalse( value1.equals( "test" ) );
+        assertFalse( value1.equals( null ) );
+        
+        assertFalse( value1.equals( valueString ) );
+        assertFalse( value1.equals( valueBytes ) );
     }
-    
 
+    
+    
+    
+    
+    
+    
+    
+    
+    
     /**
      * Test the constructor with bad AttributeType
      */
@@ -411,7 +260,7 @@
         }
         
         // create a AT without any syntax
-        AttributeType at = new AT( "1.1.3.1" );
+        AttributeType at = new TestServerEntryUtils.AT( "1.1.3.1" );
         
         try
         {
@@ -426,122 +275,97 @@
 
 
     /**
-     * Test the constructor with a null value
+     * Tests to make sure the hashCode method is working properly.
+     * @throws Exception on errors
      */
-    @Test public void testNullValue()
+    @Test public void testHashCode() throws Exception
     {
-        AttributeType at = getIA5StringAttributeType();
+        AttributeType at1 = TestServerEntryUtils.getCaseIgnoringAttributeNoNumbersType();
+        ServerStringValue v0 = new ServerStringValue( at1, "Alex" );
+        ServerStringValue v1 = new ServerStringValue( at1, "ALEX" );
+        ServerStringValue v2 = new ServerStringValue( at1, "alex" );
+        
+        assertEquals( v0.hashCode(), v1.hashCode() );
+        assertEquals( v0.hashCode(), v2.hashCode() );
+        assertEquals( v1.hashCode(), v2.hashCode() );
         
-        ServerStringValue value = new ServerStringValue( at, null );
+        assertEquals( v0, v1 );
+        assertEquals( v0, v2 );
+        assertEquals( v1, v2 );
         
-        assertNull( value.get() );
-        assertTrue( value.isNull() );
+        assertTrue( v0.isValid() );
+        assertTrue( v1.isValid() );
+        assertTrue( v2.isValid() );
+
+        ServerStringValue v3 = new ServerStringValue( at1, "Timber" );
+        
+        assertTrue( v3.isValid() );
+        assertNotSame( v0.hashCode(), v3.hashCode() );
+
+        ServerStringValue v4 = new ServerStringValue( at, "Alex" );
+        
+        assertNotSame( v0.hashCode(), v4.hashCode() );
     }
     
     
     /**
-     * Test the equals method
+     * Test the compareTo method
      */
-    @Test public void testEquals()
+    @Test
+    public void testCompareTo()
     {
-        AttributeType at = getIA5StringAttributeType();
+        AttributeType at1 = TestServerEntryUtils.getCaseIgnoringAttributeNoNumbersType();
+        ServerStringValue v0 = new ServerStringValue( at1, "Alex" );
+        ServerStringValue v1 = new ServerStringValue( at1, "ALEX" );
         
-        ServerStringValue value1 = new ServerStringValue( at, "test" );
-        ServerStringValue value2 = new ServerStringValue( at, "test" );
-        ServerStringValue value3 = new ServerStringValue( at, "TEST" );
-        ServerStringValue value4 = new ServerStringValue( at, "tes" );
-        ServerStringValue value5 = new ServerStringValue( at, null );
+        assertEquals( 0, v0.compareTo( v1 ) );
+        assertEquals( 0, v1.compareTo( v0 ) );
+
+        ServerStringValue v2 = new ServerStringValue( at1, null );
         
-        assertTrue( value1.equals( value1 ) );
-        assertTrue( value1.equals( value2 ) );
-        assertTrue( value1.equals( value3 ) );
-        assertFalse( value1.equals( value4 ) );
-        assertFalse( value1.equals( value5 ) );
-        assertFalse( value1.equals( "test" ) );
-        assertFalse( value1.equals( null ) );
+        assertEquals( 1, v0.compareTo( v2 ) );
+        assertEquals( -1, v2.compareTo( v0 ) );
     }
 
-    
+
     /**
-     * Test the getNormalized method
-     * TODO testNormalized.
-     *
+     * Test the clone method
      */
-    @Test public void testGetNormalized() throws NamingException
+    @Test
+    public void testClone() throws NamingException
     {
-        AttributeType at = getIA5StringAttributeType();
+        AttributeType at1 = TestServerEntryUtils.getCaseIgnoringAttributeNoNumbersType();
+        ServerStringValue ssv = new ServerStringValue( at1, "Test" );
         
-        ServerStringValue value = new ServerStringValue( at, "TEST" );
+        ServerStringValue ssv1 = (ServerStringValue)ssv.clone();
         
-        assertEquals( "test", value.getNormalized() );
-
-        value = new ServerStringValue( at, null );
+        assertEquals( ssv, ssv1 );
         
-        assertNull( value.getNormalized() );
-    }
-    
-    
-    /**
-     * Test the isValid method
-     * 
-     * The SyntaxChecker does not accept values longer than 5 chars.
-     */
-    @Test public void testIsValid() throws NamingException
-    {
-        AttributeType at = getIA5StringAttributeType();
+        ssv.set( "" );
         
-        ServerStringValue value = new ServerStringValue( at, "test" );
+        assertNotSame( ssv, ssv1 );
+        assertEquals( "", ssv.get() );
         
-        assertTrue( value.isValid() );
-
-        value = new ServerStringValue( at, "testlong" );
+        ssv.set(  "  This is    a   TEST  " );
+        ssv1 = (ServerStringValue)ssv.clone();
         
-        assertFalse( value.isValid() );
+        assertEquals( ssv, ssv1 );
+        
+        ssv.normalize();
+        
+        assertEquals( ssv, ssv1 );
     }
     
-    
-    /**
-     * Tests to make sure the hashCode method is working properly.
-     * @throws Exception on errors
-     */
-    @Test public void testHashCodeValidEquals() throws Exception
-    {
-        AttributeType at = getCaseIgnoringAttributeNoNumbersType();
-        ServerStringValue v0 = new ServerStringValue( at, "Alex" );
-        ServerStringValue v1 = new ServerStringValue( at, "ALEX" );
-        ServerStringValue v2 = new ServerStringValue( at, "alex" );
-        assertEquals( v0.hashCode(), "alex".hashCode() );
-        assertEquals( v1.hashCode(), "alex".hashCode() );
-        assertEquals( v2.hashCode(), "alex".hashCode() );
-        assertEquals( v0, v1 );
-        assertEquals( v0, v2 );
-        assertEquals( v1, v2 );
-        assertTrue( v0.isValid() );
-        assertTrue( v1.isValid() );
-        assertTrue( v2.isValid() );
-
-        ServerStringValue v3 = new ServerStringValue( at, "Timber" );
-        assertFalse( v3.equals( v0 ) );
-        assertFalse( v3.equals( v1 ) );
-        assertFalse( v3.equals( v2 ) );
-        assertTrue( v3.isValid() );
-
-        ServerStringValue v4 = new ServerStringValue( at, "Timber123" );
-        assertFalse( v4.isValid() );
-    }
-
 
     /**
      * Presumes an attribute which constrains it's values to some constant
-     * strings: LOW, MEDUIM, HIGH.  Normalization does nothing. MatchingRules
+     * strings: LOW, MEDIUM, HIGH.  Normalization does nothing. MatchingRules
      * are exact case matching.
      *
      * @throws Exception on errors
      */
     @Test public void testConstrainedString() throws Exception
     {
-        S s = new S( "1.1.1.1", true );
-            
         s.setSyntaxChecker( new SyntaxChecker() {
             public String getSyntaxOid() { return "1.1.1.1"; }
             public boolean isValidSyntax( Object value )
@@ -557,7 +381,6 @@
             { if ( ! isValidSyntax( value ) ) throw new InvalidAttributeValueException(); }
         });
 
-        final MR mr = new MR( "1.1.2.1" );
         mr.syntax = s;
         mr.comparator = new Comparator<String>()
         {
@@ -598,7 +421,6 @@
             }
         };
         mr.normalizer = new NoOpNormalizer();
-        AT at = new AT( "1.1.3.1" );
         at.setEquality( mr );
         at.setSyntax( s );
 
@@ -649,7 +471,7 @@
         assertTrue( "since v4.equals( v5 ) and v4 was added then this should be true", set.contains( v5 ) );
 
         // check ordering based on the comparator
-        ArrayList<ServerValue<String>> list = new ArrayList<ServerValue<String>>();
+        List<Value<String>> list = new ArrayList<Value<String>>();
         list.add( v1 );
         list.add( v3 );
         list.add( v5 );
@@ -734,37 +556,31 @@
         {
             public int compare( ServerStringValue o1, ServerStringValue o2 )
             {
-                byte[] b1 = new byte[0];
-                byte[] b2 = new byte[0];
+                String n1 = null;
+                String n2 = null;
+                
+                if ( o1 != null )
+                {
+                    n1 = o1.get();
+                }
 
-                try
+                if ( o2 != null )
                 {
-                    if ( o1 != null )
-                    {
-                        String n1 = o1.get();
-                        if ( n1 != null )
-                        {
-                            b1 = n1.getBytes( "UTF-8" );
-                        }
-                    }
+                    n2 = o2.get();
+                }
 
-                    if ( o2 != null )
-                    {
-                        String n2 = o2.get();
-                        if ( n2 != null )
-                        {
-                            b2 = o2.get().getBytes( "UTF-8" );
-                        }
-                    }
+                if ( n1 == null )
+                {
+                    return ( n2 == null ) ? 0 : -1;
                 }
-                catch ( Exception e )
+                else if ( n2 == null )
                 {
-                    e.printStackTrace();
+                    return 1;
                 }
 
                 try
                 {
-                    return mr.getComparator().compare( b1, b2 );
+                    return mr.getComparator().compare( n1, n2 );
                 }
                 catch ( Exception e )
                 {
@@ -801,7 +617,7 @@
         ServerStringValue sv = new ServerStringValue( at, "  Test   Test  " );
         
         sv.normalize();
-        String normalized = sv.getNormalized();
+        String normalized = sv.getNormalizedValue();
         
         assertEquals( "test test", normalized );
         assertEquals( "  Test   Test  ", sv.get() );
@@ -832,7 +648,7 @@
         ServerStringValue sv = new ServerStringValue( at, "test" );
         
         sv.normalize();
-        String normalized = sv.getNormalized();
+        String normalized = sv.getNormalizedValue();
         
         assertEquals( "test", normalized );
         assertEquals( "test", sv.get() );
@@ -864,7 +680,7 @@
         ServerStringValue sv = new ServerStringValue( at );
         
         sv.normalize();
-        String normalized = sv.getNormalized();
+        String normalized = sv.getNormalizedValue();
         
         assertEquals( null, normalized );
         assertEquals( null, sv.get() );
@@ -896,7 +712,7 @@
         ServerStringValue sv = new ServerStringValue( at, "" );
         
         sv.normalize();
-        String normalized = sv.getNormalized();
+        String normalized = sv.getNormalizedValue();
         
         assertEquals( "", normalized );
         assertEquals( "", sv.get() );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java Mon Mar 17 23:12:41 2008
@@ -25,7 +25,7 @@
 import org.apache.directory.server.core.authn.LdapPrincipal;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.ldif.ChangeType;
-import org.apache.directory.shared.ldap.ldif.Entry;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -89,16 +89,16 @@
     {
         LdapContext rootDSE = getRootContext( service );
         LdifReader reader = new LdifReader();
-        List<Entry> entries = reader.parseLdif( ldif );
+        List<LdifEntry> entries = reader.parseLdif( ldif );
 
-        for ( Entry entry : entries )
+        for ( LdifEntry entry : entries )
         {
             rootDSE.createSubcontext( new LdapDN( entry.getDn() ), entry.getAttributes() );
         }
     }
 
 
-    public static Entry getUserAddLdif() throws InvalidNameException
+    public static LdifEntry getUserAddLdif() throws InvalidNameException
     {
         return getUserAddLdif( "uid=akarasulu,ou=users,ou=system", "test".getBytes(), "Alex Karasulu", "Karasulu" );
     }
@@ -143,7 +143,7 @@
     }
 
 
-    public static void apply( LdapContext root, Entry entry ) throws NamingException
+    public static void apply( LdapContext root, LdifEntry entry ) throws NamingException
     {
         LdapDN dn = new LdapDN( entry.getDn() );
 
@@ -203,11 +203,11 @@
     }
 
 
-    public static Entry getUserAddLdif( String dnstr, byte[] password, String cn, String sn )
+    public static LdifEntry getUserAddLdif( String dnstr, byte[] password, String cn, String sn )
             throws InvalidNameException
     {
         LdapDN dn = new LdapDN( dnstr );
-        Entry ldif = new Entry();
+        LdifEntry ldif = new LdifEntry();
         ldif.setDn( dnstr );
         ldif.setChangeType( ChangeType.Add );
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java Mon Mar 17 23:12:41 2008
@@ -28,6 +28,8 @@
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.ArrayUtils;
+import org.apache.directory.shared.ldap.util.StringTools;
+
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
@@ -136,7 +138,7 @@
                 "secret".getBytes(), "simple", "ou=system" );
         Attributes attrs = ctx.getAttributes( "uid=admin" );
         performAdminAccountChecks( attrs );
-        assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), "secret".getBytes() ) );
+        assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), StringTools.getBytesUtf8( "secret" ) ) );
         ctx.close();
 
         service.shutdown();
@@ -146,7 +148,7 @@
                 "secret".getBytes(), "simple", "ou=system" );
         attrs = ctx.getAttributes( "uid=admin" );
         performAdminAccountChecks( attrs );
-        assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), "secret".getBytes() ) );
+        assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), StringTools.getBytesUtf8( "secret" ) ) );
         ctx.close();
     }
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java Mon Mar 17 23:12:41 2008
@@ -27,6 +27,8 @@
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.util.ArrayUtils;
+import org.apache.directory.shared.ldap.util.StringTools;
+
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
@@ -110,7 +112,7 @@
         attributes.put( "userPassword", "replaced" );
         sysRoot.modifyAttributes( "uid=admin", DirContext.REPLACE_ATTRIBUTE, attributes );
         Attributes newAttrs = sysRoot.getAttributes( "uid=admin" );
-        assertTrue( ArrayUtils.isEquals( "replaced".getBytes(), newAttrs.get( "userPassword" ).get() ) );
+        assertTrue( ArrayUtils.isEquals( StringTools.getBytesUtf8( "replaced" ), newAttrs.get( "userPassword" ).get() ) );
     }
 
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsNonAdminIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsNonAdminIT.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsNonAdminIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsNonAdminIT.java Mon Mar 17 23:12:41 2008
@@ -27,7 +27,7 @@
 import static org.apache.directory.server.core.integ.IntegrationUtils.getUserAddLdif;
 import org.apache.directory.server.core.integ.annotations.Factory;
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
-import org.apache.directory.shared.ldap.ldif.Entry;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
@@ -66,7 +66,7 @@
     @Test
     public void testNoDeleteOnAdminByNonAdmin() throws NamingException
     {
-        Entry akarasulu = getUserAddLdif();
+        LdifEntry akarasulu = getUserAddLdif();
         getRootContext( service ).createSubcontext( akarasulu.getDn(), akarasulu.getAttributes() );
 
         try
@@ -89,7 +89,7 @@
     @Test
     public void testNoRdnChangesOnAdminByNonAdmin() throws NamingException
     {
-        Entry akarasulu = getUserAddLdif();
+        LdifEntry akarasulu = getUserAddLdif();
         getRootContext( service ).createSubcontext( akarasulu.getDn(), akarasulu.getAttributes() );
         LdapContext sysRoot = getContext( akarasulu.getDn(), service, "ou=system" );
 
@@ -113,7 +113,7 @@
     @Test
     public void testModifyOnAdminByNonAdmin() throws NamingException
     {
-        Entry akarasulu = getUserAddLdif();
+        LdifEntry akarasulu = getUserAddLdif();
         getRootContext( service ).createSubcontext( akarasulu.getDn(), akarasulu.getAttributes() );
         LdapContext sysRoot = getContext( akarasulu.getDn(), service, "ou=system" );
 
@@ -140,7 +140,7 @@
     @Test
     public void testSearchSubtreeByNonAdmin() throws NamingException
     {
-        Entry akarasulu = getUserAddLdif();
+        LdifEntry akarasulu = getUserAddLdif();
         getRootContext( service ).createSubcontext( akarasulu.getDn(), akarasulu.getAttributes() );
         LdapContext sysRoot = getContext( akarasulu.getDn(), service, "ou=system" );
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authz/CompareAuthorizationIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authz/CompareAuthorizationIT.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authz/CompareAuthorizationIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/authz/CompareAuthorizationIT.java Mon Mar 17 23:12:41 2008
@@ -266,7 +266,7 @@
     {
         DirContext adminCtx = getContextAsAdmin();
         Attributes user = new AttributesImpl( "uid", "bob", true );
-        user.put( "userPassword", "bobspassword".getBytes() );
+        user.put( "userPassword", "bobspassword" );
         Attribute objectClass = new AttributeImpl( "objectClass" );
         user.put( objectClass );
         objectClass.add( "top" );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER169IT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER169IT.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER169IT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER169IT.java Mon Mar 17 23:12:41 2008
@@ -25,6 +25,8 @@
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.util.StringTools;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import org.junit.Test;
@@ -152,8 +154,8 @@
         ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
 
         String filter = "(userPassword={0})";
-        NamingEnumeration<SearchResult> results = ctx.search( "uid=bob,ou=people", filter, new Object[]
-                                                                                            { "bobspassword" }, ctls );
+        NamingEnumeration<SearchResult> results = 
+            ctx.search( "uid=bob,ou=people", filter, new Object[] { "bobspassword" }, ctls );
 
         // We should have a match
         assertTrue( results.hasMore() );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER791IT.java Mon Mar 17 23:12:41 2008
@@ -223,7 +223,7 @@
         DirContext ctx = new InitialDirContext( env );
 
 
-        Attribute attr = new AttributeImpl("bootParameter", "test");
+        Attribute attr = new AttributeImpl("javaDoc", "test");
         ModificationItemImpl modification = new ModificationItemImpl(DirContext.ADD_ATTRIBUTE, attr);
     
         try 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListIT.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListIT.java Mon Mar 17 23:12:41 2008
@@ -26,7 +26,7 @@
 import static org.apache.directory.server.core.integ.IntegrationUtils.getRootContext;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getContext;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
-import org.apache.directory.shared.ldap.ldif.Entry;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
 
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertFalse;
@@ -57,7 +57,7 @@
     @Test
     public void testListSystemAsNonAdmin() throws NamingException
     {
-        Entry akarasulu = getUserAddLdif();
+        LdifEntry akarasulu = getUserAddLdif();
         getRootContext( service ).createSubcontext( akarasulu.getDn(), akarasulu.getAttributes() );
 
         LdapContext sysRoot = getContext( akarasulu.getDn(), service, "ou=system" );
@@ -79,7 +79,7 @@
     @Test
     public void testListUsersAsNonAdmin() throws NamingException
     {
-        Entry akarasulu = getUserAddLdif();
+        LdifEntry akarasulu = getUserAddLdif();
         getRootContext( service ).createSubcontext( akarasulu.getDn(), akarasulu.getAttributes() );
 
         LdapContext sysRoot = getContext( akarasulu.getDn(), service, "ou=system" );
@@ -121,7 +121,7 @@
     {
         LdapContext sysRoot = getSystemContext( service );
         HashSet<String> set = new HashSet<String>();
-        Entry akarasulu = getUserAddLdif();
+        LdifEntry akarasulu = getUserAddLdif();
         getRootContext( service ).createSubcontext( akarasulu.getDn(), akarasulu.getAttributes() );
 
         NamingEnumeration<NameClassPair> list = sysRoot.list( "ou=users" );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ModifyContextIT.java Mon Mar 17 23:12:41 2008
@@ -26,7 +26,7 @@
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getUserAddLdif;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
-import org.apache.directory.shared.ldap.ldif.Entry;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import static org.junit.Assert.assertEquals;
@@ -64,7 +64,7 @@
      */
     protected void createData() throws NamingException
     {
-        Entry akarasulu = getUserAddLdif();
+        LdifEntry akarasulu = getUserAddLdif();
         getRootContext( service ).createSubcontext( akarasulu.getDn(), akarasulu.getAttributes() );
         LdapContext sysRoot = getSystemContext( service );
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ObjStateFactoryIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ObjStateFactoryIT.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ObjStateFactoryIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ObjStateFactoryIT.java Mon Mar 17 23:12:41 2008
@@ -28,7 +28,8 @@
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.util.ArrayUtils;
-import org.apache.directory.shared.ldap.ldif.Entry;
+import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertNull;
@@ -62,7 +63,7 @@
     @Test
     public void testObjectFactory() throws NamingException
     {
-        Entry akarasulu = getUserAddLdif();
+        LdifEntry akarasulu = getUserAddLdif();
         getRootContext( service ).createSubcontext( akarasulu.getDn(), akarasulu.getAttributes() );
 
         LdapContext sysRoot = getSystemContext( service );
@@ -73,7 +74,7 @@
         Person me = ( Person ) obj;
         assertEquals( attrs.get( "sn" ).get(), me.getLastname() );
         assertEquals( attrs.get( "cn" ).get(), me.getCn() );
-        assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), "test".getBytes() ) );
+        assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), StringTools.getBytesUtf8( "test" ) ) );
         assertEquals( attrs.get( "telephonenumber" ).get(), me.getTelephoneNumber() );
         assertNull( me.getSeealso() );
         assertNull( me.getDescription() );
@@ -91,7 +92,7 @@
         Attributes attrs = sysRoot.getAttributes( "uid=erodriguez, ou=users" );
         assertEquals( "Rodriguez", attrs.get( "sn" ).get() );
         assertEquals( "Mr. Kerberos", attrs.get( "cn" ).get() );
-        assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), "noices".getBytes() ) );
+        assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), StringTools.getBytesUtf8( "noices" ) ) );
         assertEquals( "555-1212", attrs.get( "telephonenumber" ).get() );
         assertEquals( "sn=erodriguez", attrs.get( "seealso" ).get() );
         assertEquals( "committer", attrs.get( "description" ).get() );
@@ -186,7 +187,6 @@
             throws Exception
         {
             // Only interested in Attributes with "person" objectclass
-            // System.out.println("object factory: " + attrs);
             Attribute oc = ( attrs != null ? attrs.get( "objectclass" ) : null );
             if ( oc != null && oc.contains( "person" ) )
             {

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java Mon Mar 17 23:12:41 2008
@@ -27,7 +27,7 @@
 import static org.apache.directory.server.core.integ.IntegrationUtils.getRootContext;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
-import org.apache.directory.shared.ldap.ldif.Entry;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
@@ -99,7 +99,7 @@
         String ref2 = "ldap://maxwell:10389/ou=users,ou=system";
         td.rootCtx = getSystemContext( service );
 
-        Entry akarasulu = getUserAddLdif();
+        LdifEntry akarasulu = getUserAddLdif();
         getRootContext( service ).createSubcontext( akarasulu.getDn(), akarasulu.getAttributes() );
 
         // -------------------------------------------------------------------

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java Mon Mar 17 23:12:41 2008
@@ -122,8 +122,36 @@
         DirContext ctx = ( DirContext ) initCtx.lookup( "" );
 
         Attributes attributes = ctx.getAttributes( "", new String[]
-            { "namingContexts", "vendorName" } );
+            { "namingContexts", "VENDORNAME" } );
         assertEquals( 2, attributes.size() );
+        assertEquals( "Apache Software Foundation", attributes.get( "vendorName" ).get() );
+        assertTrue( attributes.get( "namingContexts" ).contains( "ou=system" ) );
+    }
+
+
+    /**
+     * Checks for ObjectClass, namingContexts and vendorName attributes.
+     *
+     * @throws NamingException if there are any problems
+     */
+    @Test
+    public void testGetInitialContextLookupAttributesByNameWithOC() throws NamingException
+    {
+        Hashtable<String,Object> env = new Hashtable<String,Object>();
+        env.put( DirectoryService.JNDI_KEY, service );
+        env.put( Context.PROVIDER_URL, "" );
+        env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
+        env.put( Context.SECURITY_CREDENTIALS, "secret" );
+        env.put( Context.SECURITY_AUTHENTICATION, "simple" );
+        env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
+
+        InitialContext initCtx = new InitialContext( env );
+        assertNotNull( initCtx );
+        DirContext ctx = ( DirContext ) initCtx.lookup( "" );
+
+        Attributes attributes = ctx.getAttributes( "", new String[]
+            { "ObjectClass", "namingContexts", "VENDORNAME" } );
+        assertEquals( 3, attributes.size() );
         assertEquals( "Apache Software Foundation", attributes.get( "vendorName" ).get() );
         assertTrue( attributes.get( "namingContexts" ).contains( "ou=system" ) );
     }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchIT.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchIT.java Mon Mar 17 23:12:41 2008
@@ -21,6 +21,7 @@
 
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
 import org.apache.directory.server.core.enumeration.SearchResultFilteringEnumeration;
 import org.apache.directory.server.core.integ.CiRunner;
@@ -345,12 +346,20 @@
         }
 
         // 13 because it also matches organizationalPerson which the admin is
-        assertEquals( "Expected number of results returned was incorrect", 12, map.size() );
+        assertEquals( "Expected number of results returned was incorrect", 13, map.size() );
         assertTrue( map.containsKey( "ou=system" ) );
+        assertTrue( map.containsKey( "ou=configuration,ou=system" ) );
+        assertTrue( map.containsKey( "ou=interceptors,ou=configuration,ou=system" ) );
+        assertTrue( map.containsKey( "ou=partitions,ou=configuration,ou=system" ) );
+        assertTrue( map.containsKey( "ou=services,ou=configuration,ou=system" ) );
+        assertTrue( map.containsKey( "ou=groups,ou=system" ) );
         assertTrue( map.containsKey( "ou=testing00,ou=system" ) );
         assertTrue( map.containsKey( "ou=testing01,ou=system" ) );
-        assertTrue( map.containsKey( "ou=testing02,ou=system" ) );
         assertTrue( map.containsKey( "ou=subtest,ou=testing01,ou=system" ) );
+        assertTrue( map.containsKey( "ou=testing02,ou=system" ) );
+        assertTrue( map.containsKey( "ou=users,ou=system" ) );
+        assertTrue( map.containsKey( "prefNodeName=sysPrefRoot,ou=system" ) );
+        assertTrue( map.containsKey( "uid=admin,ou=system" ) );
     }
 
 
@@ -416,7 +425,7 @@
 
 
     @Test
-    public void testSearchTimeLimit() throws NamingException
+    public void testSearchTimeLimit() throws NamingException, InterruptedException
     {
         LdapContext sysRoot = getSystemContext( service );
         createData( sysRoot );
@@ -430,36 +439,24 @@
 
         HashMap<String, Attributes> map = new HashMap<String, Attributes>();
         NamingEnumeration<SearchResult> list = sysRoot.search( "", "(ou=*)", controls );
-        SearchResultFilteringEnumeration srfe = ( SearchResultFilteringEnumeration ) list;
-        srfe.addResultFilter( new SearchResultFilter()
-        {
-            public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
-                throws NamingException
-            {
-                try
-                {
-                    Thread.sleep( 201 );
-                }
-                catch ( InterruptedException e )
-                {
-                    e.printStackTrace();
-                }
-                return true;
-            }
-        } );
 
         try
         {
             while ( list.hasMore() )
             {
                 SearchResult result = ( SearchResult ) list.next();
+                
+                // leep 201 ms before fetching the next element ...
+            	Thread.sleep( 201 );
                 map.put( result.getName(), result.getAttributes() );
             }
+            
             fail( "Should not get here due to a TimeLimitExceededException" );
         }
         catch ( LdapTimeLimitExceededException e )
         {
         }
+        
         assertEquals( "Expected number of results returned was incorrect", 1, map.size() );
     }
     

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java Mon Mar 17 23:12:41 2008
@@ -26,7 +26,7 @@
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getUserAddLdif;
 import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
-import org.apache.directory.shared.ldap.ldif.Entry;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
@@ -269,7 +269,7 @@
     @Test
     public void testConfirmNonAdminUserDnIsCreatorsName() throws NamingException
     {
-        Entry akarasulu = getUserAddLdif();
+        LdifEntry akarasulu = getUserAddLdif();
         getRootContext( service ).createSubcontext( akarasulu.getDn(), akarasulu.getAttributes() );
 
         LdapContext sysRoot = getSystemContext( service );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java Mon Mar 17 23:12:41 2008
@@ -26,7 +26,7 @@
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
-import org.apache.directory.shared.ldap.ldif.Entry;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
@@ -155,8 +155,8 @@
 
         StringReader in = new StringReader( numberOfGunsAttrLdif + "\n\n" + shipOCLdif );
         LdifReader ldifReader = new LdifReader( in );
-        Entry numberOfGunsAttrEntry = ldifReader.next();
-        Entry shipOCEntry = ldifReader.next();
+        LdifEntry numberOfGunsAttrEntry = ldifReader.next();
+        LdifEntry shipOCEntry = ldifReader.next();
         assertFalse( ldifReader.hasNext() );
         
         // should be fine with unique OID

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-plugin/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-plugin/pom.xml?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-plugin/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-plugin/pom.xml Mon Mar 17 23:12:41 2008
@@ -44,11 +44,6 @@
     </dependency>
 
     <dependency>
-      <groupId>antlr</groupId>
-      <artifactId>antlr</artifactId>
-    </dependency>
-
-    <dependency>
       <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-core-shared</artifactId>
       <version>${pom.version}</version>
@@ -60,23 +55,5 @@
     </dependency>
   </dependencies>
 
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-antlr-plugin</artifactId>
-        <configuration>
-          <grammars>openldap.g</grammars>
-        </configuration>
-        <executions>
-          <execution>
-            <goals>
-              <goal>generate</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
 </project>
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/DirectorySchemaToolMojo.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/DirectorySchemaToolMojo.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/DirectorySchemaToolMojo.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/DirectorySchemaToolMojo.java Mon Mar 17 23:12:41 2008
@@ -35,6 +35,9 @@
 import org.apache.directory.server.schema.bootstrap.BootstrapSchema;
 import org.apache.directory.server.schema.bootstrap.ProducerTypeEnum;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.schema.parser.AttributeTypeLiteral;
+import org.apache.directory.shared.ldap.schema.parser.ObjectClassLiteral;
+import org.apache.directory.shared.ldap.schema.parser.OpenLdapSchemaParser;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.project.MavenProject;

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractTestCase.java Mon Mar 17 23:12:41 2008
@@ -26,7 +26,7 @@
 import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.schema.registries.Registries;
-import org.apache.directory.shared.ldap.ldif.Entry;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.slf4j.Logger;
@@ -94,7 +94,7 @@
     protected boolean doDelete = true;
 
     /** A testEntries of entries as Attributes to add to the DIT for testing */
-    protected List<Entry> testEntries = new ArrayList<Entry>();
+    protected List<LdifEntry> testEntries = new ArrayList<LdifEntry>();
 
     /** An optional LDIF file path if set and present is read to add more test entries */
     private String ldifPath;
@@ -179,8 +179,8 @@
         // -------------------------------------------------------------------
 
         LdifReader reader = new LdifReader();
-    	List<Entry> entries = reader.parseLdif( LDIF );
-        Entry entry = entries.get(0);
+    	List<LdifEntry> entries = reader.parseLdif( LDIF );
+        LdifEntry entry = entries.get(0);
         testEntries.add( entry );
 
         // -------------------------------------------------------------------
@@ -214,7 +214,7 @@
 
         if ( in != null )
         {
-            Iterator<Entry> list = new LdifReader( in );
+            Iterator<LdifEntry> list = new LdifReader( in );
             
             while ( list.hasNext() )
             {
@@ -426,9 +426,9 @@
     protected void injectEntries( String ldif ) throws NamingException
     {
         LdifReader reader = new LdifReader();
-        List<Entry> entries = reader.parseLdif( ldif );
+        List<LdifEntry> entries = reader.parseLdif( ldif );
 
-        for ( Entry entry : entries )
+        for ( LdifEntry entry : entries )
         {
             rootDSE.createSubcontext( new LdapDN( entry.getDn() ), entry.getAttributes() );
         }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/IntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/IntegrationUtils.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/IntegrationUtils.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-unit/src/main/java/org/apache/directory/server/core/unit/IntegrationUtils.java Mon Mar 17 23:12:41 2008
@@ -21,7 +21,7 @@
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.shared.ldap.ldif.ChangeType;
-import org.apache.directory.shared.ldap.ldif.Entry;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.slf4j.Logger;
@@ -71,14 +71,14 @@
     }
 
 
-    public static Entry getUserAddLdif() throws InvalidNameException
+    public static LdifEntry getUserAddLdif() throws InvalidNameException
     {
         return getUserAddLdif( "uid=akarasulu,ou=users,ou=system", "test".getBytes(), "Alex Karasulu", "Karasulu" );
     }
 
 
 
-    public static void apply( LdapContext root, Entry entry ) throws NamingException
+    public static void apply( LdapContext root, LdifEntry entry ) throws NamingException
     {
         LdapDN dn = new LdapDN( entry.getDn() );
 
@@ -138,11 +138,11 @@
     }
 
 
-    public static Entry getUserAddLdif( String dnstr, byte[] password, String cn, String sn )
+    public static LdifEntry getUserAddLdif( String dnstr, byte[] password, String cn, String sn )
             throws InvalidNameException
     {
         LdapDN dn = new LdapDN( dnstr );
-        Entry ldif = new Entry();
+        LdifEntry ldif = new LdifEntry();
         ldif.setDn( dnstr );
         ldif.setChangeType( ChangeType.Add );
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Mon Mar 17 23:12:41 2008
@@ -84,9 +84,8 @@
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
 import org.apache.directory.shared.ldap.ldif.ChangeType;
-import org.apache.directory.shared.ldap.ldif.Entry;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.ldif.LdifReader;
-import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -108,6 +107,7 @@
 import java.io.IOException;
 import java.io.StringReader;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.List;
@@ -230,7 +230,7 @@
     private List<Interceptor> interceptors;
     private Partition systemPartition;
     private Set<Partition> partitions = new HashSet<Partition>();
-    private List<? extends Entry> testEntries = new ArrayList<Entry>(); // List<Attributes>
+    private List<? extends LdifEntry> testEntries = new ArrayList<LdifEntry>(); // List<Attributes>
 
 
 
@@ -371,15 +371,15 @@
 
 
     /**
-     * Returns test directory entries({@link Entry}) to be loaded while
+     * Returns test directory entries({@link LdifEntry}) to be loaded while
      * bootstrapping.
      *
      * @org.apache.xbean.Property nestedType="org.apache.directory.shared.ldap.ldif.Entry"
      * @return test entries to load during bootstrapping
      */
-    public List<Entry> getTestEntries()
+    public List<LdifEntry> getTestEntries()
     {
-        List<Entry> cloned = new ArrayList<Entry>();
+        List<LdifEntry> cloned = new ArrayList<LdifEntry>();
         cloned.addAll( testEntries );
         return cloned;
     }
@@ -392,10 +392,10 @@
      * @org.apache.xbean.Property nestedType="org.apache.directory.shared.ldap.ldif.Entry"
      * @param testEntries the test entries to load while bootstrapping
      */
-    public void setTestEntries( List<? extends Entry> testEntries )
+    public void setTestEntries( List<? extends LdifEntry> testEntries )
     {
         //noinspection MismatchedQueryAndUpdateOfCollection
-        List<Entry> cloned = new ArrayList<Entry>();
+        List<LdifEntry> cloned = new ArrayList<LdifEntry>();
         cloned.addAll( testEntries );
         this.testEntries = testEntries;
     }
@@ -600,9 +600,6 @@
         }
 
         Hashtable<String, Object> environment = new Hashtable<String, Object>();
-        environment.remove( Context.SECURITY_PRINCIPAL );
-        environment.remove( Context.SECURITY_CREDENTIALS );
-        environment.remove( Context.SECURITY_AUTHENTICATION );
 
         if ( principal != null )
         {
@@ -695,12 +692,11 @@
             while ( cursor.previous() ) // apply ldifs in reverse order
             {
                 ChangeLogEvent event = cursor.get();
-                Entry reverse = event.getReverseLdif();
-
+                LdifEntry reverse = event.getReverseLdif();
+                
                 switch( reverse.getChangeType().getChangeType() )
                 {
                     case( ChangeType.ADD_ORDINAL ):
-                        //System.out.println( "Reverted attributes : --> " + reverse.getObject() );
                         ctx.createSubcontext( reverse.getDn(), reverse.getAttributes() );
                         break;
                     case( ChangeType.DELETE_ORDINAL ):
@@ -988,7 +984,7 @@
                                 SchemaConstants.INET_ORG_PERSON_OC );
 
             serverEntry.put( SchemaConstants.UID_AT, PartitionNexus.ADMIN_UID );
-            serverEntry.put( SchemaConstants.USER_PASSWORD_AT, PartitionNexus.ADMIN_PASSWORD );
+            serverEntry.put( SchemaConstants.USER_PASSWORD_AT, PartitionNexus.ADMIN_PASSWORD_BYTES );
             serverEntry.put( SchemaConstants.DISPLAY_NAME_AT, "Directory Superuser" );
             serverEntry.put( SchemaConstants.CN_AT, "system administrator" );
             serverEntry.put( SchemaConstants.SN_AT, "administrator" );
@@ -1104,18 +1100,14 @@
         {
             firstStart = true;
 
-            Attributes attributes = new AttributesImpl();
-            Attribute objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
-            objectClass.add( SchemaConstants.TOP_OC );
-            objectClass.add( SchemaConstants.ORGANIZATIONAL_UNIT_OC );
-            attributes.put( objectClass );
-
-            attributes.put( SchemaConstants.OU_AT, "configuration" );
-            attributes.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
-            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+            ServerEntry serverEntry = new DefaultServerEntry( registries, configurationDn );
+            serverEntry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, SchemaConstants.ORGANIZATIONAL_UNIT_OC );
+
+            serverEntry.put( SchemaConstants.OU_AT, "configuration" );
+            serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
+            serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
 
-            ServerEntry entry = ServerEntryUtils.toServerEntry( attributes, configurationDn, registries );
-            partitionNexus.add( new AddOperationContext( registries, configurationDn, entry ) );
+            partitionNexus.add( new AddOperationContext( registries, configurationDn, serverEntry ) );
         }
 
         // -------------------------------------------------------------------
@@ -1129,18 +1121,14 @@
         {
             firstStart = true;
 
-            Attributes attributes = new AttributesImpl();
-            Attribute objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
-            objectClass.add( SchemaConstants.TOP_OC );
-            objectClass.add( SchemaConstants.ORGANIZATIONAL_UNIT_OC );
-            attributes.put( objectClass );
-
-            attributes.put( SchemaConstants.OU_AT, "partitions" );
-            attributes.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
-            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+            ServerEntry serverEntry = new DefaultServerEntry( registries, partitionsDn );
+            serverEntry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, SchemaConstants.ORGANIZATIONAL_UNIT_OC );
 
-            ServerEntry entry = ServerEntryUtils.toServerEntry( attributes, partitionsDn, registries );
-            partitionNexus.add( new AddOperationContext( registries, partitionsDn, entry ) );
+            serverEntry.put( SchemaConstants.OU_AT, "partitions" );
+            serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
+            serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+
+            partitionNexus.add( new AddOperationContext( registries, partitionsDn, serverEntry ) );
         }
 
         // -------------------------------------------------------------------
@@ -1154,18 +1142,14 @@
         {
             firstStart = true;
 
-            Attributes attributes = new AttributesImpl();
-            Attribute objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
-            objectClass.add( SchemaConstants.TOP_OC );
-            objectClass.add( SchemaConstants.ORGANIZATIONAL_UNIT_OC );
-            attributes.put( objectClass );
-
-            attributes.put( SchemaConstants.OU_AT, "services" );
-            attributes.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
-            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+            ServerEntry serverEntry = new DefaultServerEntry( registries, servicesDn );
+            serverEntry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, SchemaConstants.ORGANIZATIONAL_UNIT_OC );
 
-            ServerEntry entry = ServerEntryUtils.toServerEntry( attributes, servicesDn, registries );
-            partitionNexus.add( new AddOperationContext( registries, servicesDn, entry ) );
+            serverEntry.put( SchemaConstants.OU_AT, "services" );
+            serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
+            serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+
+            partitionNexus.add( new AddOperationContext( registries, servicesDn, serverEntry ) );
         }
 
         // -------------------------------------------------------------------
@@ -1179,18 +1163,14 @@
         {
             firstStart = true;
 
-            Attributes attributes = new AttributesImpl();
-            Attribute objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
-            objectClass.add( SchemaConstants.TOP_OC );
-            objectClass.add( SchemaConstants.ORGANIZATIONAL_UNIT_OC );
-            attributes.put( objectClass );
-
-            attributes.put( SchemaConstants.OU_AT, "interceptors" );
-            attributes.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
-            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+            ServerEntry serverEntry = new DefaultServerEntry( registries, interceptorsDn );
+            serverEntry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, SchemaConstants.ORGANIZATIONAL_UNIT_OC );
 
-            ServerEntry entry = ServerEntryUtils.toServerEntry( attributes, interceptorsDn, registries );
-            partitionNexus.add( new AddOperationContext( registries, interceptorsDn, entry ) );
+            serverEntry.put( SchemaConstants.OU_AT, "interceptors" );
+            serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
+            serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+
+            partitionNexus.add( new AddOperationContext( registries, interceptorsDn, serverEntry ) );
         }
 
         // -------------------------------------------------------------------
@@ -1204,19 +1184,17 @@
         {
             firstStart = true;
 
-            Attributes attributes = new AttributesImpl();
-            Attribute objectClass = new AttributeImpl( SchemaConstants.OBJECT_CLASS_AT );
-            objectClass.add( SchemaConstants.TOP_OC );
-            objectClass.add( SchemaConstants.ORGANIZATIONAL_UNIT_OC );
-            attributes.put( objectClass );
-
-            attributes.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.EXTENSIBLE_OBJECT_OC );
-            attributes.put( "prefNodeName", "sysPrefRoot" );
-            attributes.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
-            attributes.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+            ServerEntry serverEntry = new DefaultServerEntry( registries, sysPrefRootDn );
+            serverEntry.put( SchemaConstants.OBJECT_CLASS_AT, 
+                SchemaConstants.TOP_OC, 
+                SchemaConstants.ORGANIZATIONAL_UNIT_OC,
+                SchemaConstants.EXTENSIBLE_OBJECT_OC );
 
-            ServerEntry entry = ServerEntryUtils.toServerEntry( attributes, sysPrefRootDn, registries );
-            partitionNexus.add( new AddOperationContext( registries, sysPrefRootDn, entry ) );
+            serverEntry.put( "prefNodeName", "sysPrefRoot" );
+            serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
+            serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
+
+            partitionNexus.add( new AddOperationContext( registries, sysPrefRootDn, serverEntry ) );
         }
 
         return firstStart;
@@ -1235,16 +1213,16 @@
         LdapDN adminDn = new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN );
         adminDn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
         
-        Attributes adminEntry = partitionNexus.lookup( new LookupOperationContext( registries, adminDn ) );
+        ServerEntry adminEntry = partitionNexus.lookup( new LookupOperationContext( registries, adminDn ) );
         Object userPassword = adminEntry.get( SchemaConstants.USER_PASSWORD_AT ).get();
+        
         if ( userPassword instanceof byte[] )
         {
-            needToChangeAdminPassword = PartitionNexus.ADMIN_PASSWORD.equals( new String(
-                ( byte[] ) userPassword ) );
+            needToChangeAdminPassword = Arrays.equals( PartitionNexus.ADMIN_PASSWORD_BYTES, ( byte[] ) userPassword );
         }
-        else if ( userPassword.toString().equals( PartitionNexus.ADMIN_PASSWORD ) )
+        else if ( userPassword.toString().equals( PartitionNexus.ADMIN_PASSWORD_STRING ) )
         {
-            needToChangeAdminPassword = PartitionNexus.ADMIN_PASSWORD.equals( userPassword.toString() );
+            needToChangeAdminPassword = PartitionNexus.ADMIN_PASSWORD_STRING.equals( userPassword.toString() );
         }
 
         if ( needToChangeAdminPassword )
@@ -1267,11 +1245,11 @@
         LdapPrincipal principal = new LdapPrincipal( adminDn, AuthenticationLevel.SIMPLE );
         ServerLdapContext ctx = new ServerLdapContext( this, principal, new LdapDN() );
 
-        for ( Entry testEntry : testEntries )
+        for ( LdifEntry testEntry : testEntries )
         {
             try
             {
-                Entry entry = testEntry.clone();
+                LdifEntry entry = testEntry.clone();
                 Attributes attributes = entry.getAttributes();
                 String dn = entry.getDn();
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/DirectoryService.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/DirectoryService.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/DirectoryService.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/DirectoryService.java Mon Mar 17 23:12:41 2008
@@ -31,7 +31,7 @@
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.core.schema.SchemaService;
 import org.apache.directory.server.schema.registries.Registries;
-import org.apache.directory.shared.ldap.ldif.Entry;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 import javax.naming.Context;
@@ -279,12 +279,12 @@
 
 
     /**
-     * Returns test directory entries({@link Entry}) to be loaded while
+     * Returns test directory entries({@link LdifEntry}) to be loaded while
      * bootstrapping.
      *
      * @return test entries to load during bootstrapping
      */
-    List<Entry> getTestEntries();
+    List<LdifEntry> getTestEntries();
 
 
     /**
@@ -293,7 +293,7 @@
      *
      * @param testEntries the test entries to load while bootstrapping
      */
-    void setTestEntries( List<? extends Entry> testEntries );
+    void setTestEntries( List<? extends LdifEntry> testEntries );
 
 
     /**

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java Mon Mar 17 23:12:41 2008
@@ -31,6 +31,7 @@
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.Interceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
@@ -62,8 +63,6 @@
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.SearchResult;
 
 
 /**
@@ -267,7 +266,7 @@
     }
 
 
-    public NamingEnumeration<SearchResult> list( NextInterceptor next, ListOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> list( NextInterceptor next, ListOperationContext opContext ) throws NamingException
     {
         if ( IS_DEBUG )
         {
@@ -291,7 +290,7 @@
     }
 
 
-    public Attributes lookup( NextInterceptor next, LookupOperationContext opContext ) throws NamingException
+    public ServerEntry lookup( NextInterceptor next, LookupOperationContext opContext ) throws NamingException
     {
         if ( IS_DEBUG )
         {
@@ -385,7 +384,7 @@
     }
 
 
-    public NamingEnumeration<SearchResult> search( NextInterceptor next, SearchOperationContext opContext ) throws NamingException
+    public NamingEnumeration<ServerSearchResult> search( NextInterceptor next, SearchOperationContext opContext ) throws NamingException
     {
         if ( IS_DEBUG )
         {

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java?rev=638228&r1=638227&r2=638228&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java Mon Mar 17 23:12:41 2008
@@ -50,15 +50,14 @@
 import org.apache.directory.server.core.collective.CollectiveAttributeInterceptor;
 import org.apache.directory.server.core.entry.ServerAttribute;
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.entry.ServerEntryUtils;
 import org.apache.directory.server.core.entry.ServerStringValue;
-import org.apache.directory.server.core.entry.ServerValue;
 import org.apache.directory.server.core.event.EventInterceptor;
 import org.apache.directory.server.core.trigger.TriggerInterceptor;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.constants.LdapSecurityConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapAuthenticationException;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.ArrayUtils;
@@ -589,10 +588,7 @@
             LookupOperationContext lookupContex  = new LookupOperationContext( registries, new String[] { SchemaConstants.USER_PASSWORD_AT } );
             lookupContex.setDn( principalDn );
             
-            userEntry = ServerEntryUtils.toServerEntry( 
-                proxy.lookup( lookupContex, USERLOOKUP_BYPASS ), 
-                principalDn,
-                registries );
+            userEntry = proxy.lookup( lookupContex, USERLOOKUP_BYPASS ); 
 
             if ( userEntry == null )
             {
@@ -607,7 +603,7 @@
             throw e;
         }
 
-        ServerValue<?> userPassword;
+        Value<?> userPassword;
 
         ServerAttribute userPasswordAttr = userEntry.get( SchemaConstants.USER_PASSWORD_AT );
 



Mime
View raw message