directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1235374 [20/27] - in /directory/shared/trunk: ldap/model/src/main/java/org/apache/directory/shared/ldap/model/constants/ ldap/model/src/main/java/org/apache/directory/shared/ldap/model/csn/ ldap/model/src/main/java/org/apache/directory/sha...
Date Tue, 24 Jan 2012 17:44:32 GMT
Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifRevertorTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifRevertorTest.java?rev=1235374&r1=1235373&r2=1235374&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifRevertorTest.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifRevertorTest.java Tue Jan 24 17:44:03 2012
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.ldap.model.ldif;
 
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -49,6 +50,7 @@ import org.apache.directory.shared.util.
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+
 /**
  * Tests the LdifReverter methods
  *
@@ -68,11 +70,11 @@ public class LdifRevertorTest
         entry.put( "cn", "test" );
         entry.put( "sn", "joe doe" );
         entry.put( "l", "USA" );
-        
+
         return entry;
     }
 
-    
+
     /**
      * Test a AddRequest reverse
      *
@@ -83,7 +85,7 @@ public class LdifRevertorTest
     {
         Dn dn = new Dn( "dc=apache, dc=com" );
         LdifEntry reversed = LdifRevertor.reverseAdd( dn );
-        
+
         assertNotNull( reversed );
         assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Delete, reversed.getChangeType() );
@@ -99,28 +101,28 @@ public class LdifRevertorTest
     public void testReverseDel() throws LdapException
     {
         Dn dn = new Dn( "dc=apache, dc=com" );
-        
+
         Entry deletedEntry = new DefaultEntry( dn );
-        
+
         Attribute oc = new DefaultAttribute( "objectClass" );
         oc.add( "top", "person" );
-        
+
         deletedEntry.put( oc );
-        
+
         deletedEntry.put( "cn", "test" );
         deletedEntry.put( "sn", "apache" );
         deletedEntry.put( "dc", "apache" );
-        
+
         LdifEntry reversed = LdifRevertor.reverseDel( dn, deletedEntry );
-        
+
         assertNotNull( reversed );
         assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Add, reversed.getChangeType() );
         assertNotNull( reversed.getEntry() );
         assertEquals( deletedEntry, reversed.getEntry() );
     }
-    
-    
+
+
     /**
      * Test a reversed Modify adding a existing value from an existing attribute
      */
@@ -128,36 +130,36 @@ public class LdifRevertorTest
     public void testReverseModifyDelExistingOuValue() throws LdapException
     {
         Entry modifiedEntry = buildEntry();
-        
+
         Attribute ou = new DefaultAttribute( "ou" );
         ou.add( "apache", "acme corp" );
         modifiedEntry.put( ou );
 
         Dn dn = new Dn( "cn=test, ou=system" );
 
-        Modification mod = new DefaultModification( 
-            ModificationOperation.REMOVE_ATTRIBUTE, 
+        Modification mod = new DefaultModification(
+            ModificationOperation.REMOVE_ATTRIBUTE,
             new DefaultAttribute( "ou", "acme corp" ) );
 
         LdifEntry reversed = LdifRevertor.reverseModify( dn,
-                Collections.<Modification>singletonList( mod ), modifiedEntry );
+            Collections.<Modification> singletonList( mod ), modifiedEntry );
 
         assertNotNull( reversed );
         assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
-        
+
         List<Modification> mods = reversed.getModifications();
-        
+
         assertNotNull( mods );
         assertEquals( 1, mods.size() );
-        
+
         Modification modif = mods.get( 0 );
-        
+
         assertEquals( ModificationOperation.ADD_ATTRIBUTE, modif.getOperation() );
 
         Attribute attr = modif.getAttribute();
-        
+
         assertNotNull( attr );
 
         assertEquals( "ou", attr.getId() );
@@ -172,7 +174,7 @@ public class LdifRevertorTest
     public void testReverseModifyDeleteOU() throws LdapException
     {
         Entry modifiedEntry = buildEntry();
-        
+
         Attribute ou = new DefaultAttribute( "ou" );
         ou.add( "apache", "acme corp" );
         modifiedEntry.put( ou );
@@ -180,36 +182,35 @@ public class LdifRevertorTest
         Dn dn = new Dn( "cn=test, ou=system" );
 
         Modification mod = new DefaultModification(
-            ModificationOperation.REMOVE_ATTRIBUTE, 
+            ModificationOperation.REMOVE_ATTRIBUTE,
             new DefaultAttribute( "ou" ) );
 
         LdifEntry reversed = LdifRevertor.reverseModify( dn,
-                Collections.<Modification>singletonList( mod ), modifiedEntry );
-
+            Collections.<Modification> singletonList( mod ), modifiedEntry );
 
         assertNotNull( reversed );
         assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
-        
+
         List<Modification> mods = reversed.getModifications();
-        
+
         assertNotNull( mods );
         assertEquals( 1, mods.size() );
-        
+
         Modification modif = mods.get( 0 );
-        
+
         assertEquals( ModificationOperation.ADD_ATTRIBUTE, modif.getOperation() );
 
         Attribute attr = modif.getAttribute();
-        
+
         assertNotNull( attr );
         assertEquals( "ou", attr.getId() );
-        
+
         assertEquals( ou, attr );
     }
 
-   
+
     /**
      * Test a reversed Modify deleting all values of an existing attribute
      */
@@ -220,39 +221,38 @@ public class LdifRevertorTest
 
         Attribute ou = new DefaultAttribute( "ou", "apache", "acme corp" );
         modifiedEntry.put( ou );
-        
+
         Dn dn = new Dn( "cn=test, ou=system" );
-        
+
         Modification mod = new DefaultModification(
             ModificationOperation.REMOVE_ATTRIBUTE, ou );
 
-        LdifEntry reversed = LdifRevertor.reverseModify( dn, 
-                Collections.<Modification>singletonList( mod ), modifiedEntry );
-
+        LdifEntry reversed = LdifRevertor.reverseModify( dn,
+            Collections.<Modification> singletonList( mod ), modifiedEntry );
 
         assertNotNull( reversed );
         assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
-        
+
         List<Modification> mods = reversed.getModifications();
-        
+
         assertNotNull( mods );
         assertEquals( 1, mods.size() );
-        
+
         Modification modif = mods.get( 0 );
-        
+
         assertEquals( ModificationOperation.ADD_ATTRIBUTE, modif.getOperation() );
 
         Attribute attr = modif.getAttribute();
-        
+
         assertNotNull( attr );
         assertEquals( "ou", attr.getId() );
-        
+
         assertEquals( ou, attr );
     }
 
-    
+
     /**
      * Test a reversed Modify replacing existing values with new values
      */
@@ -260,7 +260,7 @@ public class LdifRevertorTest
     public void testReverseModifyReplaceExistingOuValues() throws LdapException
     {
         Entry modifiedEntry = buildEntry();
-        
+
         Attribute ou = new DefaultAttribute( "ou" );
         ou.add( "apache", "acme corp" );
         modifiedEntry.put( ou );
@@ -270,31 +270,29 @@ public class LdifRevertorTest
         Attribute ouModified = new DefaultAttribute( "ou" );
         ouModified.add( "directory" );
         ouModified.add( "BigCompany inc." );
-        
+
         Modification mod = new DefaultModification(
             ModificationOperation.REPLACE_ATTRIBUTE, ouModified );
 
         LdifEntry reversed = LdifRevertor.reverseModify( dn,
-                Collections.<Modification>singletonList( mod ), modifiedEntry );
-
-
+            Collections.<Modification> singletonList( mod ), modifiedEntry );
 
         assertNotNull( reversed );
         assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
-        
+
         List<Modification> mods = reversed.getModifications();
-        
+
         assertNotNull( mods );
         assertEquals( 1, mods.size() );
-        
+
         Modification modif = mods.get( 0 );
-        
+
         assertEquals( ModificationOperation.REPLACE_ATTRIBUTE, modif.getOperation() );
 
         Attribute attr = modif.getAttribute();
-        
+
         assertNotNull( attr );
         assertEquals( ou, attr );
     }
