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 Sat, 13 Jul 2002 05:38:50 GMT
bayard      2002/07/12 22:38:50

  Modified:    lang/src/test/org/apache/commons/lang StringsTest.java
  Log:
  added defaultString tests
  
  Revision  Changes    Path
  1.13      +17 -1     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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- StringsTest.java	10 Jul 2002 22:35:29 -0000	1.12
  +++ StringsTest.java	13 Jul 2002 05:38:50 -0000	1.13
  @@ -78,6 +78,7 @@
       private static final String TEXT_LIST = "foo,bar,baz";
   
       private static final String FOO = "foo";
  +    private static final String BAR = "bar";
       private static final String CAP_FOO = "Foo";
       private static final String UPPER_FOO = "FOO";
   
  @@ -282,6 +283,21 @@
           assertEquals("reverseDelimitedString(String,' ') failed",
                        "once upon a time", 
                          Strings.reverseDelimitedString("time a upon once"," ") );
  +    }
  +
  +    public void testDefaultFunctions() {
  +        assertEquals("defaultString(empty-string) failed",
  +                     "", Strings.defaultString("") );
  +        assertEquals("defaultString(String) failed",
  +                     FOO, Strings.defaultString(FOO) );
  +        assertEquals("defaultString(null) failed",
  +                     "", Strings.defaultString(null) );
  +        assertEquals("defaultString(empty-string,String) failed",
  +                     "", Strings.defaultString("", BAR) );
  +        assertEquals("defaultString(String,String) failed",
  +                     FOO, Strings.defaultString(FOO, BAR) );
  +        assertEquals("defaultString(null,String) failed",
  +                     BAR, Strings.defaultString(null, BAR) );
       }
   }
   
  
  
  

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