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-sandbox/lang/src/test/org/apache/commons/lang StringsTest.java
Date Tue, 09 Jul 2002 07:17:58 GMT
bayard      2002/07/09 00:17:58

  Modified:    lang/src/test/org/apache/commons/lang StringsTest.java
  Log:
  Added in tests for reverse, reverseDelimitedString, upperCase, lowerCase
  and swapCase.
  
  Revision  Changes    Path
  1.11      +34 -2     jakarta-commons-sandbox/lang/src/test/org/apache/commons/lang/StringsTest.java
  
  Index: StringsTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/lang/src/test/org/apache/commons/lang/StringsTest.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- StringsTest.java	9 Jul 2002 06:53:18 -0000	1.10
  +++ StringsTest.java	9 Jul 2002 07:17:58 -0000	1.11
  @@ -107,7 +107,7 @@
   
       //-----------------------------------------------------------------------
   
  -    public void testCapitalizeFunctions()
  +    public void testCaseFunctions()
       {
           assertEquals("capitalise(String) failed",
                        CAP_FOO, Strings.capitalise(FOO) );
  @@ -121,6 +121,22 @@
                        FOO, Strings.uncapitalise(CAP_FOO) );
           assertEquals("uncapitalise(empty-string) failed",
                        "", Strings.uncapitalise("") );
  +
  +        assertEquals("upperCase(String) failed",
  +                     "FOO TEST THING", Strings.upperCase("fOo test THING") );
  +        assertEquals("upperCase(empty-string) failed",
  +                     "", Strings.upperCase("") );
  +        assertEquals("lowerCase(String) failed",
  +                     "foo test thing", Strings.lowerCase("fOo test THING") );
  +        assertEquals("lowerCase(empty-string) failed",
  +                     "", Strings.lowerCase("") );
  +
  +        assertEquals("swapCase(empty-string) failed",
  +                     "", Strings.swapCase("") );
  +        assertEquals("swapCase(String-with-numbers) failed",
  +                     "a123RgYu", Strings.swapCase("A123rGyU") );
  +        assertEquals("swapCase(String) failed",
  +                     "Hello aPACHE", Strings.swapCase("hELLO Apache") );
       }
   
       public void testJoin()
  @@ -250,6 +266,22 @@
           String iso = Strings.convertUnicodeToNative(unicode, "iso-2022-jp");
           assertEquals("Unicode conversions failed", input, iso);
   */
  +    }
  +
  +    public void testReverseFunctions() {
  +        assertEquals("reverse(String) failed",
  +                     "sdrawkcab", Strings.reverse("backwards") );
  +        assertEquals("reverse(empty-string) failed",
  +                     "", Strings.reverse("") );
  +        assertEquals("reverseDelimitedString(String,'.') failed",
  +                     "org.apache.test", 
  +                       Strings.reverseDelimitedString("test.apache.org", ".") );
  +        assertEquals("reverseDelimitedString(empty-string,'.') failed",
  +                     "", 
  +                       Strings.reverseDelimitedString("", ".") );
  +        assertEquals("reverseDelimitedString(String,' ') failed",
  +                     "once upon a time", 
  +                       Strings.reverseDelimitedString("time a upon once"," ") );
       }
   }
   
  
  
  

--
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