commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang CharSetUtilsTest.java StringUtilsTrimEmptyTest.java
Date Sun, 21 Jul 2002 20:19:50 GMT
bayard      2002/07/21 13:19:50

  Modified:    lang/src/java/org/apache/commons/lang CharSetUtils.java
                        StringUtils.java
               lang/src/test/org/apache/commons/lang CharSetUtilsTest.java
                        StringUtilsTrimEmptyTest.java
  Log:
  Moved deleteWhitespace from CharSetUtils to StringUtils.
  
  Revision  Changes    Path
  1.3       +1 -10     jakarta-commons/lang/src/java/org/apache/commons/lang/CharSetUtils.java
  
  Index: CharSetUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/CharSetUtils.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CharSetUtils.java	21 Jul 2002 20:14:14 -0000	1.2
  +++ CharSetUtils.java	21 Jul 2002 20:19:50 -0000	1.3
  @@ -160,15 +160,6 @@
       }
   
       /**
  -     * Deletes all whitespace from a String.
  -     *
  -     * @param str  String target to delete whitespace from
  -     */
  -    public static String deleteWhitespace(String str) {
  -        return delete(str, " \t\r\n\b" );
  -    }
  -
  -    /**
        * Takes an argument in set-syntax, see evaluateSet,
        * and deletes any of characters present in the specified string.
        * An example would be:   delete("hello", {"c-f","o"}) returns "hll"
  
  
  
  1.3       +10 -1     jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java
  
  Index: StringUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StringUtils.java	19 Jul 2002 04:04:45 -0000	1.2
  +++ StringUtils.java	21 Jul 2002 20:19:50 -0000	1.3
  @@ -123,6 +123,15 @@
       }
   
       /**
  +     * Deletes all whitespace from a String.
  +     *
  +     * @param str  String target to delete whitespace from
  +     */
  +    public static String deleteWhitespace(String str) {
  +        return CharSetUtils.delete(str, " \t\r\n\b" );
  +    }
  +
  +    /**
        * Checks if a String is non null and is not empty (length > 0).
        *
        * @param str  the string to check
  
  
  
  1.3       +1 -3      jakarta-commons/lang/src/test/org/apache/commons/lang/CharSetUtilsTest.java
  
  Index: CharSetUtilsTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/CharSetUtilsTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CharSetUtilsTest.java	21 Jul 2002 20:14:14 -0000	1.2
  +++ CharSetUtilsTest.java	21 Jul 2002 20:19:50 -0000	1.3
  @@ -135,8 +135,6 @@
                        "", CharSetUtils.delete("hello", new String[] {"a-z"}));
           assertEquals("delete(String,String[]) failed",
                        "heo", CharSetUtils.delete("hello", new String[] {"l"}));
  -        assertEquals("deleteWhitespace(String) failed",
  -                     "test", CharSetUtils.deleteWhitespace("t  \t\ne\rs\n\n   \tt"));
       }
   }
   
  
  
  
  1.4       +10 -1     jakarta-commons/lang/src/test/org/apache/commons/lang/StringUtilsTrimEmptyTest.java
  
  Index: StringUtilsTrimEmptyTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/StringUtilsTrimEmptyTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StringUtilsTrimEmptyTest.java	19 Jul 2002 04:05:57 -0000	1.3
  +++ StringUtilsTrimEmptyTest.java	21 Jul 2002 20:19:50 -0000	1.4
  @@ -122,6 +122,15 @@
           assertEquals(true, StringUtils.isEmpty(null));
       }
   
  +    public void testDeleteWhitespace() {
  +        assertEquals("deleteWhitespace(String) failed",
  +                     "", StringUtils.deleteWhitespace(""));
  +        assertEquals("deleteWhitespace(String) failed",
  +                     "", StringUtils.deleteWhitespace("    \t\t\n\n   "));
  +        assertEquals("deleteWhitespace(String) failed",
  +                     "test", StringUtils.deleteWhitespace("t  \t\ne\rs\n\n   \tt"));
  +    }
  +
       public void testStrip() {
           // it's important that foo2Space is fooLeftSpace and fooRightSpace 
           // merged together. So same number of spaces to left as fLS and same 
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message