@@ -307,43 +305,42 @@ public class LdifRevertorTest
     public void testReverseModifyReplaceNewAttribute() throws LdapException
     {
         Entry modifiedEntry = buildEntry();
-        
+
         Dn dn = new Dn( "cn=test, ou=system" );
-        
+
         Attribute newOu = new DefaultAttribute( "ou" );
         newOu.add( "apache" );
         newOu.add( "acme corp" );
 
-        
         Modification mod = new DefaultModification(
             ModificationOperation.REPLACE_ATTRIBUTE, newOu );
 
         LdifEntry reversed = LdifRevertor.reverseModify( dn,
-                Collections.<Modification>singletonList( mod ), modifiedEntry );
+            Collections.<Modification> singletonList( mod ), modifiedEntry );
 
         assertNotNull( reversed );
         assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
-        
+
         List<Modification> mods = reversed.getModifications();
-        
+
         assertNotNull( mods );
         assertEquals( 1, mods.size() );
-        
+
         Modification modif = mods.get( 0 );
-        
+
         assertEquals( ModificationOperation.REPLACE_ATTRIBUTE, modif.getOperation() );
 
         Attribute attr = modif.getAttribute();
-        
+
         assertNotNull( attr );
         assertEquals( "ou", attr.getId() );
-        
+
         assertNull( attr.get() );
     }
 
-   
+
     /**
      * Test a reversed Modify replace by removing an attribute
      */
@@ -356,38 +353,38 @@ public class LdifRevertorTest
         ou.add( "apache" );
         ou.add( "acme corp" );
         modifiedEntry.put( ou );
-        
+
         Dn dn = new Dn( "cn=test, ou=system" );
-        
-        Modification mod = new DefaultModification( 
+
+        Modification mod = new DefaultModification(
             ModificationOperation.REPLACE_ATTRIBUTE, new DefaultAttribute( "ou" ) );
 
         LdifEntry reversed = LdifRevertor.reverseModify( dn,
-                Collections.<Modification>singletonList( mod ), modifiedEntry );
+            Collections.<Modification> singletonList( mod ), modifiedEntry );
 
         assertNotNull( reversed );
         assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
-        
+
         List<Modification> mods = reversed.getModifications();
-        
+
         assertNotNull( mods );
         assertEquals( 1, mods.size() );
-        
+
         Modification modif = mods.get( 0 );
-        
+
         assertEquals( ModificationOperation.REPLACE_ATTRIBUTE, modif.getOperation() );
 
         Attribute attr = modif.getAttribute();
-        
+
         assertNotNull( attr );
         assertEquals( "ou", attr.getId() );
-        
+
         assertEquals( ou, attr );
     }
