directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1051130 [6/7] - in /directory: apacheds/branches/alex_refactoring/core-api/src/main/java/org/apache/directory/server/core/ apacheds/branches/alex_refactoring/core-api/src/main/java/org/apache/directory/server/core/entry/ apacheds/branches/...
Date Mon, 20 Dec 2010 14:31:36 GMT
Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/OidSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/OidSyntaxChecker.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/OidSyntaxChecker.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/OidSyntaxChecker.java Mon Dec 20 14:31:29 2010
@@ -86,7 +86,7 @@ public class OidSyntaxChecker extends Sy
         }
         else if ( value instanceof byte[] )
         {
-            strValue = StringTools.utf8ToString( ( byte[] ) value ); 
+            strValue = Strings.utf8ToString((byte[]) value);
         }
         else
         {

Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/OtherMailboxSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/OtherMailboxSyntaxChecker.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/OtherMailboxSyntaxChecker.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/OtherMailboxSyntaxChecker.java Mon Dec 20 14:31:29 2010
@@ -23,6 +23,7 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -73,7 +74,7 @@ public class OtherMailboxSyntaxChecker e
         }
         else if ( value instanceof byte[] )
         {
-            strValue = StringTools.utf8ToString( ( byte[] ) value ); 
+            strValue = Strings.utf8ToString((byte[]) value);
         }
         else
         {

Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/PostalAddressSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/PostalAddressSyntaxChecker.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/PostalAddressSyntaxChecker.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/PostalAddressSyntaxChecker.java Mon Dec 20 14:31:29 2010
@@ -22,7 +22,7 @@ package org.apache.directory.shared.ldap
 
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -72,7 +72,7 @@ public class PostalAddressSyntaxChecker 
         }
         else if ( value instanceof byte[] )
         {
-            strValue = StringTools.utf8ToString( ( byte[] ) value ); 
+            strValue = Strings.utf8ToString((byte[]) value);
         }
         else
         {
@@ -101,7 +101,7 @@ public class PostalAddressSyntaxChecker 
             // check that the element between each '$' is not empty
             String address = strValue.substring( pos, dollar );
             
-            if ( StringTools.isEmpty( address ) )
+            if ( Strings.isEmpty(address) )
             {
                 LOG.debug( "Syntax invalid for '{}'", value );
                 return false;

Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/PrintableStringSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/PrintableStringSyntaxChecker.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/PrintableStringSyntaxChecker.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/PrintableStringSyntaxChecker.java Mon Dec 20 14:31:29 2010
@@ -23,6 +23,7 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -93,7 +94,7 @@ public class PrintableStringSyntaxChecke
         }
         else if ( value instanceof byte[] )
         {
-            strValue = StringTools.utf8ToString( ( byte[] ) value ); 
+            strValue = Strings.utf8ToString((byte[]) value);
         }
         else
         {

Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/SubtreeSpecificationSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/SubtreeSpecificationSyntaxChecker.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/SubtreeSpecificationSyntaxChecker.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/SubtreeSpecificationSyntaxChecker.java Mon Dec 20 14:31:29 2010
@@ -25,7 +25,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecificationChecker;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -76,7 +76,7 @@ public class SubtreeSpecificationSyntaxC
         }
         else if ( value instanceof byte[] )
         {
-            strValue = StringTools.utf8ToString( ( byte[] ) value ); 
+            strValue = Strings.utf8ToString((byte[]) value);
         }
         else
         {

Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TelephoneNumberSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TelephoneNumberSyntaxChecker.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TelephoneNumberSyntaxChecker.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TelephoneNumberSyntaxChecker.java Mon Dec 20 14:31:29 2010
@@ -27,7 +27,7 @@ import java.util.regex.PatternSyntaxExce
 
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -148,7 +148,7 @@ public class TelephoneNumberSyntaxChecke
         }
         else if ( value instanceof byte[] )
         {
-            strValue = StringTools.utf8ToString( ( byte[] ) value ); 
+            strValue = Strings.utf8ToString((byte[]) value);
         }
         else
         {

Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TeletexTerminalIdentifierSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TeletexTerminalIdentifierSyntaxChecker.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TeletexTerminalIdentifierSyntaxChecker.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TeletexTerminalIdentifierSyntaxChecker.java Mon Dec 20 14:31:29 2010
@@ -23,6 +23,7 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -77,7 +78,7 @@ public class TeletexTerminalIdentifierSy
         }
         else if ( value instanceof byte[] )
         {
-            strValue = StringTools.utf8ToString( ( byte[] ) value ); 
+            strValue = Strings.utf8ToString((byte[]) value);
         }
         else
         {
@@ -152,7 +153,7 @@ public class TeletexTerminalIdentifierSy
                 
                 boolean hasEsc = false;
                 
-                for ( byte b:StringTools.getBytesUtf8( ttxParam ) )
+                for ( byte b: Strings.getBytesUtf8(ttxParam) )
                 {
                     switch ( b )
                     {

Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TelexNumberSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TelexNumberSyntaxChecker.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TelexNumberSyntaxChecker.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TelexNumberSyntaxChecker.java Mon Dec 20 14:31:29 2010
@@ -23,6 +23,7 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -74,7 +75,7 @@ public class TelexNumberSyntaxChecker ex
         }
         else if ( value instanceof byte[] )
         {
-            strValue = StringTools.utf8ToString( ( byte[] ) value ); 
+            strValue = Strings.utf8ToString((byte[]) value);
         }
         else
         {

Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/UtcTimeSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/UtcTimeSyntaxChecker.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/UtcTimeSyntaxChecker.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/UtcTimeSyntaxChecker.java Mon Dec 20 14:31:29 2010
@@ -24,7 +24,7 @@ import java.util.regex.Pattern;
 
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -114,7 +114,7 @@ public class UtcTimeSyntaxChecker extend
         }
         else if ( value instanceof byte[] )
         {
-            strValue = StringTools.utf8ToString( ( byte[] ) value ); 
+            strValue = Strings.utf8ToString((byte[]) value);
         }
         else
         {

Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java Mon Dec 20 14:31:29 2010
@@ -701,7 +701,7 @@ public final class AttributeUtils
                         }
                         else if ( attr instanceof byte[] )
                         {
-                            String string = StringTools.utf8ToString( ( byte[] ) attr );
+                            String string = Strings.utf8ToString((byte[]) attr);
 
                             sb.append( tabs ).append( "        Val[" ).append( j ).append( "] : " );
                             sb.append( string ).append( '/' );

Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/util/Base32.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/util/Base32.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/util/Base32.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/util/Base32.java Mon Dec 20 14:31:29 2010
@@ -21,6 +21,8 @@
 package org.apache.directory.shared.ldap.util;
 
 
+import org.apache.directory.shared.util.Strings;
+
 /**
  * decoding of base32 characters to raw bytes.
  * 
@@ -54,12 +56,12 @@ public final class Base32
      */
     public static String encode( String str )
     {
-        if ( StringTools.isEmpty( str ) )
+        if ( Strings.isEmpty(str) )
         {
             return "";
         }
         
-        byte[] data = StringTools.getBytesUtf8( str );
+        byte[] data = Strings.getBytesUtf8(str);
         int dataLength = data.length;
         int newLength = ( ( dataLength << 3 ) / 5 ) + ( ( dataLength % 5 ) == 0 ? 0 : 1 );
         newLength += ( ( newLength % 8 == 0 ) ? 0 : 8 - newLength % 8 );
@@ -153,6 +155,6 @@ public final class Base32
                 break;
         }
         
-        return StringTools.utf8ToString( out );
+        return Strings.utf8ToString(out);
     }
 }

Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/util/LdapURL.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/util/LdapURL.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/util/LdapURL.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/util/LdapURL.java Mon Dec 20 14:31:29 2010
@@ -40,6 +40,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.util.CharConstants;
+import org.apache.directory.shared.util.Strings;
 
 
 /**
@@ -333,7 +334,7 @@ public class LdapURL
             throw new LdapURLEncodingException( I18n.err( I18n.ERR_04410 ) );
         }
 
-        string = StringTools.utf8ToString( bytes );
+        string = Strings.utf8ToString(bytes);
 
         this.bytes = new byte[bytes.length];
         System.arraycopy( bytes, 0, this.bytes, 0, bytes.length );

Modified: directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java Mon Dec 20 14:31:29 2010
@@ -2020,43 +2020,6 @@ public final class StringTools
     
     // Empty checks
     // -----------------------------------------------------------------------
-    /**
-     * <p>
-     * Checks if a String is empty ("") or null.
-     * </p>
-     * 
-     * <pre>
-     *  StringUtils.isEmpty(null)      = true
-     *  StringUtils.isEmpty(&quot;&quot;)        = true
-     *  StringUtils.isEmpty(&quot; &quot;)       = false
-     *  StringUtils.isEmpty(&quot;bob&quot;)     = false
-     *  StringUtils.isEmpty(&quot;  bob  &quot;) = false
-     * </pre>
-     * 
-     * <p>
-     * NOTE: This method changed in Lang version 2.0. It no longer trims the
-     * String. That functionality is available in isBlank().
-     * </p>
-     * 
-     * @param str the String to check, may be null
-     * @return <code>true</code> if the String is empty or null
-     */
-    public static boolean isEmpty( String str )
-    {
-        return str == null || str.length() == 0;
-    }
-
-
-    /**
-     * Checks if a bytes array is empty or null.
-     * 
-     * @param bytes The bytes array to check, may be null
-     * @return <code>true</code> if the bytes array is empty or null
-     */
-    public static boolean isEmpty( byte[] bytes )
-    {
-        return bytes == null || bytes.length == 0;
-    }
 
 
     /**
@@ -2101,7 +2064,7 @@ public final class StringTools
      */
     public static String trim( String str )
     {
-        return ( isEmpty( str ) ? "" : str.trim() );
+        return ( Strings.isEmpty(str) ? "" : str.trim() );
     }
 
 
@@ -2126,7 +2089,7 @@ public final class StringTools
      */
     public static byte[] trim( byte[] bytes )
     {
-        if ( isEmpty( bytes ) )
+        if ( Strings.isEmpty(bytes) )
         {
             return CharConstants.EMPTY_BYTES;
         }
@@ -2171,7 +2134,7 @@ public final class StringTools
      */
     public static String trimLeft( String str )
     {
-        if ( isEmpty( str ) )
+        if ( Strings.isEmpty(str) )
         {
             return "";
         }
@@ -2350,7 +2313,7 @@ public final class StringTools
      */
     public static String trimRight( String str )
     {
-        if ( isEmpty( str ) )
+        if ( Strings.isEmpty(str) )
         {
             return "";
         }
@@ -2392,7 +2355,7 @@ public final class StringTools
      */
     public static String trimRight( String str, int escapedSpace )
     {
-        if ( isEmpty( str ) )
+        if ( Strings.isEmpty(str) )
         {
             return "";
         }
@@ -2527,11 +2490,11 @@ public final class StringTools
 
         if ( pos.end == bytes.length )
         {
-            return StringTools.utf8ToString( bytes );
+            return Strings.utf8ToString(bytes);
         }
         else
         {
-            return StringTools.utf8ToString( bytes, pos.end );
+            return Strings.utf8ToString(bytes, pos.end);
         }
     }
 
@@ -2690,109 +2653,6 @@ public final class StringTools
 
 
     /**
-     * Return an UTF-8 encoded String
-     * 
-     * @param bytes The byte array to be transformed to a String
-     * @return A String.
-     */
-    public static String utf8ToString( byte[] bytes )
-    {
-        if ( bytes == null )
-        {
-            return "";
-        }
-
-        try
-        {
-            return new String( bytes, "UTF-8" );
-        }
-        catch ( UnsupportedEncodingException uee )
-        {
-            // if this happens something is really strange
-            throw new RuntimeException( uee );
-        }
-    }
-
-
-    /**
-     * Return an UTF-8 encoded String
-     * 
-     * @param bytes The byte array to be transformed to a String
-     * @param length The length of the byte array to be converted
-     * @return A String.
-     */
-    public static String utf8ToString( byte[] bytes, int length )
-    {
-        if ( bytes == null )
-        {
-            return "";
-        }
-
-        try
-        {
-            return new String( bytes, 0, length, "UTF-8" );
-        }
-        catch ( UnsupportedEncodingException uee )
-        {
-            // if this happens something is really strange
-            throw new RuntimeException( uee );
-        }
-    }
-
-
-    /**
-     * Return an UTF-8 encoded String
-     * 
-     * @param bytes  The byte array to be transformed to a String
-     * @param start the starting position in the byte array  
-     * @param length The length of the byte array to be converted
-     * @return A String.
-     */
-    public static String utf8ToString( byte[] bytes, int start, int length )
-    {
-        if ( bytes == null )
-        {
-            return "";
-        }
-
-        try
-        {
-            return new String( bytes, start, length, "UTF-8" );
-        }
-        catch ( UnsupportedEncodingException uee )
-        {
-            // if this happens something is really strange
-            throw new RuntimeException( uee );
-        }
-    }
-
-
-    /**
-     * Return UTF-8 encoded byte[] representation of a String
-     * 
-     * @param string The string to be transformed to a byte array
-     * @return The transformed byte array
-     */
-    public static byte[] getBytesUtf8( String string )
-    {
-        if ( string == null )
-        {
-            return new byte[0];
-        }
-
-        try
-        {
-            return string.getBytes( "UTF-8" );
-        }
-        catch ( UnsupportedEncodingException uee )
-        {
-            // if this happens something is really strange
-            throw new RuntimeException( uee );
-        }
-    }
-
-
-    /**
      * Utility method that return a String representation of a list
      * 
      * @param list The list to transform to a string
@@ -3024,7 +2884,7 @@ public final class StringTools
             decoded[jj] = ( byte ) ch;
         }
         
-        return StringTools.utf8ToString( decoded );
+        return Strings.utf8ToString(decoded);
     }
 
 

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java Mon Dec 20 14:31:29 2010
@@ -36,7 +36,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.tlv.TLVStateEnum;
 import org.apache.directory.shared.ldap.message.BindRequest;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 import org.apache.mina.core.buffer.IoBuffer;
 import org.apache.mina.core.filterchain.IoFilter.NextFilter;
 import org.apache.mina.core.session.DummySession;
@@ -141,7 +141,7 @@ public class LdapDecoderTest
         assertTrue( bindRequest.isVersion3() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", bindRequest.getName().toString() );
         assertTrue( bindRequest.isSimple() );
-        assertEquals( "password", StringTools.utf8ToString( bindRequest.getCredentials() ) );
+        assertEquals( "password", Strings.utf8ToString(bindRequest.getCredentials()) );
     }
 
 
@@ -211,7 +211,7 @@ public class LdapDecoderTest
         assertTrue( bindRequest.isVersion3() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", bindRequest.getName().toString() );
         assertTrue( bindRequest.isSimple() );
-        assertEquals( "password", StringTools.utf8ToString( bindRequest.getCredentials() ) );
+        assertEquals( "password", Strings.utf8ToString(bindRequest.getCredentials()) );
         
         // The second message
         bindRequest = ( BindRequest ) ( ( LdapProtocolDecoderOutput ) result ).getMessage();
@@ -220,7 +220,7 @@ public class LdapDecoderTest
         assertTrue( bindRequest.isVersion3() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", bindRequest.getName().toString() );
         assertTrue( bindRequest.isSimple() );
-        assertEquals( "password", StringTools.utf8ToString( bindRequest.getCredentials() ) );
+        assertEquals( "password", Strings.utf8ToString(bindRequest.getCredentials()) );
     }
 
 
@@ -340,7 +340,7 @@ public class LdapDecoderTest
         assertTrue( bindRequest.isVersion3() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", bindRequest.getName().toString() );
         assertTrue( bindRequest.isSimple() );
-        assertEquals( "password", StringTools.utf8ToString( bindRequest.getCredentials() ) );
+        assertEquals( "password", Strings.utf8ToString(bindRequest.getCredentials()) );
     }
 
 

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java Mon Dec 20 14:31:29 2010
@@ -40,7 +40,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.LdapEncoder;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.name.DN;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -133,7 +132,7 @@ public class BindRequestPerfTest
         assertTrue( bindRequest.isVersion3() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", bindRequest.getName().toString() );
         assertTrue( bindRequest.isSimple() );
-        assertEquals( "password", StringTools.utf8ToString( bindRequest.getCredentials() ) );
+        assertEquals( "password", Strings.utf8ToString(bindRequest.getCredentials()) );
 
         // Check the Control
         Map<String, Control> controls = bindRequest.getControls();
@@ -183,7 +182,7 @@ public class BindRequestPerfTest
 
             bindRequest.setSimple( true );
             bindRequest.setName( name );
-            bindRequest.setCredentials( StringTools.getBytesUtf8( "password" ) );
+            bindRequest.setCredentials( Strings.getBytesUtf8("password") );
             Control control = new ControlImpl( "2.16.840.1.113730.3.4.2" );
 
             bindRequest.addControl( control );

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java Mon Dec 20 14:31:29 2010
@@ -42,7 +42,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.Message;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -210,7 +209,7 @@ public class BindRequestTest
         assertTrue( bindRequest.isVersion3() );
         assertEquals( "uid=akarasulu,dc=example,dc=com", bindRequest.getName().toString() );
         assertTrue( bindRequest.isSimple() );
-        assertEquals( "password", StringTools.utf8ToString( bindRequest.getCredentials() ) );
+        assertEquals( "password", Strings.utf8ToString(bindRequest.getCredentials()) );
 
         // Check the encoding
         try
@@ -372,7 +371,7 @@ public class BindRequestTest
         assertTrue( bindRequest.isVersion3() );
         assertEquals( "", bindRequest.getName().toString() );
         assertTrue( bindRequest.isSimple() );
-        assertEquals( "password", StringTools.utf8ToString( bindRequest.getCredentials() ) );
+        assertEquals( "password", Strings.utf8ToString(bindRequest.getCredentials()) );
 
         // Check the encoding
         try
@@ -532,7 +531,7 @@ public class BindRequestTest
         assertEquals( "uid=akarasulu,dc=example,dc=com", bindRequest.getName().toString() );
         assertFalse( bindRequest.isSimple() );
         assertEquals( "KERBEROS_V4", bindRequest.getSaslMechanism() );
-        assertEquals( "abcdef", StringTools.utf8ToString( bindRequest.getCredentials() ) );
+        assertEquals( "abcdef", Strings.utf8ToString(bindRequest.getCredentials()) );
 
         // Check the encoding
         try
@@ -609,7 +608,7 @@ public class BindRequestTest
         assertEquals( "", bindRequest.getName().toString() );
         assertFalse( bindRequest.isSimple() );
         assertEquals( "KERBEROS_V4", bindRequest.getSaslMechanism() );
-        assertEquals( "abcdef", StringTools.utf8ToString( bindRequest.getCredentials() ) );
+        assertEquals( "abcdef", Strings.utf8ToString(bindRequest.getCredentials()) );
 
         // Check the encoding
         try
@@ -922,7 +921,7 @@ public class BindRequestTest
         assertTrue( bindRequest.isVersion3() );
         assertEquals( "", bindRequest.getName().toString() );
         assertTrue( bindRequest.isSimple() );
-        assertEquals( "", StringTools.utf8ToString( bindRequest.getCredentials() ) );
+        assertEquals( "", Strings.utf8ToString(bindRequest.getCredentials()) );
 
         // Check the encoding
         try
@@ -1131,7 +1130,7 @@ public class BindRequestTest
         assertEquals( "", bindRequest.getName().toString() );
         assertFalse( bindRequest.isSimple() );
         assertEquals( "", bindRequest.getSaslMechanism() );
-        assertEquals( "", StringTools.utf8ToString( bindRequest.getCredentials() ) );
+        assertEquals( "", Strings.utf8ToString(bindRequest.getCredentials()) );
 
         // Check the encoding
         try
@@ -1202,7 +1201,7 @@ public class BindRequestTest
         assertEquals( "", bindRequest.getName().toString() );
         assertFalse( bindRequest.isSimple() );
         assertEquals( "", bindRequest.getSaslMechanism() );
-        assertEquals( "", StringTools.utf8ToString( bindRequest.getCredentials() ) );
+        assertEquals( "", Strings.utf8ToString(bindRequest.getCredentials()) );
 
         // Check the Control
         Map<String, Control> controls = bindRequest.getControls();
@@ -1281,7 +1280,7 @@ public class BindRequestTest
         assertEquals( "", bindRequest.getName().toString() );
         assertFalse( bindRequest.isSimple() );
         assertEquals( "", bindRequest.getSaslMechanism() );
-        assertEquals( "", StringTools.utf8ToString( bindRequest.getCredentials() ) );
+        assertEquals( "", Strings.utf8ToString(bindRequest.getCredentials()) );
 
         // Check the Control
         Map<String, Control> controls = bindRequest.getControls();

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java Mon Dec 20 14:31:29 2010
@@ -40,7 +40,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.LdapEncoder;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -282,7 +281,7 @@ public class BindResponseTest
         assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
         assertEquals( "", bindResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", bindResponse.getLdapResult().getErrorMessage() );
-        assertEquals( "", StringTools.utf8ToString( bindResponse.getServerSaslCreds() ) );
+        assertEquals( "", Strings.utf8ToString(bindResponse.getServerSaslCreds()) );
 
         // Check the encoding
         try
@@ -368,7 +367,7 @@ public class BindResponseTest
         assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
         assertEquals( "", bindResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", bindResponse.getLdapResult().getErrorMessage() );
-        assertEquals( "", StringTools.utf8ToString( bindResponse.getServerSaslCreds() ) );
+        assertEquals( "", Strings.utf8ToString(bindResponse.getServerSaslCreds()) );
 
         // Check the Control
         Map<String, Control> controls = bindResponse.getControls();
@@ -450,7 +449,7 @@ public class BindResponseTest
         assertEquals( ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode() );
         assertEquals( "", bindResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", bindResponse.getLdapResult().getErrorMessage() );
-        assertEquals( "AB", StringTools.utf8ToString( bindResponse.getServerSaslCreds() ) );
+        assertEquals( "AB", Strings.utf8ToString(bindResponse.getServerSaslCreds()) );
 
         // Check the encoding
         try

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncDoneValueControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncDoneValueControlTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncDoneValueControlTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncDoneValueControlTest.java Mon Dec 20 14:31:29 2010
@@ -35,7 +35,6 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControl;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControlContainer;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControlDecoder;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -80,7 +79,7 @@ public class SyncDoneValueControlTest
         }
 
         SyncDoneValueControl control = container.getSyncDoneValueControl();
-        assertEquals( "xkcd", StringTools.utf8ToString( control.getCookie() ) );
+        assertEquals( "xkcd", Strings.utf8ToString(control.getCookie()) );
         assertTrue( control.isRefreshDeletes() );
         
         // test encoding
@@ -234,7 +233,7 @@ public class SyncDoneValueControlTest
         }
 
         SyncDoneValueControl control = container.getSyncDoneValueControl();
-        assertEquals( "", StringTools.utf8ToString( control.getCookie() ) );
+        assertEquals( "", Strings.utf8ToString(control.getCookie()) );
         assertFalse( control.isRefreshDeletes() );
 
         // test encoding

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncInfoValueControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncInfoValueControlTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncInfoValueControlTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncInfoValueControlTest.java Mon Dec 20 14:31:29 2010
@@ -35,7 +35,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueControlContainer;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueControlDecoder;
 import org.apache.directory.shared.ldap.message.control.replication.SynchronizationInfoEnum;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -82,7 +81,7 @@ public class SyncInfoValueControlTest
 
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.NEW_COOKIE, syncInfoValue.getType() );
-        assertEquals( "abc", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncInfoValue.getCookie()) );
         
         // Check the encoding
         try
@@ -141,7 +140,7 @@ public class SyncInfoValueControlTest
 
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.NEW_COOKIE, syncInfoValue.getType() );
-        assertEquals( "", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "", Strings.utf8ToString(syncInfoValue.getCookie()) );
         
         // Check the encoding
         try
@@ -205,7 +204,7 @@ public class SyncInfoValueControlTest
 
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.REFRESH_DELETE, syncInfoValue.getType() );
-        assertEquals( "abc", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertTrue( syncInfoValue.isRefreshDone() );
         
         // Check the encoding
@@ -269,7 +268,7 @@ public class SyncInfoValueControlTest
 
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.REFRESH_DELETE, syncInfoValue.getType() );
-        assertEquals( "abc", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertFalse( syncInfoValue.isRefreshDone() );
         
         // Check the encoding
@@ -333,7 +332,7 @@ public class SyncInfoValueControlTest
 
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.REFRESH_DELETE, syncInfoValue.getType() );
-        assertEquals( "abc", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertTrue( syncInfoValue.isRefreshDone() );
         
         // Check the encoding
@@ -396,7 +395,7 @@ public class SyncInfoValueControlTest
 
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.REFRESH_DELETE, syncInfoValue.getType() );
-        assertEquals( "", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertFalse( syncInfoValue.isRefreshDone() );
         
         // Check the encoding
@@ -457,7 +456,7 @@ public class SyncInfoValueControlTest
 
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.REFRESH_DELETE, syncInfoValue.getType() );
-        assertEquals( "", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertTrue( syncInfoValue.isRefreshDone() );
         
         // Check the encoding
@@ -522,7 +521,7 @@ public class SyncInfoValueControlTest
 
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.REFRESH_PRESENT, syncInfoValue.getType() );
-        assertEquals( "abc", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertTrue( syncInfoValue.isRefreshDone() );
         
         // Check the encoding
@@ -586,7 +585,7 @@ public class SyncInfoValueControlTest
 
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.REFRESH_PRESENT, syncInfoValue.getType() );
-        assertEquals( "abc", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertFalse( syncInfoValue.isRefreshDone() );
         
         // Check the encoding
@@ -650,7 +649,7 @@ public class SyncInfoValueControlTest
 
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.REFRESH_PRESENT, syncInfoValue.getType() );
-        assertEquals( "abc", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertTrue( syncInfoValue.isRefreshDone() );
         
         // Check the encoding
@@ -713,7 +712,7 @@ public class SyncInfoValueControlTest
 
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.REFRESH_PRESENT, syncInfoValue.getType() );
-        assertEquals( "", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertFalse( syncInfoValue.isRefreshDone() );
         
         // Check the encoding
@@ -774,7 +773,7 @@ public class SyncInfoValueControlTest
 
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.REFRESH_PRESENT, syncInfoValue.getType() );
-        assertEquals( "", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertTrue( syncInfoValue.isRefreshDone() );
         
         // Check the encoding
@@ -965,7 +964,7 @@ public class SyncInfoValueControlTest
         
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
-        assertEquals( "", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertFalse( syncInfoValue.isRefreshDeletes() );
         assertEquals( 0, syncInfoValue.getSyncUUIDs().size() );
         
@@ -1037,7 +1036,7 @@ public class SyncInfoValueControlTest
         }
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
-        assertEquals( "", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertFalse( syncInfoValue.isRefreshDeletes() );
         assertEquals( 3, syncInfoValue.getSyncUUIDs().size() );
         
@@ -1120,7 +1119,7 @@ public class SyncInfoValueControlTest
         }
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
-        assertEquals( "abc", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertFalse( syncInfoValue.isRefreshDeletes() );
         assertEquals( 0, syncInfoValue.getSyncUUIDs().size() );
         
@@ -1195,7 +1194,7 @@ public class SyncInfoValueControlTest
         
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
-        assertEquals( "abc", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertFalse( syncInfoValue.isRefreshDeletes() );
         assertEquals( 3, syncInfoValue.getSyncUUIDs().size() );
         
@@ -1279,7 +1278,7 @@ public class SyncInfoValueControlTest
         }
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
-        assertEquals( "", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertTrue( syncInfoValue.isRefreshDeletes() );
         assertEquals( 0, syncInfoValue.getSyncUUIDs().size() );
         
@@ -1353,7 +1352,7 @@ public class SyncInfoValueControlTest
         }
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
-        assertEquals( "", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertTrue( syncInfoValue.isRefreshDeletes() );
         assertEquals( 3, syncInfoValue.getSyncUUIDs().size() );
         
@@ -1438,7 +1437,7 @@ public class SyncInfoValueControlTest
         }
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
-        assertEquals( "abc", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertTrue( syncInfoValue.isRefreshDeletes() );
         assertEquals( 0, syncInfoValue.getSyncUUIDs().size() );
         
@@ -1515,7 +1514,7 @@ public class SyncInfoValueControlTest
         
         SyncInfoValueControl syncInfoValue = container.getSyncInfoValueControl();
         assertEquals( SynchronizationInfoEnum.SYNC_ID_SET, syncInfoValue.getType() );
-        assertEquals( "abc", StringTools.utf8ToString( syncInfoValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncInfoValue.getCookie()) );
         assertTrue( syncInfoValue.isRefreshDeletes() );
         assertEquals( 3, syncInfoValue.getSyncUUIDs().size() );
         

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncRequestValueControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncRequestValueControlTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncRequestValueControlTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncRequestValueControlTest.java Mon Dec 20 14:31:29 2010
@@ -35,7 +35,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.controls.replication.syncRequestValue.SyncRequestValueControlContainer;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncRequestValue.SyncRequestValueControlDecoder;
 import org.apache.directory.shared.ldap.message.control.replication.SynchronizationModeEnum;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -83,7 +82,7 @@ public class SyncRequestValueControlTest
 
         SyncRequestValueControl syncRequestValue = container.getSyncRequestValueControl();
         assertEquals( SynchronizationModeEnum.REFRESH_ONLY, syncRequestValue.getMode() );
-        assertEquals( "abc", StringTools.utf8ToString( syncRequestValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncRequestValue.getCookie()) );
         assertEquals( false, syncRequestValue.isReloadHint() );
 
         // Check the encoding
@@ -152,7 +151,7 @@ public class SyncRequestValueControlTest
 
         SyncRequestValueControl syncRequestValue = container.getSyncRequestValueControl();
         assertEquals( SynchronizationModeEnum.REFRESH_AND_PERSIST, syncRequestValue.getMode() );
-        assertEquals( "abc", StringTools.utf8ToString( syncRequestValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncRequestValue.getCookie()) );
         assertEquals( false, syncRequestValue.isReloadHint() );
 
         // Check the encoding
@@ -423,7 +422,7 @@ public class SyncRequestValueControlTest
 
         SyncRequestValueControl syncRequestValue = container.getSyncRequestValueControl();
         assertEquals( SynchronizationModeEnum.REFRESH_AND_PERSIST, syncRequestValue.getMode() );
-        assertEquals( "abc", StringTools.utf8ToString( syncRequestValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncRequestValue.getCookie()) );
         assertEquals( false, syncRequestValue.isReloadHint() );
 
         // Check the encoding
@@ -491,7 +490,7 @@ public class SyncRequestValueControlTest
 
         SyncRequestValueControl syncRequestValue = container.getSyncRequestValueControl();
         assertEquals( SynchronizationModeEnum.REFRESH_AND_PERSIST, syncRequestValue.getMode() );
-        assertEquals( "", StringTools.utf8ToString( syncRequestValue.getCookie() ) );
+        assertEquals( "", Strings.utf8ToString(syncRequestValue.getCookie()) );
         assertEquals( false, syncRequestValue.isReloadHint() );
 
         // Check the encoding

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncStateValueControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncStateValueControlTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncStateValueControlTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncStateValueControlTest.java Mon Dec 20 14:31:29 2010
@@ -36,7 +36,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueControlContainer;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueControlDecoder;
 import org.apache.directory.shared.ldap.message.control.replication.SyncStateTypeEnum;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -85,8 +84,8 @@ public class SyncStateValueControlTest
 
         SyncStateValueControl syncStateValue = container.getSyncStateValueControl();
         assertEquals( SyncStateTypeEnum.PRESENT, syncStateValue.getSyncStateType() );
-        assertEquals( "abc", StringTools.utf8ToString( syncStateValue.getEntryUUID() ) );
-        assertEquals( "xkcd", StringTools.utf8ToString( syncStateValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncStateValue.getEntryUUID()) );
+        assertEquals( "xkcd", Strings.utf8ToString(syncStateValue.getCookie()) );
 
         // Check the encoding
         try
@@ -150,7 +149,7 @@ public class SyncStateValueControlTest
 
         SyncStateValueControl syncStateValue = container.getSyncStateValueControl();
         assertEquals( SyncStateTypeEnum.ADD, syncStateValue.getSyncStateType() );
-        assertEquals( "abc", StringTools.utf8ToString( syncStateValue.getEntryUUID() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncStateValue.getEntryUUID()) );
         assertNull( syncStateValue.getCookie() );
 
         // Check the encoding
@@ -216,8 +215,8 @@ public class SyncStateValueControlTest
 
         SyncStateValueControl syncStateValue = container.getSyncStateValueControl();
         assertEquals( SyncStateTypeEnum.MODIFY, syncStateValue.getSyncStateType() );
-        assertEquals( "abc", StringTools.utf8ToString( syncStateValue.getEntryUUID() ) );
-        assertEquals( "", StringTools.utf8ToString( syncStateValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncStateValue.getEntryUUID()) );
+        assertEquals( "", Strings.utf8ToString(syncStateValue.getCookie()) );
 
         // Check the encoding
         try
@@ -372,8 +371,8 @@ public class SyncStateValueControlTest
 
         SyncStateValueControl syncStateValue = container.getSyncStateValueControl();
         assertEquals( SyncStateTypeEnum.MODDN, syncStateValue.getSyncStateType() );
-        assertEquals( "abc", StringTools.utf8ToString( syncStateValue.getEntryUUID() ) );
-        assertEquals( "xkcd", StringTools.utf8ToString( syncStateValue.getCookie() ) );
+        assertEquals( "abc", Strings.utf8ToString(syncStateValue.getEntryUUID()) );
+        assertEquals( "xkcd", Strings.utf8ToString(syncStateValue.getCookie()) );
 
         // Check the encoding
         try

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestTest.java Mon Dec 20 14:31:29 2010
@@ -37,7 +37,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.ExtendedRequest;
 import org.apache.directory.shared.ldap.message.LdapEncoder;
 import org.apache.directory.shared.ldap.message.control.Control;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -99,7 +98,7 @@ public class ExtendedRequestTest
 
         assertEquals( 1, extendedRequest.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", extendedRequest.getRequestName() );
-        assertEquals( "value", StringTools.utf8ToString( extendedRequest.getRequestValue() ) );
+        assertEquals( "value", Strings.utf8ToString(extendedRequest.getRequestValue()) );
 
         // Check the encoding
         try
@@ -170,7 +169,7 @@ public class ExtendedRequestTest
 
         assertEquals( 1, extendedRequest.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", extendedRequest.getRequestName() );
-        assertEquals( "value", StringTools.utf8ToString( extendedRequest.getRequestValue() ) );
+        assertEquals( "value", Strings.utf8ToString(extendedRequest.getRequestValue()) );
 
         // Check the Control
         Map<String, Control> controls = extendedRequest.getControls();
@@ -251,7 +250,7 @@ public class ExtendedRequestTest
 
         assertEquals( 1, extendedRequest.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", extendedRequest.getRequestName() );
-        assertEquals( "", StringTools.utf8ToString( extendedRequest.getRequestValue() ) );
+        assertEquals( "", Strings.utf8ToString(extendedRequest.getRequestValue()) );
 
         // Check the Control
         Map<String, Control> controls = extendedRequest.getControls();
@@ -496,7 +495,7 @@ public class ExtendedRequestTest
 
         assertEquals( 1, extendedRequest.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", extendedRequest.getRequestName() );
-        assertEquals( "", StringTools.utf8ToString( extendedRequest.getRequestValue() ) );
+        assertEquals( "", Strings.utf8ToString(extendedRequest.getRequestValue()) );
 
         // Check the encoding
         try

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java Mon Dec 20 14:31:29 2010
@@ -38,7 +38,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.LdapEncoder;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.control.Control;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -111,7 +110,7 @@ public class ExtendedResponseTest
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "value", StringTools.utf8ToString( ( byte[] ) extendedResponse.getEncodedValue() ) );
+        assertEquals( "value", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
 
         // Check the encoding
         try
@@ -203,7 +202,7 @@ public class ExtendedResponseTest
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "value", StringTools.utf8ToString( ( byte[] ) extendedResponse.getEncodedValue() ) );
+        assertEquals( "value", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
 
         // Check the Control
         Map<String, Control> controls = extendedResponse.getControls();
@@ -573,7 +572,7 @@ public class ExtendedResponseTest
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "", StringTools.utf8ToString( ( byte[] ) extendedResponse.getEncodedValue() ) );
+        assertEquals( "", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
 
         // Check the encoding
         try
@@ -660,7 +659,7 @@ public class ExtendedResponseTest
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "", StringTools.utf8ToString( ( byte[] ) extendedResponse.getEncodedValue() ) );
+        assertEquals( "", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
 
         // Check the Control
         Map<String, Control> controls = extendedResponse.getControls();
@@ -752,7 +751,7 @@ public class ExtendedResponseTest
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "", StringTools.utf8ToString( ( byte[] ) extendedResponse.getEncodedValue() ) );
+        assertEquals( "", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
 
         // Check the encoding
         try
@@ -840,7 +839,7 @@ public class ExtendedResponseTest
         assertEquals( "", extendedResponse.getLdapResult().getMatchedDn().getName() );
         assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         assertEquals( "1.3.6.1.5.5.2", extendedResponse.getID() );
-        assertEquals( "", StringTools.utf8ToString( ( byte[] ) extendedResponse.getEncodedValue() ) );
+        assertEquals( "", Strings.utf8ToString((byte[]) extendedResponse.getEncodedValue()) );
 
         // Check the Control
         Map<String, Control> controls = extendedResponse.getControls();

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java Mon Dec 20 14:31:29 2010
@@ -36,7 +36,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.extended.operations.storedProcedure.StoredProcedureContainer;
 import org.apache.directory.shared.ldap.codec.extended.operations.storedProcedure.StoredProcedureDecoder;
 import org.apache.directory.shared.ldap.codec.extended.operations.storedProcedure.StoredProcedure.StoredProcedureParameter;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -96,24 +95,24 @@ public class StoredProcedureTest
 
         assertEquals("Java", storedProcedure.getLanguage());
         
-        assertEquals( "execute", StringTools.utf8ToString( storedProcedure.getProcedure() ) );
+        assertEquals( "execute", Strings.utf8ToString(storedProcedure.getProcedure()) );
 
         assertEquals( 3, storedProcedure.getParameters().size() );
 
         StoredProcedureParameter param = storedProcedure.getParameters().get( 0 );
 
-        assertEquals( "int", StringTools.utf8ToString( param.getType() ) );
+        assertEquals( "int", Strings.utf8ToString(param.getType()) );
         assertEquals( 1, param.getValue()[0] );
 
         param = storedProcedure.getParameters().get( 1 );
 
-        assertEquals( "boolean", StringTools.utf8ToString( param.getType() ) );
-        assertEquals( "true", StringTools.utf8ToString( param.getValue() ) );
+        assertEquals( "boolean", Strings.utf8ToString(param.getType()) );
+        assertEquals( "true", Strings.utf8ToString(param.getValue()) );
 
         param = storedProcedure.getParameters().get( 2 );
 
-        assertEquals( "String", StringTools.utf8ToString( param.getType() ) );
-        assertEquals( "parameter3", StringTools.utf8ToString( param.getValue() ) );
+        assertEquals( "String", Strings.utf8ToString(param.getType()) );
+        assertEquals( "parameter3", Strings.utf8ToString(param.getValue()) );
 
         // Check the encoding
         try
@@ -167,7 +166,7 @@ public class StoredProcedureTest
 
         assertEquals("Java", storedProcedure.getLanguage());
         
-        assertEquals( "execute", StringTools.utf8ToString( storedProcedure.getProcedure() ) );
+        assertEquals( "execute", Strings.utf8ToString(storedProcedure.getProcedure()) );
 
         assertEquals( 0, storedProcedure.getParameters().size() );
         
@@ -227,13 +226,13 @@ public class StoredProcedureTest
 
         assertEquals("Java", storedProcedure.getLanguage());
         
-        assertEquals( "execute", StringTools.utf8ToString( storedProcedure.getProcedure() ) );
+        assertEquals( "execute", Strings.utf8ToString(storedProcedure.getProcedure()) );
 
         assertEquals( 1, storedProcedure.getParameters().size() );
 
         StoredProcedureParameter param = storedProcedure.getParameters().get( 0 );
 
-        assertEquals( "int", StringTools.utf8ToString( param.getType() ) );
+        assertEquals( "int", Strings.utf8ToString(param.getType()) );
         assertEquals( 1, param.getValue()[0] );
 
         // Check the encoding

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseTest.java Mon Dec 20 14:31:29 2010
@@ -37,7 +37,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.IntermediateResponse;
 import org.apache.directory.shared.ldap.message.LdapEncoder;
 import org.apache.directory.shared.ldap.message.control.Control;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -99,7 +98,7 @@ public class IntermediateResponseTest
 
         assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", intermediateResponse.getResponseName() );
-        assertEquals( "value", StringTools.utf8ToString( intermediateResponse.getResponseValue() ) );
+        assertEquals( "value", Strings.utf8ToString(intermediateResponse.getResponseValue()) );
 
         // Check the encoding
         try
@@ -170,7 +169,7 @@ public class IntermediateResponseTest
 
         assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", intermediateResponse.getResponseName() );
-        assertEquals( "value", StringTools.utf8ToString( intermediateResponse.getResponseValue() ) );
+        assertEquals( "value", Strings.utf8ToString(intermediateResponse.getResponseValue()) );
 
         // Check the Control
         Map<String, Control> controls = intermediateResponse.getControls();
@@ -251,7 +250,7 @@ public class IntermediateResponseTest
 
         assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", intermediateResponse.getResponseName() );
-        assertEquals( "", StringTools.utf8ToString( intermediateResponse.getResponseValue() ) );
+        assertEquals( "", Strings.utf8ToString(intermediateResponse.getResponseValue()) );
 
         // Check the Control
         Map<String, Control> controls = intermediateResponse.getControls();
@@ -495,7 +494,7 @@ public class IntermediateResponseTest
 
         assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", intermediateResponse.getResponseName() );
-        assertEquals( "", StringTools.utf8ToString( intermediateResponse.getResponseValue() ) );
+        assertEquals( "", Strings.utf8ToString(intermediateResponse.getResponseValue()) );
 
         // Check the encoding
         try
@@ -558,7 +557,7 @@ public class IntermediateResponseTest
 
         assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "", intermediateResponse.getResponseName() );
-        assertEquals( "value", StringTools.utf8ToString( intermediateResponse.getResponseValue() ) );
+        assertEquals( "value", Strings.utf8ToString(intermediateResponse.getResponseValue()) );
 
         // Check the encoding
         try
@@ -621,7 +620,7 @@ public class IntermediateResponseTest
 
         assertEquals( 1, intermediateResponse.getMessageId() );
         assertEquals( "1.3.6.1.5.5.2", intermediateResponse.getResponseName() );
-        assertEquals( "", StringTools.utf8ToString( intermediateResponse.getResponseValue() ) );
+        assertEquals( "", Strings.utf8ToString(intermediateResponse.getResponseValue()) );
 
         // Check the encoding
         try

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java Mon Dec 20 14:31:29 2010
@@ -41,7 +41,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.Referral;
 import org.apache.directory.shared.ldap.message.SearchResultReference;
 import org.apache.directory.shared.ldap.message.control.Control;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -103,7 +102,7 @@ public class SearchResultReferenceTest
             stream.put( ( byte ) 0x04 );
             stream.put( ( byte ) ldapUrls[i].getBytes().length );
 
-            byte[] bytes = StringTools.getBytesUtf8( ldapUrls[i] );
+            byte[] bytes = Strings.getBytesUtf8(ldapUrls[i]);
 
             for ( int j = 0; j < bytes.length; j++ )
             {
@@ -136,7 +135,7 @@ public class SearchResultReferenceTest
 
         for ( int i = 0; i < ldapUrls.length; i++ )
         {
-            ldapUrlsSet.add( StringTools.utf8ToString( ldapUrls[i].getBytes() ) );
+            ldapUrlsSet.add( Strings.utf8ToString(ldapUrls[i].getBytes()) );
         }
 
         Referral referral = searchResultReference.getReferral();
@@ -267,7 +266,7 @@ public class SearchResultReferenceTest
 
         for ( int i = 0; i < ldapUrls.length; i++ )
         {
-            ldapUrlsSet.add( StringTools.utf8ToString( ldapUrls[i].getBytes() ) );
+            ldapUrlsSet.add( Strings.utf8ToString(ldapUrls[i].getBytes()) );
         }
 
         Referral referral = searchResultReference.getReferral();

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java Mon Dec 20 14:31:29 2010
@@ -35,7 +35,6 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsControl;
 import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsControlContainer;
 import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsControlDecoder;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.CharConstants;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
@@ -82,7 +81,7 @@ public class PagedSearchControlTest
 
         PagedResultsControl pagedSearch = container.getPagedSearchControl();
         assertEquals( 32, pagedSearch.getSize() );
-        assertTrue( Arrays.equals( StringTools.getBytesUtf8( "test" ), 
+        assertTrue( Arrays.equals( Strings.getBytesUtf8("test"),
             pagedSearch.getCookie() ) );
             
         bb.flip();
@@ -104,7 +103,7 @@ public class PagedSearchControlTest
 
         PagedResultsControl ctrl = new PagedResultsControl();
         ctrl.setSize( 32 );
-        ctrl.setCookie( StringTools.getBytesUtf8( "test" ) );
+        ctrl.setCookie( Strings.getBytesUtf8("test") );
 
         bb = ctrl.encode( ByteBuffer.allocate( ctrl.computeLength() ) );
         String decoded = Strings.dumpBytes(bb.array());
@@ -233,7 +232,7 @@ public class PagedSearchControlTest
 
         PagedResultsControl pagedSearch = container.getPagedSearchControl();
         assertEquals( Integer.MAX_VALUE, pagedSearch.getSize() );
-        assertTrue( Arrays.equals( StringTools.getBytesUtf8( "test" ), 
+        assertTrue( Arrays.equals( Strings.getBytesUtf8("test"),
             pagedSearch.getCookie() ) );
             
         bb.flip();
@@ -256,7 +255,7 @@ public class PagedSearchControlTest
 
         PagedResultsControl ctrl = new PagedResultsControl();
         ctrl.setSize( -1 );
-        ctrl.setCookie( StringTools.getBytesUtf8( "test" ) );
+        ctrl.setCookie( Strings.getBytesUtf8("test") );
 
         bb = ctrl.encode( ByteBuffer.allocate( ctrl.computeLength() ) );
         String decoded = Strings.dumpBytes(bb.array());

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/entry/BinaryValueAttributeTypeTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/entry/BinaryValueAttributeTypeTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/entry/BinaryValueAttributeTypeTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/entry/BinaryValueAttributeTypeTest.java Mon Dec 20 14:31:29 2010
@@ -45,6 +45,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schema.syntaxCheckers.OctetStringSyntaxChecker;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.CharConstants;
+import org.apache.directory.shared.util.Strings;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -562,8 +563,8 @@ public class BinaryValueAttributeTypeTes
      */
     @Test public void testNormalizedBinaryValueSerialization() throws LdapException, IOException, ClassNotFoundException
     {
-        byte[] v1 = StringTools.getBytesUtf8( "  Test   Test  " );
-        byte[] v1Norm = StringTools.getBytesUtf8( "Test   Test" );
+        byte[] v1 = Strings.getBytesUtf8("  Test   Test  ");
+        byte[] v1Norm = Strings.getBytesUtf8("Test   Test");
         
         // First check with a value which will be normalized
         BinaryValue sbv = new BinaryValue( at, v1 );
@@ -586,7 +587,7 @@ public class BinaryValueAttributeTypeTes
      */
     @Test public void testNormalizedBinarySameValueSerialization() throws LdapException, IOException, ClassNotFoundException
     {
-        byte[] v1 = StringTools.getBytesUtf8( "Test   Test" );
+        byte[] v1 = Strings.getBytesUtf8("Test   Test");
         
         // First check with a value which will be normalized
         BinaryValue sbv = new BinaryValue( at, v1 );
@@ -602,8 +603,8 @@ public class BinaryValueAttributeTypeTes
      */
     @Test public void testNoNormalizedBinaryValueSerialization() throws LdapException, IOException, ClassNotFoundException
     {
-        byte[] v1 = StringTools.getBytesUtf8( "test" );
-        byte[] v1Norm = StringTools.getBytesUtf8( "test" );
+        byte[] v1 = Strings.getBytesUtf8("test");
+        byte[] v1Norm = Strings.getBytesUtf8("test");
 
         // First check with a value which will be normalized
         BinaryValue sbv = new BinaryValue( at, v1 );
@@ -665,8 +666,8 @@ public class BinaryValueAttributeTypeTes
      */
     @Test public void testSameNormalizedBinaryValueSerialization() throws LdapException, IOException, ClassNotFoundException
     {
-        byte[] v1 = StringTools.getBytesUtf8( "test" );
-        byte[] v1Norm = StringTools.getBytesUtf8( "test" );
+        byte[] v1 = Strings.getBytesUtf8("test");
+        byte[] v1Norm = Strings.getBytesUtf8("test");
 
         // First check with a value which will be normalized
         BinaryValue sbv = new BinaryValue( at, v1 );

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttributeTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttributeTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttributeTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/entry/DefaultEntryAttributeTest.java Mon Dec 20 14:31:29 2010
@@ -40,8 +40,8 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.schema.syntaxCheckers.Ia5StringSyntaxChecker;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.CharConstants;
+import org.apache.directory.shared.util.Strings;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -1556,7 +1556,7 @@ public class DefaultEntryAttributeTest
     {
         DefaultEntryAttribute dca = new DefaultEntryAttribute( "UserPassword" );
         dca.setHR( false );
-        byte[] password = StringTools.getBytesUtf8( "secret" );
+        byte[] password = Strings.getBytesUtf8("secret");
         dca.add( password );
 
         DefaultEntryAttribute dcaSer = deserializeValue( serializeValue( dca ) );

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/entry/EntryTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/entry/EntryTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/entry/EntryTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/entry/EntryTest.java Mon Dec 20 14:31:29 2010
@@ -42,18 +42,11 @@ import java.util.Set;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.BinaryValue;
-import org.apache.directory.shared.ldap.entry.DefaultEntry;
-import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
-import org.apache.directory.shared.ldap.entry.StringValue;
-import org.apache.directory.shared.ldap.entry.Entry;
-import org.apache.directory.shared.ldap.entry.EntryAttribute;
-import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.normalizers.DeepTrimToLowerNormalizer;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.util.Strings;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -1280,7 +1273,7 @@ public class EntryTest
         
         dn.normalize( oids );
         
-        byte[] password = StringTools.getBytesUtf8( "secret" );
+        byte[] password = Strings.getBytesUtf8("secret");
         Entry entry = new DefaultEntry( dn);
         entry.add( "ObjectClass", "top", "person" );
         entry.add( "cn", "test1" );
@@ -1298,7 +1291,7 @@ public class EntryTest
     @Test
     public void testSerializeEntryWithNoDN() throws LdapException, IOException, ClassNotFoundException
     {
-        byte[] password = StringTools.getBytesUtf8( "secret" );
+        byte[] password = Strings.getBytesUtf8("secret");
         Entry entry = new DefaultEntry();
         entry.add( "ObjectClass", "top", "person" );
         entry.add( "cn", "test1" );

Modified: directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java?rev=1051130&r1=1051129&r2=1051130&view=diff
==============================================================================
--- directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java (original)
+++ directory/shared/branches/alex_refactoring/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java Mon Dec 20 14:31:29 2010
@@ -42,7 +42,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.message.control.Control;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.util.Strings;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -1530,7 +1529,7 @@ public class LdifReaderTest
 
         assertEquals( "1.2.840.113556.1.4.805", control.getOid() );
         assertFalse( control.isCritical() );
-        assertEquals( "control-value", StringTools.utf8ToString( control.getValue() ) );
+        assertEquals( "control-value", Strings.utf8ToString(control.getValue()) );
     }
 
 
@@ -1952,28 +1951,28 @@ public class LdifReaderTest
         
         assertEquals( "1.1.3", control.getOid() );
         assertFalse( control.isCritical() );
-        assertEquals( "ABCDEF", StringTools.utf8ToString( control.getValue() ) );
+        assertEquals( "ABCDEF", Strings.utf8ToString(control.getValue()) );
         
         // Forth control
         control = entry.getControl( "1.1.4" );
         
         assertEquals( "1.1.4", control.getOid() );
         assertTrue( control.isCritical() );
-        assertEquals( "ABCDEF", StringTools.utf8ToString( control.getValue() ) );
+        assertEquals( "ABCDEF", Strings.utf8ToString(control.getValue()) );
         
         // Fifth control
         control = entry.getControl( "1.1.5" );
         
         assertEquals( "1.1.5", control.getOid() );
         assertFalse( control.isCritical() );
-        assertEquals( "Emmanuel L\u00e9charny", StringTools.utf8ToString( control.getValue() ) );
+        assertEquals( "Emmanuel L\u00e9charny", Strings.utf8ToString(control.getValue()) );
         
         // Sixth control
         control = entry.getControl( "1.1.6" );
         
         assertEquals( "1.1.6", control.getOid() );
         assertTrue( control.isCritical() );
-        assertEquals( "Emmanuel L\u00e9charny", StringTools.utf8ToString( control.getValue() ) );
+        assertEquals( "Emmanuel L\u00e9charny", Strings.utf8ToString(control.getValue()) );
     }
     
     



Mime
View raw message