-    
-    
+
+
     /**
      * Test a multiple modifications reverse.
      * 
@@ -461,22 +458,22 @@ public class LdifRevertorTest
     @Test
     public void testReverseMultipleModifications() throws Exception
     {
-        String initialEntryLdif = 
-                "dn: cn=test, ou=system\n" + 
-                "objectclass: top\n" + 
-                "objectclass: person\n" + 
-                "cn: test\n" + 
-                "sn: joe doe\n" + 
-                "l: USA\n" + 
-                "ou: apache\n" + 
-                "ou: acme corp\n"; 
-        
+        String initialEntryLdif =
+            "dn: cn=test, ou=system\n" +
+                "objectclass: top\n" +
+                "objectclass: person\n" +
+                "cn: test\n" +
+                "sn: joe doe\n" +
+                "l: USA\n" +
+                "ou: apache\n" +
+                "ou: acme corp\n";
+
         LdifReader reader = new LdifReader();
         List<LdifEntry> entries = reader.parseLdif( initialEntryLdif );
         reader.close();
-        
+
         LdifEntry initialEntry = entries.get( 0 );
- 
+
         // We will :
         //   - add an 'ou' value 'BigCompany inc.'
         //   - delete the 'l' attribute
@@ -484,12 +481,12 @@ public class LdifRevertorTest
         //   - replace the 'l=FR' by a 'l=USA' attribute
         //   - replace the 'ou' attribute with 'apache' value.
         Dn dn = new Dn( "cn=test, ou=system" );
-        
+
         List<Modification> modifications = new ArrayList<Modification>();
 
         // First, inject the 'ou'
-        
-        Modification mod = new DefaultModification( 
+
+        Modification mod = new DefaultModification(
             ModificationOperation.ADD_ATTRIBUTE, new DefaultAttribute( "ou", "BigCompany inc." ) );
         modifications.add( mod );
 
@@ -497,51 +494,51 @@ public class LdifRevertorTest
         mod = new DefaultModification(
             ModificationOperation.REMOVE_ATTRIBUTE, new DefaultAttribute( "l" ) );
         modifications.add( mod );
-        
+
         // Add 'l=FR'
         mod = new DefaultModification(
             ModificationOperation.ADD_ATTRIBUTE, new DefaultAttribute( "l", "FR" ) );
         modifications.add( mod );
 
         // Replace it with 'l=USA'
-        mod = new DefaultModification( 
+        mod = new DefaultModification(
             ModificationOperation.REPLACE_ATTRIBUTE, new DefaultAttribute( "l", "USA" ) );
         modifications.add( mod );
 
         // Replace the ou value
-        mod = new DefaultModification( 
+        mod = new DefaultModification(
             ModificationOperation.REPLACE_ATTRIBUTE, new DefaultAttribute( "ou", "apache" ) );
         modifications.add( mod );
-        
+
         LdifEntry reversedEntry = LdifRevertor.reverseModify( dn, modifications, initialEntry.getEntry() );
 
-        String expectedEntryLdif = 
+        String expectedEntryLdif =
             "dn: cn=test, ou=system\n" +
-            "changetype: modify\n" +
-            "replace: ou\n" +
-            "ou: apache\n" +
-            "ou: acme corp\n" +
-            "ou: BigCompany inc.\n" +
-            "-\n" +
-            "replace: l\n" +
-            "l: FR\n" +
-            "-\n" +
-            "delete: l\n" +
-            "l: FR\n" +
-            "-\n" +
-            "add: l\n" +
-            "l: USA\n" +
-            "-\n" +
-            "delete: ou\n" + 
-            "ou: BigCompany inc.\n" +
-            "-\n\n";
-    
+                "changetype: modify\n" +
+                "replace: ou\n" +
+                "ou: apache\n" +
+                "ou: acme corp\n" +
+                "ou: BigCompany inc.\n" +
+                "-\n" +
+                "replace: l\n" +
+                "l: FR\n" +
+                "-\n" +
+                "delete: l\n" +
+                "l: FR\n" +
+                "-\n" +
+                "add: l\n" +
+                "l: USA\n" +
+                "-\n" +
+                "delete: ou\n" +
+                "ou: BigCompany inc.\n" +
+                "-\n\n";
+
         reader = new LdifReader();
         entries = reader.parseLdif( expectedEntryLdif );
         reader.close();
 
         LdifEntry expectedEntry = entries.get( 0 );
-        
+
         assertEquals( expectedEntry, reversedEntry );
     }
 
@@ -559,30 +556,30 @@ public class LdifRevertorTest
         ou.add( "apache" );
         ou.add( "acme corp" );
         modifiedEntry.put( ou );
-        
+
         Dn dn = new Dn( "cn=test, ou=system" );
         Modification mod = new DefaultModification(
             ModificationOperation.ADD_ATTRIBUTE,
             new DefaultAttribute( "ou", "BigCompany inc." ) );
 
         LdifEntry reversed = LdifRevertor.reverseModify( dn,
-                Collections.<Modification>singletonList( mod ), modifiedEntry );
+            Collections.<Modification> singletonList( mod ), modifiedEntry );
 
         assertNotNull( reversed );
         assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
         List<Modification> mods = reversed.getModifications();
-        
+
         assertNotNull( mods );
         assertEquals( 1, mods.size() );
-        
+
         Modification modif = mods.get( 0 );
-        
+
         assertEquals( ModificationOperation.REMOVE_ATTRIBUTE, modif.getOperation() );
 
         Attribute attr = modif.getAttribute();
-        
+
         assertNotNull( attr );
         assertEquals( "ou", attr.getId() );
         assertEquals( "BigCompany inc.", attr.getString() );
@@ -596,36 +593,36 @@ public class LdifRevertorTest
     public void testReverseModifyAddNewOu() throws LdapException
     {
         Entry modifiedEntry = buildEntry();
-        
+
         Dn dn = new Dn( "cn=test, ou=system" );
         Modification mod = new DefaultModification(
-            ModificationOperation.ADD_ATTRIBUTE, 
+            ModificationOperation.ADD_ATTRIBUTE,
             new DefaultAttribute( "ou", "BigCompany inc." ) );
 
         LdifEntry reversed = LdifRevertor.reverseModify( dn,
-                Collections.<Modification>singletonList( mod ), modifiedEntry );
+            Collections.<Modification> singletonList( mod ), modifiedEntry );
 
         assertNotNull( reversed );
         assertEquals( dn.getName(), reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         assertNull( reversed.getEntry() );
         List<Modification> mods = reversed.getModifications();
-        
+
         assertNotNull( mods );
         assertEquals( 1, mods.size() );
-        
+
         Modification modif = mods.get( 0 );
 
         assertEquals( ModificationOperation.REMOVE_ATTRIBUTE, modif.getOperation() );
 
         Attribute attr = modif.getAttribute();
-        
+
         assertNotNull( attr );
         assertEquals( "ou", attr.getId() );
         assertEquals( "BigCompany inc.", attr.getString() );
     }
-    
-    
+
+
     /**
      * Test a AddRequest reverse where the Dn is to be base64 encoded
      *
@@ -665,12 +662,12 @@ public class LdifRevertorTest
         LdifEntry reversed = LdifRevertor.reverseMove( newSuperior, dn );
 
         assertNotNull( reversed );
-        
+
         assertEquals( "cn=john doe,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModDn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( rdn.getName(), reversed.getNewRdn() );
-        assertEquals( "dc=example, dc=com", Strings.trim(reversed.getNewSuperior()) );
+        assertEquals( "dc=example, dc=com", Strings.trim( reversed.getNewSuperior() ) );
         assertNull( reversed.getEntry() );
     }
 
@@ -709,7 +706,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=joe,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
@@ -753,7 +750,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=small,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
@@ -796,7 +793,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=joe,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
@@ -840,7 +837,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=small,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
@@ -885,7 +882,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=joe,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
@@ -931,7 +928,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=big,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
@@ -976,7 +973,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=joe,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
@@ -1022,7 +1019,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=big,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
@@ -1066,7 +1063,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
@@ -1105,12 +1102,12 @@ public class LdifRevertorTest
         entry.put( "objectClass", "person", "top" );
         entry.put( "sn", "this is a test" );
 
-        List<LdifEntry> reverseds = LdifRevertor.reverseRename(entry, newRdn, LdifRevertor.DELETE_OLD_RDN);
+        List<LdifEntry> reverseds = LdifRevertor.reverseRename( entry, newRdn, LdifRevertor.DELETE_OLD_RDN );
 
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
@@ -1155,7 +1152,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=joe+cn=plumber,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
@@ -1200,7 +1197,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 2, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=joe+cn=small,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
@@ -1208,11 +1205,11 @@ public class LdifRevertorTest
         assertNull( reversed.getNewSuperior() );
 
         reversed = reverseds.get( 1 );
-        
+
         assertEquals( "cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         Modification[] mods = reversed.getModificationArray();
-        
+
         assertNotNull( mods );
         assertEquals( 1, mods.length );
         assertEquals( ModificationOperation.REMOVE_ATTRIBUTE, mods[0].getOperation() );
@@ -1258,7 +1255,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=joe+cn=plumber,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
@@ -1303,19 +1300,19 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 2, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=joe+cn=small,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
         assertEquals( oldRdn.getName(), reversed.getNewRdn() );
         assertNull( reversed.getNewSuperior() );
-        
+
         reversed = reverseds.get( 1 );
-        
+
         assertEquals( "cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         Modification[] mods = reversed.getModificationArray();
-        
+
         assertNotNull( mods );
         assertEquals( 1, mods.length );
         assertEquals( ModificationOperation.REMOVE_ATTRIBUTE, mods[0].getOperation() );
@@ -1361,7 +1358,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=small+cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
@@ -1370,8 +1367,6 @@ public class LdifRevertorTest
     }
 
 
-
-
     /**
      * Test a reversed rename ModifyDN, where the initial Rdn is simple,
      * the new Rdn is composite, they overlap, with deleteOldRdn = false, and
@@ -1408,7 +1403,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 2, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=small+cn=test+cn=big,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
@@ -1416,11 +1411,11 @@ public class LdifRevertorTest
         assertNull( reversed.getNewSuperior() );
 
         reversed = reverseds.get( 1 );
-        
+
         assertEquals( "cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         Modification[] mods = reversed.getModificationArray();
-        
+
         assertNotNull( mods );
         assertEquals( 1, mods.length );
         assertEquals( ModificationOperation.REMOVE_ATTRIBUTE, mods[0].getOperation() );
@@ -1466,7 +1461,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=small+cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
@@ -1511,7 +1506,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 2, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=small+cn=test+cn=big,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
@@ -1519,11 +1514,11 @@ public class LdifRevertorTest
         assertNull( reversed.getNewSuperior() );
 
         reversed = reverseds.get( 1 );
-        
+
         assertEquals( "cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         Modification[] mods = reversed.getModificationArray();
-        
+
         assertNotNull( mods );
         assertEquals( 1, mods.length );
         assertEquals( ModificationOperation.REMOVE_ATTRIBUTE, mods[0].getOperation() );
@@ -1570,7 +1565,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=joe+cn=plumber,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
@@ -1616,7 +1611,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 2, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=joe+cn=big,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
@@ -1624,11 +1619,11 @@ public class LdifRevertorTest
         assertNull( reversed.getNewSuperior() );
 
         reversed = reverseds.get( 1 );
-        
+
         assertEquals( "cn=small+cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         Modification[] mods = reversed.getModificationArray();
-        
+
         assertNotNull( mods );
         assertEquals( 1, mods.length );
         assertEquals( ModificationOperation.REMOVE_ATTRIBUTE, mods[0].getOperation() );
@@ -1675,7 +1670,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=joe+cn=plumber,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
@@ -1721,7 +1716,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 2, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=joe+cn=big,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
@@ -1729,11 +1724,11 @@ public class LdifRevertorTest
         assertNull( reversed.getNewSuperior() );
 
         reversed = reverseds.get( 1 );
-        
+
         assertEquals( "cn=small+cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.Modify, reversed.getChangeType() );
         Modification[] mods = reversed.getModificationArray();
-        
+
         assertNotNull( mods );
         assertEquals( 1, mods.length );
         assertEquals( ModificationOperation.REMOVE_ATTRIBUTE, mods[0].getOperation() );
@@ -1780,7 +1775,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=joe+cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
@@ -1826,7 +1821,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=big+cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );
@@ -1872,7 +1867,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=joe+cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
@@ -1918,7 +1913,7 @@ public class LdifRevertorTest
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
         LdifEntry reversed = reverseds.get( 0 );
-        
+
         assertEquals( "cn=big+cn=test,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertFalse( reversed.isDeleteOldRdn() );

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifUtilsTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifUtilsTest.java?rev=1235374&r1=1235373&r2=1235374&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifUtilsTest.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifUtilsTest.java Tue Jan 24 17:44:03 2012
@@ -60,7 +60,7 @@ import com.mycila.junit.concurrent.Concu
 public class LdifUtilsTest
 {
     private String testString = "this is a test";
-    
+
 
     /**
      * Tests the method IsLdifSafe with a null String
@@ -70,7 +70,7 @@ public class LdifUtilsTest
     {
         assertTrue( LdifUtils.isLDIFSafe( null ) );
     }
-    
+
 
     /**
      * Tests the method IsLdifSafe with an empty String
@@ -80,7 +80,7 @@ public class LdifUtilsTest
     {
         assertTrue( LdifUtils.isLDIFSafe( "" ) );
     }
-    
+
 
     /**
      * Tests the method IsLdifSafe with a String starting with the
@@ -90,11 +90,11 @@ public class LdifUtilsTest
     public void testIsLdifSafeStartingWithNUL()
     {
         char c = ( char ) 0;
-        
+
         assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
     }
-    
-    
+
+
     /**
      * Tests the method IsLdifSafe with a String starting with the
      * char LF (ASCII code 10)
@@ -103,10 +103,11 @@ public class LdifUtilsTest
     public void testIsLdifSafeStartingWithLF()
     {
         char c = ( char ) 10;
-        
+
         assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
     }
 
+
     /**
      * Tests the method IsLdifSafe with a String starting with the
      * char CR (ASCII code 13)
@@ -115,10 +116,11 @@ public class LdifUtilsTest
     public void testIsLdifSafeStartingWithCR()
     {
         char c = ( char ) 13;
-        
+
         assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
     }
 
+
     /**
      * Tests the method IsLdifSafe with a String starting with the
      * char SPACE (ASCII code 32)
@@ -127,10 +129,11 @@ public class LdifUtilsTest
     public void testIsLdifSafeStartingWithSpace()
     {
         char c = ( char ) 32;
-        
+
         assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
     }
-    
+
+
     /**
      * Tests the method IsLdifSafe with a String starting with the
      * char COLON (:) (ASCII code 58)
@@ -139,10 +142,11 @@ public class LdifUtilsTest
     public void testIsLdifSafeStartingWithColon()
     {
         char c = ( char ) 58;
-        
+
         assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
     }
-    
+
+
     /**
      * Tests the method IsLdifSafe with a String starting with the
      * char LESS_THAN (<) (ASCII code 60)
@@ -151,10 +155,11 @@ public class LdifUtilsTest
     public void testIsLdifSafeStartingWithLessThan()
     {
         char c = ( char ) 60;
-        
+
         assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
     }
-    
+
+
     /**
      * Tests the method IsLdifSafe with a String starting with the
      * char with ASCII code 127
@@ -163,10 +168,11 @@ public class LdifUtilsTest
     public void testIsLdifSafeStartingWithCharGreaterThan127()
     {
         char c = ( char ) 127;
-        
+
         assertTrue( LdifUtils.isLDIFSafe( c + testString ) );
     }
-    
+
+
     /**
      * Tests the method IsLdifSafe with a String starting with the
      * char with ASCII code greater than 127
@@ -175,10 +181,11 @@ public class LdifUtilsTest
     public void testIsLdifSafeStartingWithCharGreaterThan127Bis()
     {
         char c = ( char ) 222;
-        
+
         assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
     }
-    
+
+
     /**
      * Tests the method IsLdifSafe with a String containing the
      * char NUL (ASCII code 0)
@@ -187,10 +194,11 @@ public class LdifUtilsTest
     public void testIsLdifSafeContainsNUL()
     {
         char c = ( char ) 0;
-        
+
         assertFalse( LdifUtils.isLDIFSafe( testString + c + testString ) );
     }
-    
+
+
     /**
      * Tests the method IsLdifSafe with a String containing the
      * char LF (ASCII code 10)
@@ -199,10 +207,11 @@ public class LdifUtilsTest
     public void testIsLdifSafeContainsLF()
     {
         char c = ( char ) 10;
-        
+
         assertFalse( LdifUtils.isLDIFSafe( testString + c + testString ) );
     }
-    
+
+
     /**
      * Tests the method IsLdifSafe with a String containing the
      * char CR (ASCII code 13)
@@ -211,10 +220,11 @@ public class LdifUtilsTest
     public void testIsLdifSafeContainsCR()
     {
         char c = ( char ) 13;
-        
+
         assertFalse( LdifUtils.isLDIFSafe( testString + c + testString ) );
     }
-    
+
+
     /**
      * Tests the method IsLdifSafe with a String containing the
      * char with ASCII code 127
@@ -223,10 +233,11 @@ public class LdifUtilsTest
     public void testIsLdifSafeContainsCharGreaterThan127()
     {
         char c = ( char ) 127;
-        
+
         assertTrue( LdifUtils.isLDIFSafe( testString + c + testString ) );
     }
-    
+
+
     /**
      * Tests the method IsLdifSafe with a String containing a
      * char with ASCII code greater than 127
@@ -235,10 +246,11 @@ public class LdifUtilsTest
     public void testIsLdifSafeContainsCharGreaterThan127Bis()
     {
         char c = ( char ) 328;
-        
+
         assertFalse( LdifUtils.isLDIFSafe( testString + c + testString ) );
     }
-    
+
+
     /**
      * Tests the method IsLdifSafe with a String ending with the
      * char SPACE (ASCII code 32)
@@ -247,20 +259,21 @@ public class LdifUtilsTest
     public void testIsLdifSafeEndingWithSpace()
     {
         char c = ( char ) 32;
-        
-        assertFalse( LdifUtils.isLDIFSafe( testString  + c) );
+
+        assertFalse( LdifUtils.isLDIFSafe( testString + c ) );
     }
-    
+
+
     /**
      * Tests the method IsLdifSafe with a correct String
      */
     @Test
     public void testIsLdifSafeCorrectString()
-    {        
+    {
         assertTrue( LdifUtils.isLDIFSafe( testString ) );
     }
-    
-    
+
+
     /**
      * Test the way LDIF lines are stripped to a number of chars
      */
@@ -268,7 +281,7 @@ public class LdifUtilsTest
     public void testStripLineToNChars()
     {
         String line = "abc";
-        
+
         try
         {
             LdifUtils.stripLineToNChars( line, 1 );
@@ -278,12 +291,13 @@ public class LdifUtilsTest
         {
             // This is correct
         }
-        
+
         String res = LdifUtils.stripLineToNChars( line, 2 );
         assertEquals( "ab\n c", res );
         assertEquals( "abc", LdifUtils.stripLineToNChars( line, 3 ) );
     }
 
+
     /**
      * Test that the LDIF is stripped to 5 chars per line
      *
@@ -306,10 +320,10 @@ public class LdifUtilsTest
         assertEquals( "abcde\n fghi\n jklm", LdifUtils.stripLineToNChars( "abcdefghijklm", 5 ) );
         assertEquals( "abcde\n fghi\n jklm\n n", LdifUtils.stripLineToNChars( "abcdefghijklmn", 5 ) );
         assertEquals( "abcde\n fghi\n jklm\n no", LdifUtils.stripLineToNChars( "abcdefghijklmno", 5 ) );
-        assertEquals( "abcde\n fghi\n jklm\n nop", LdifUtils.stripLineToNChars("abcdefghijklmnop", 5) );
+        assertEquals( "abcde\n fghi\n jklm\n nop", LdifUtils.stripLineToNChars( "abcdefghijklmnop", 5 ) );
     }
-    
-    
+
+
     /**
      * Tests that unsafe characters are encoded using UTF-8 charset. 
      * @throws LdapException 
@@ -323,8 +337,8 @@ public class LdifUtilsTest
         String ldif = LdifUtils.convertToLdif( attributes );
         assertEquals( "cn:: U2FhcmJyw7xja2Vu\n", ldif );
     }
-    
-    
+
+
     /**
      * Tests that null values are correctly encoded 
      * 
@@ -337,8 +351,8 @@ public class LdifUtilsTest
         String ldif = LdifUtils.convertToLdif( attributes );
         assertEquals( "cn:\n", ldif );
     }
-    
-    
+
+
     /**
      * Test a conversion of an entry from a LDIF file
      */
@@ -348,15 +362,15 @@ public class LdifUtilsTest
         LdifEntry entry = new LdifEntry();
         entry.setDn( "cn=Saarbr\u00FCcken, dc=example, dc=com" );
         entry.setChangeType( ChangeType.Add );
-        
+
         entry.addAttribute( "objectClass", "top", "person", "inetorgPerson" );
         entry.addAttribute( "cn", "Saarbr\u00FCcken" );
         entry.addAttribute( "sn", "test" );
 
         LdifUtils.convertToLdif( entry, 15 );
     }
-    
-    
+
+
     /**
      * Test a conversion of an attributes from a LDIF file
      * @throws org.apache.directory.shared.ldap.model.ldif.LdapLdifException
@@ -365,23 +379,23 @@ public class LdifUtilsTest
     public void testConvertAttributesfromLdif() throws LdapException, LdapLdifException
     {
         Attributes attributes = new BasicAttributes( true );
-        
+
         Attribute oc = new BasicAttribute( "objectclass" );
         oc.add( "top" );
         oc.add( "person" );
         oc.add( "inetorgPerson" );
-        
+
         attributes.put( oc );
-        
+
         attributes.put( "cn", "Saarbrucken" );
         attributes.put( "sn", "test" );
 
-        String ldif = LdifUtils.convertToLdif( attributes, (Dn)null, 15 );
+        String ldif = LdifUtils.convertToLdif( attributes, ( Dn ) null, 15 );
         Attributes result = LdifUtils.getJndiAttributesFromLdif( ldif );
         assertEquals( attributes, result );
     }
 
-    
+
     /**
      * Check that the correct reverse LDIF is produced for a modifyDn
      * operation that moves and renames the entry while preserving the
@@ -401,11 +415,12 @@ public class LdifUtilsTest
         entry.add( "sn", "doe" );
         entry.add( "uid", "jdoe" );
 
-        List<LdifEntry> reverseds = LdifRevertor.reverseMoveAndRename(entry, newSuperior, new Rdn("cn=jack doe"), false);
+        List<LdifEntry> reverseds = LdifRevertor.reverseMoveAndRename( entry, newSuperior, new Rdn( "cn=jack doe" ),
+            false );
 
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
-        
+
         LdifEntry reversed = reverseds.get( 0 );
         assertEquals( "cn=jack doe,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
@@ -433,34 +448,35 @@ public class LdifUtilsTest
         entry.add( "sn", "doe" );
         entry.add( "uid", "jdoe" );
 
-        List<LdifEntry> reverseds = LdifRevertor.reverseMoveAndRename( entry, newSuperior, new Rdn( "cn=jack doe" ), false );
+        List<LdifEntry> reverseds = LdifRevertor.reverseMoveAndRename( entry, newSuperior, new Rdn( "cn=jack doe" ),
+            false );
 
         assertNotNull( reverseds );
         assertEquals( 1, reverseds.size() );
-        
+
         LdifEntry reversed = reverseds.get( 0 );
         assertEquals( "cn=jack doe,ou=system", reversed.getDn().getName() );
         assertEquals( ChangeType.ModRdn, reversed.getChangeType() );
         assertTrue( reversed.isDeleteOldRdn() );
         assertEquals( "cn=john doe", reversed.getNewRdn() );
-        assertEquals( "dc=example, dc=com", Strings.trim(reversed.getNewSuperior()) );
+        assertEquals( "dc=example, dc=com", Strings.trim( reversed.getNewSuperior() ) );
         assertNull( reversed.getEntry() );
     }
-    
-    
+
+
     @Test
     public void testCreateAttributesVarargs() throws LdapException, LdapLdifException, NamingException
     {
         String mOid = "m-oid: 1.2.3.4";
         String description = "description";
-        
-        Attributes attrs = LdifUtils.createJndiAttributes( 
+
+        Attributes attrs = LdifUtils.createJndiAttributes(
             "objectClass: top",
             "objectClass: metaTop",
             "objectClass: metaSyntax",
             mOid,
             "m-description", description );
-        
+
         assertEquals( "top", attrs.get( "objectClass" ).get( 0 ) );
         assertEquals( "metaTop", attrs.get( "objectClass" ).get( 1 ) );
         assertEquals( "metaSyntax", attrs.get( "objectClass" ).get( 2 ) );
@@ -469,7 +485,7 @@ public class LdifUtilsTest
 
         try
         {
-            LdifUtils.createJndiAttributes( 
+            LdifUtils.createJndiAttributes(
                 "objectClass", "top",
                 "objectClass" );
             fail();
@@ -479,35 +495,35 @@ public class LdifUtilsTest
             assertTrue( true );
         }
     }
-    
-    
+
+
     @Test
-    public void testConvertEntryNoControls() throws Exception 
+    public void testConvertEntryNoControls() throws Exception
     {
         LdifReader reader = new LdifReader();
 
-        String expected = 
+        String expected =
             "dn: ou=test\n" +
-            "ObjectClass: top\n" +
-            "ObjectClass: metaTop\n" +
-            "ObjectClass: metaSyntax\n" +
-            "m-oid: 1.2.3.4\n" +
-            "m-description: description\n\n";
-        
+                "ObjectClass: top\n" +
+                "ObjectClass: metaTop\n" +
+                "ObjectClass: metaSyntax\n" +
+                "m-oid: 1.2.3.4\n" +
+                "m-description: description\n\n";
+
         List<LdifEntry> entries = reader.parseLdif( expected );
         LdifEntry expectedEntry = entries.get( 0 );
 
         LdifEntry entry = new LdifEntry();
-        
+
         entry.setDn( "ou=test" );
         entry.addAttribute( "ObjectClass", "top", "metaTop", "metaSyntax" );
         entry.addAttribute( "m-oid", "1.2.3.4" );
         entry.addAttribute( "m-description", "description" );
-        
+
         String converted = LdifUtils.convertToLdif( entry );
-        
+
         assertNotNull( converted );
-        
+
         entries = reader.parseLdif( converted );
         LdifEntry convertedEntry = entries.get( 0 );
 
@@ -515,41 +531,39 @@ public class LdifUtilsTest
     }
 
 
-    
-    
     @Test
-    public void testConvertEntryOneControl() throws Exception 
+    public void testConvertEntryOneControl() throws Exception
     {
         LdifReader reader = new LdifReader();
 
-        String expected = 
+        String expected =
             "dn: ou=test\n" +
-            "control: 2.16.840.1.113730.3.4.2 false\n" +
-            "changetype: add\n" +
-            "ObjectClass: top\n" +
-            "ObjectClass: metaTop\n" +
-            "ObjectClass: metaSyntax\n" +
-            "m-oid: 1.2.3.4\n" +
-            "m-description: description\n\n";
+                "control: 2.16.840.1.113730.3.4.2 false\n" +
+                "changetype: add\n" +
+                "ObjectClass: top\n" +
+                "ObjectClass: metaTop\n" +
+                "ObjectClass: metaSyntax\n" +
+                "m-oid: 1.2.3.4\n" +
+                "m-description: description\n\n";
 
         List<LdifEntry> entries = reader.parseLdif( expected );
         LdifEntry expectedEntry = entries.get( 0 );
 
         LdifEntry entry = new LdifEntry();
-        
+
         entry.setDn( "ou=test" );
         entry.addAttribute( "ObjectClass", "top", "metaTop", "metaSyntax" );
         entry.addAttribute( "m-oid", "1.2.3.4" );
         entry.addAttribute( "m-description", "description" );
-        
+
         ManageDsaITImpl control = new ManageDsaITImpl();
-        
+
         entry.addControl( control );
-        
+
         String converted = LdifUtils.convertToLdif( entry );
-        
+
         assertNotNull( converted );
-        
+
         entries = reader.parseLdif( converted );
         LdifEntry convertedEntry = entries.get( 0 );
 

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/message/AddRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/message/AddRequestImplTest.java?rev=1235374&r1=1235373&r2=1235374&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/message/AddRequestImplTest.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/message/AddRequestImplTest.java Tue Jan 24 17:44:03 2012
@@ -318,7 +318,7 @@ public class AddRequestImplTest
                 return false;
             }
 
-            
+
             public Control getControl( String oid )
             {
                 return null;

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/message/ModifyRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/message/ModifyRequestImplTest.java?rev=1235374&r1=1235373&r2=1235374&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/message/ModifyRequestImplTest.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/message/ModifyRequestImplTest.java Tue Jan 24 17:44:03 2012
@@ -295,21 +295,21 @@ public class ModifyRequestImplTest
             public Collection<Modification> getModifications()
             {
                 List<Modification> list = new ArrayList<Modification>();
-                
+
                 try
-                { 
+                {
                     Attribute attr = new DefaultAttribute( "attr0" );
                     attr.add( "val0" );
                     attr.add( "val1" );
                     attr.add( "val2" );
                     Modification item = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attr );
                     list.add( item );
-    
+
                     attr = new DefaultAttribute( "attr1" );
                     attr.add( "val3" );
                     item = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, attr );
                     list.add( item );
-    
+
                     attr = new DefaultAttribute( "attr2" );
                     attr.add( "val4" );
                     attr.add( "val5" );

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaSerializationTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaSerializationTest.java?rev=1235374&r1=1235373&r2=1235374&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaSerializationTest.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaSerializationTest.java Tue Jan 24 17:44:03 2012
@@ -51,7 +51,8 @@ public class AvaSerializationTest
 {
     /** A null schemaManager used in tests */
     SchemaManager schemaManager = null;
-    
+
+
     /**
      * Test serialization of a simple ATAV
      */
@@ -82,7 +83,7 @@ public class AvaSerializationTest
     @Test
     public void testBinaryAtavSerialization() throws LdapException, IOException, ClassNotFoundException
     {
-        byte[] upValue = Strings.getBytesUtf8("  Test  ");
+        byte[] upValue = Strings.getBytesUtf8( "  Test  " );
 
         Ava atav = new Ava( schemaManager, "CN", upValue );
 
@@ -131,7 +132,7 @@ public class AvaSerializationTest
     @Test
     public void testNullNormValueSerialization() throws LdapException, IOException, ClassNotFoundException
     {
-        Ava atav = new Ava( schemaManager, "CN", (String)null );
+        Ava atav = new Ava( schemaManager, "CN", ( String ) null );
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
@@ -152,7 +153,7 @@ public class AvaSerializationTest
     @Test
     public void testNullUpValueSerialization() throws LdapException, IOException, ClassNotFoundException
     {
-        Ava atav = new Ava( schemaManager, "CN", (String)null );
+        Ava atav = new Ava( schemaManager, "CN", ( String ) null );
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
@@ -244,7 +245,7 @@ public class AvaSerializationTest
     @Test
     public void testBinaryAtavStaticSerialization() throws LdapException, IOException, ClassNotFoundException
     {
-        byte[] upValue = Strings.getBytesUtf8("  Test  ");
+        byte[] upValue = Strings.getBytesUtf8( "  Test  " );
 
         Ava atav = new Ava( schemaManager, "CN", upValue );
 
@@ -252,7 +253,7 @@ public class AvaSerializationTest
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
-        
+
         atav.writeExternal( out );
 
         ObjectInputStream in = null;
@@ -293,7 +294,7 @@ public class AvaSerializationTest
     @Test
     public void testNullUpValueStaticSerialization() throws LdapException, IOException, ClassNotFoundException
     {
-        Ava atav = new Ava( schemaManager, "CN", (String)null );
+        Ava atav = new Ava( schemaManager, "CN", ( String ) null );
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java?rev=1235374&r1=1235373&r2=1235374&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java Tue Jan 24 17:44:03 2012
@@ -46,7 +46,8 @@ public class AvaTest
 {
     /** A null schemaManager used in tests */
     SchemaManager schemaManager = null;
-    
+
+
     /**
      * Test a null AttributeTypeAndValue
      */
@@ -67,7 +68,7 @@ public class AvaTest
     {
         try
         {
-            new Ava( schemaManager, null, (String)null );
+            new Ava( schemaManager, null, ( String ) null );
             fail();
         }
         catch ( LdapException ine )
@@ -77,6 +78,7 @@ public class AvaTest
 
     }
 
+
     /**
      * Test an invalid type for an AttributeTypeAndValue
      */
@@ -85,7 +87,7 @@ public class AvaTest
     {
         try
         {
-            new Ava( schemaManager, "  ", (String)null );
+            new Ava( schemaManager, "  ", ( String ) null );
             fail();
         }
         catch ( LdapException ine )
@@ -101,19 +103,19 @@ public class AvaTest
     @Test
     public void testAttributeTypeAndValueValidType() throws LdapException
     {
-        Ava atav = new Ava( schemaManager, "A", (String)null );
+        Ava atav = new Ava( schemaManager, "A", ( String ) null );
         assertEquals( "A=", atav.toString() );
         assertEquals( "a=", atav.getNormName() );
         assertEquals( "A=", atav.getUpName() );
-        
-        atav = new Ava( schemaManager, "  A  ", (String)null );
+
+        atav = new Ava( schemaManager, "  A  ", ( String ) null );
         assertEquals( "a=", atav.getNormName() );
         assertEquals( "  A  =", atav.toString() );
         assertEquals( "  A  =", atav.getUpName() );
-        
+
         try
         {
-            atav = new Ava( schemaManager, null, (String)null );
+            atav = new Ava( schemaManager, null, ( String ) null );
             fail();
         }
         catch ( LdapInvalidDnException lide )
@@ -122,6 +124,7 @@ public class AvaTest
         }
     }
 
+
     /**
      * test an empty AttributeTypeAndValue
      */
@@ -186,7 +189,7 @@ public class AvaTest
     public void testCompareAtav1TypeSuperior() throws LdapException
     {
         Ava atav1 = new Ava( schemaManager, "b", "b" );
-            
+
         Ava atav2 = new Ava( schemaManager, "a", "b" );
 
         assertFalse( atav1.equals( atav2 ) );
@@ -243,8 +246,8 @@ public class AvaTest
         assertEquals( "a=a", atav.normalize() );
 
     }
-    
-    
+
+
     @Test
     public void testAvaSimpleNorm() throws LdapException
     {

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserDIRSERVER_584_Test.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserDIRSERVER_584_Test.java?rev=1235374&r1=1235373&r2=1235374&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserDIRSERVER_584_Test.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserDIRSERVER_584_Test.java Tue Jan 24 17:44:03 2012
@@ -38,23 +38,23 @@ import com.mycila.junit.concurrent.Concu
 @Concurrency()
 public class DnParserDIRSERVER_584_Test
 {
-   /**
-    * Need this testa() to run first to mess up the state of the static parser.
-    */
-    @Test( expected=LdapException.class )
+    /**
+     * Need this testa() to run first to mess up the state of the static parser.
+     */
+    @Test(expected = LdapException.class)
     public void testa() throws Exception
-   {
-       new Dn( "ou=test+testing"  );
-   }
+    {
+        new Dn( "ou=test+testing" );
+    }
 
 
-   /**
-    * Need this testb() to run second to use the mess up static parser.  This
-    * test should succeed but fails.
-    */
+    /**
+     * Need this testb() to run second to use the mess up static parser.  This
+     * test should succeed but fails.
+     */
     @Test
     public void testb() throws Exception
-   {
-       new Dn( "ou=system" );
-   }
+    {
+        new Dn( "ou=system" );
+    }
 }
\ No newline at end of file

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserTest.java?rev=1235374&r1=1235373&r2=1235374&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserTest.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserTest.java Tue Jan 24 17:44:03 2012
@@ -75,7 +75,7 @@ public class DnParserTest
     @Test
     public void testLdapDNComposite() throws LdapException
     {
-        Dn dn = new Dn( "a = b, c = d"  );
+        Dn dn = new Dn( "a = b, c = d" );
 
         assertEquals( "a=b,c=d", dn.getNormName() );
         assertEquals( "a = b, c = d", dn.getName() );
@@ -226,8 +226,8 @@ public class DnParserTest
             assertTrue( true );
         }
     }
-    
-    
+
+
     /**
      * test a simple Dn with quoted attribute value : a = "quoted \"value"
      */
@@ -237,7 +237,7 @@ public class DnParserTest
         Dn dn = new Dn( "a = quoted \\\"value" );
         assertEquals( "a=quoted \\\"value", dn.getNormName() );
         assertEquals( "a = quoted \\\"value", dn.getName() );
-        
+
         dn = new Dn( "cn=Mackie \\\"The Knife\\\" Messer" );
         assertEquals( "cn=Mackie \\\"The Knife\\\" Messer", dn.getNormName() );
         assertEquals( "cn=Mackie \\\"The Knife\\\" Messer", dn.getName() );
@@ -264,19 +264,19 @@ public class DnParserTest
     {
         Dn dn = new Dn( "cn = John, ou = People, OU = Marketing" );
 
-        byte[] bytes = Dn.getBytes(dn);
+        byte[] bytes = Dn.getBytes( dn );
 
         assertEquals( 30, bytes.length );
-        assertEquals( "cn=John,ou=People,ou=Marketing", Strings.utf8ToString(bytes) );
+        assertEquals( "cn=John,ou=People,ou=Marketing", Strings.utf8ToString( bytes ) );
     }
 
 
     @Test
     public void testStringParser() throws LdapException
     {
-        String dn = Strings.utf8ToString(new byte[]
-                {'C', 'N', ' ', '=', ' ', 'E', 'm', 'm', 'a', 'n', 'u', 'e', 'l', ' ', ' ', 'L', (byte) 0xc3,
-                        (byte) 0xa9, 'c', 'h', 'a', 'r', 'n', 'y'});
+        String dn = Strings.utf8ToString( new byte[]
+            { 'C', 'N', ' ', '=', ' ', 'E', 'm', 'm', 'a', 'n', 'u', 'e', 'l', ' ', ' ', 'L', ( byte ) 0xc3,
+                ( byte ) 0xa9, 'c', 'h', 'a', 'r', 'n', 'y' } );
 
         Dn name = new Dn( dn );
 
@@ -288,8 +288,8 @@ public class DnParserTest
     @Test
     public void testStringParserShort() throws LdapException
     {
-        String dn = Strings.utf8ToString(new byte[]
-                {'C', '=', ' ', 'E', (byte) 0xc3, (byte) 0xa9, 'c'});
+        String dn = Strings.utf8ToString( new byte[]
+            { 'C', '=', ' ', 'E', ( byte ) 0xc3, ( byte ) 0xa9, 'c' } );
 
         Dn name = new Dn( dn );
 
@@ -301,7 +301,8 @@ public class DnParserTest
     @Test
     public void testVsldapExtras() throws LdapException
     {
-        Dn name = new Dn( "cn=Billy Bakers, OID.2.5.4.11=Corporate Tax, ou=Fin-Accounting, ou=Americas, ou=Search, o=IMC, c=US" );
+        Dn name = new Dn(
+            "cn=Billy Bakers, OID.2.5.4.11=Corporate Tax, ou=Fin-Accounting, ou=Americas, ou=Search, o=IMC, c=US" );
 
         assertEquals(
             "cn=Billy Bakers, OID.2.5.4.11=Corporate Tax, ou=Fin-Accounting, ou=Americas, ou=Search, o=IMC, c=US", name
@@ -337,7 +338,7 @@ public class DnParserTest
     @Test
     public final void testParseStringNull() throws LdapException
     {
-        Dn nameNull = new Dn( (String)null );
+        Dn nameNull = new Dn( ( String ) null );
 
         assertEquals( "Null Dn are legal : ", "", nameNull.toString() );
     }
@@ -356,7 +357,7 @@ public class DnParserTest
 
         assertEquals( "RFC1779_1 : ",
             "CN=Marshall T. Rose, O=Dover Beach Consulting, L=Santa Clara, ST=California, C=US",
-            ( (Dn) nameRFC1779_1 ).getName() );
+            ( ( Dn ) nameRFC1779_1 ).getName() );
         assertEquals( "RFC1779_1 : ", "cn=Marshall T. Rose,o=Dover Beach Consulting,l=Santa Clara,st=California,c=US",
             nameRFC1779_1.getNormName() );
     }
@@ -373,7 +374,7 @@ public class DnParserTest
     {
         Dn nameRFC2253_1 = new Dn( "CN=Steve Kille,O=Isode limited,C=GB" );
 
-        assertEquals( "RFC2253_1 : ", "CN=Steve Kille,O=Isode limited,C=GB", ( (Dn) nameRFC2253_1 ).getName() );
+        assertEquals( "RFC2253_1 : ", "CN=Steve Kille,O=Isode limited,C=GB", ( ( Dn ) nameRFC2253_1 ).getName() );
     }
 
 
@@ -389,7 +390,7 @@ public class DnParserTest
         Dn nameRFC2253_2 = new Dn( "CN = Sales + CN =   J. Smith , O = Widget Inc. , C = US" );
 
         assertEquals( "RFC2253_2 : ", "CN = Sales + CN =   J. Smith , O = Widget Inc. , C = US",
-            ( (Dn) nameRFC2253_2 ).getName() );
+            ( ( Dn ) nameRFC2253_2 ).getName() );
         assertEquals( "RFC2253_2 : ", "cn=Sales+cn=J. Smith,o=Widget Inc.,c=US", nameRFC2253_2.getNormName() );
     }
 
@@ -405,7 +406,7 @@ public class DnParserTest
     {
         Dn nameRFC2253_3 = new Dn( "CN=L. Eagle,   O=Sue\\, Grabbit and Runn, C=GB" );
 
-        assertEquals( "RFC2253_3 : ", "CN=L. Eagle,   O=Sue\\, Grabbit and Runn, C=GB", ( (Dn) nameRFC2253_3 )
+        assertEquals( "RFC2253_3 : ", "CN=L. Eagle,   O=Sue\\, Grabbit and Runn, C=GB", ( ( Dn ) nameRFC2253_3 )
             .getName() );
         assertEquals( "RFC2253_3 : ", "cn=L. Eagle,o=Sue\\, Grabbit and Runn,c=GB", nameRFC2253_3.getNormName() );
     }
@@ -421,7 +422,7 @@ public class DnParserTest
     public final void testParseStringRFC2253_4() throws LdapException
     {
         Dn nameRFC2253_4 = new Dn( "CN=Before\\0DAfter,O=Test,C=GB" );
-        assertEquals( "RFC2253_4 : ", "CN=Before\\0DAfter,O=Test,C=GB", ( (Dn) nameRFC2253_4 ).getName() );
+        assertEquals( "RFC2253_4 : ", "CN=Before\\0DAfter,O=Test,C=GB", ( ( Dn ) nameRFC2253_4 ).getName() );
     }
 
 
@@ -436,7 +437,7 @@ public class DnParserTest
     {
         Dn nameRFC2253_5 = new Dn( "1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB" );
 
-        assertEquals( "RFC2253_5 : ", "1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB", ( (Dn) nameRFC2253_5 )
+        assertEquals( "RFC2253_5 : ", "1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB", ( ( Dn ) nameRFC2253_5 )
             .getName() );
     }
 
@@ -452,7 +453,7 @@ public class DnParserTest
     {
         Dn nameRFC2253_6 = new Dn( "SN=Lu\\C4\\8Di\\C4\\87" );
 
-        assertEquals( "RFC2253_6 : ", "SN=Lu\\C4\\8Di\\C4\\87", ( (Dn) nameRFC2253_6 ).getName() );
+        assertEquals( "RFC2253_6 : ", "SN=Lu\\C4\\8Di\\C4\\87", ( ( Dn ) nameRFC2253_6 ).getName() );
     }
 
 
@@ -546,16 +547,16 @@ public class DnParserTest
 
         assertEquals( "cn=\u0130\u0131\u015E\u015F\u00D6\u00F6\u00DC\u00FC\u011E\u011F", result.toString() );
     }
-    
-   
+
+
     @Test
     public void testAUmlautPlusBytes() throws Exception
     {
-        String cn = new String( new byte[] { 'c', 'n', '=', (byte)0xC3, (byte)0x84, 0x5C, 0x32, 0x42 }, "UTF-8" );
-
+        String cn = new String( new byte[]
+            { 'c', 'n', '=', ( byte ) 0xC3, ( byte ) 0x84, 0x5C, 0x32, 0x42 }, "UTF-8" );
 
         String result = new Dn( cn ).getNormName();
-        
+
         assertEquals( "cn=\u00c4\\+", result );
     }
 
@@ -563,10 +564,11 @@ public class DnParserTest
     @Test
     public void testAUmlautPlusChar() throws Exception
     {
-        String cn = new String( new byte[] { 'c', 'n', '=', (byte)0xC3, (byte)0x84, '\\', '+' }, "UTF-8" );
-        
+        String cn = new String( new byte[]
+            { 'c', 'n', '=', ( byte ) 0xC3, ( byte ) 0x84, '\\', '+' }, "UTF-8" );
+
         String result = new Dn( cn ).toString();
-        
+
         assertEquals( "cn=\u00c4\\+", result );
     }
 
@@ -594,8 +596,8 @@ public class DnParserTest
             return;
         }
     }
-    
-    
+
+
     /**
      * Test the Dn.get( int ) method
      */
@@ -603,7 +605,7 @@ public class DnParserTest
     public void testGetRdnN() throws Exception
     {
         Dn dn = new Dn( "cn=test,dc=example,dc=org" );
-        
+
         assertEquals( "cn=test", dn.getRdn( 0 ).getName() );
         assertEquals( "dc=example", dn.getRdn( 1 ).getName() );
         assertEquals( "dc=org", dn.getRdn( 2 ).getName() );

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnSerializationTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnSerializationTest.java?rev=1235374&r1=1235373&r2=1235374&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnSerializationTest.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnSerializationTest.java Tue Jan 24 17:44:03 2012
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.ldap.model.name;
 
+
 import static org.junit.Assert.assertEquals;
 
 import java.io.ByteArrayInputStream;
@@ -34,6 +35,7 @@ import org.junit.runner.RunWith;
 import com.mycila.junit.concurrent.Concurrency;
 import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 
+
 /**
  * Test the Dn Serialization
  * 
@@ -47,12 +49,12 @@ public class DnSerializationTest
     public void testDnFullSerialization() throws IOException, LdapException, ClassNotFoundException
     {
         Dn dn1 = new Dn( "gn=john + cn=doe, dc=example, dc=com" );
-        
+
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
 
         dn1.writeExternal( out );
-        
+
         ObjectInputStream in = null;
 
         byte[] data = baos.toByteArray();
@@ -69,12 +71,12 @@ public class DnSerializationTest
     public void testDnEmptySerialization() throws IOException, LdapException, ClassNotFoundException
     {
         Dn dn1 = new Dn();
-        
+
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
 
         dn1.writeExternal( out );
-        
+
         ObjectInputStream in = null;
 
         byte[] data = baos.toByteArray();
@@ -91,12 +93,12 @@ public class DnSerializationTest
     public void testDnSimpleSerialization() throws IOException, LdapException, ClassNotFoundException
     {
         Dn dn1 = new Dn( "Cn = Doe" );
-        
+
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
 
         dn1.writeExternal( out );
-        
+
         ObjectInputStream in = null;
 
         byte[] data = baos.toByteArray();

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/FastDnParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/FastDnParserTest.java?rev=1235374&r1=1235373&r2=1235374&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/FastDnParserTest.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/FastDnParserTest.java Tue Jan 24 17:44:03 2012
@@ -33,6 +33,7 @@ import org.junit.runner.RunWith;
 import com.mycila.junit.concurrent.Concurrency;
 import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 
+
 /**
  * Tests the fast Dn parser.
  * 
@@ -52,7 +53,7 @@ public class FastDnParserTest
     @Test
     public void testLdapDNEmpty() throws LdapException
     {
-        assertEquals( "", ( (Dn) FastDnParser.parse( "" ) ).getName() );
+        assertEquals( "", ( ( Dn ) FastDnParser.parse( "" ) ).getName() );
     }
 
 
@@ -144,7 +145,7 @@ public class FastDnParserTest
         {
             // expected
         }
-        
+
         FastDnParser.parse( " 0.5=" );
         FastDnParser.parse( " 0.5 = " );
         FastDnParser.parse( " 0.5 = b" );
@@ -392,19 +393,19 @@ public class FastDnParserTest
     {
         Dn dn = FastDnParser.parse( "cn = John, ou = People, OU = Marketing" );
 
-        byte[] bytes = Dn.getBytes(dn);
+        byte[] bytes = Dn.getBytes( dn );
 
         assertEquals( 30, bytes.length );
-        assertEquals( "cn=John,ou=People,ou=Marketing", Strings.utf8ToString(bytes) );
+        assertEquals( "cn=John,ou=People,ou=Marketing", Strings.utf8ToString( bytes ) );
     }
 
 
     @Test
     public void testStringParser() throws LdapException
     {
-        String dn = Strings.utf8ToString(new byte[]
-                {'C', 'N', ' ', '=', ' ', 'E', 'm', 'm', 'a', 'n', 'u', 'e', 'l', ' ', ' ', 'L', (byte) 0xc3,
-                        (byte) 0xa9, 'c', 'h', 'a', 'r', 'n', 'y'});
+        String dn = Strings.utf8ToString( new byte[]
+            { 'C', 'N', ' ', '=', ' ', 'E', 'm', 'm', 'a', 'n', 'u', 'e', 'l', ' ', ' ', 'L', ( byte ) 0xc3,
+                ( byte ) 0xa9, 'c', 'h', 'a', 'r', 'n', 'y' } );
 
         Dn name = FastDnParser.parse( dn );
 
@@ -416,8 +417,8 @@ public class FastDnParserTest
     @Test
     public void testStringParserShort() throws LdapException
     {
-        String dn = Strings.utf8ToString(new byte[]
-                {'C', '=', ' ', 'E', (byte) 0xc3, (byte) 0xa9, 'c'});
+        String dn = Strings.utf8ToString( new byte[]
+            { 'C', '=', ' ', 'E', ( byte ) 0xc3, ( byte ) 0xa9, 'c' } );
 
         Dn name = FastDnParser.parse( dn );
 
@@ -486,7 +487,7 @@ public class FastDnParserTest
 
         assertEquals( "RFC1779_1 : ",
             "CN=Marshall T. Rose, O=Dover Beach Consulting, L=Santa Clara, ST=California, C=US",
-            nameRFC1779_1 .getName() );
+            nameRFC1779_1.getName() );
         assertEquals( "RFC1779_1 : ", "cn=Marshall T. Rose,o=Dover Beach Consulting,l=Santa Clara,st=California,c=US",
             nameRFC1779_1.getNormName() );
     }
@@ -503,7 +504,7 @@ public class FastDnParserTest
     {
         Dn nameRFC2253_1 = FastDnParser.parse( "CN=Steve Kille,O=Isode limited,C=GB" );
 
-        assertEquals( "RFC2253_1 : ", "CN=Steve Kille,O=Isode limited,C=GB", ( (Dn) nameRFC2253_1 ).getName() );
+        assertEquals( "RFC2253_1 : ", "CN=Steve Kille,O=Isode limited,C=GB", ( ( Dn ) nameRFC2253_1 ).getName() );
     }
 
 
@@ -646,7 +647,7 @@ public class FastDnParserTest
     public final void testPreserveSpaceAfterEscape() throws LdapException
     {
         String input = "ou=some test\\,  something else";
-        
+
         try
         {
             FastDnParser.parse( input ).toString();

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/RdnSerializationTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/RdnSerializationTest.java?rev=1235374&r1=1235373&r2=1235374&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/RdnSerializationTest.java (original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/RdnSerializationTest.java Tue Jan 24 17:44:03 2012
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.ldap.model.name;
 
+
 import static org.junit.Assert.assertEquals;
 
 import java.io.ByteArrayInputStream;
@@ -35,6 +36,7 @@ import org.junit.runner.RunWith;
 import com.mycila.junit.concurrent.Concurrency;
 import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 
+
 /**
  * Test the Rdn Serialization
  * 
@@ -48,12 +50,12 @@ public class RdnSerializationTest
     public void testRdnFullSerialization() throws IOException, LdapException, ClassNotFoundException
     {
         Rdn rdn1 = new Rdn( "gn=john + cn=doe" );
-        
+
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
 
         rdn1.writeExternal( out );
-        
+
         ObjectInputStream in = null;
 
         byte[] data = baos.toByteArray();
@@ -70,12 +72,12 @@ public class RdnSerializationTest
     public void testRdnEmptySerialization() throws IOException, LdapException, ClassNotFoundException
     {
         Rdn rdn1 = new Rdn();
-        
+
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
 
         rdn1.writeExternal( out );
-        
+
         ObjectInputStream in = null;
 
         byte[] data = baos.toByteArray();
@@ -92,12 +94,12 @@ public class RdnSerializationTest
     public void testRdnSimpleSerialization() throws IOException, LdapException, ClassNotFoundException
     {
         Rdn rdn1 = new Rdn( "cn=doe" );
-        
+
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );
 
         rdn1.writeExternal( out );
-        
+
         ObjectInputStream in = null;
 
         byte[] data = baos.toByteArray();



Mime
View raw message