commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r905253 - in /commons/proper/lang/branches/LANG_2_X/src/test/java/org/apache/commons/lang: StringUtilsSubstringTest.java StringUtilsTest.java
Date Mon, 01 Feb 2010 11:11:50 GMT
Author: niallp
Date: Mon Feb  1 11:11:50 2010
New Revision: 905253

URL: http://svn.apache.org/viewvc?rev=905253&view=rev
Log:
Port test improvements to 2.x branch

Modified:
    commons/proper/lang/branches/LANG_2_X/src/test/java/org/apache/commons/lang/StringUtilsSubstringTest.java
    commons/proper/lang/branches/LANG_2_X/src/test/java/org/apache/commons/lang/StringUtilsTest.java

Modified: commons/proper/lang/branches/LANG_2_X/src/test/java/org/apache/commons/lang/StringUtilsSubstringTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/test/java/org/apache/commons/lang/StringUtilsSubstringTest.java?rev=905253&r1=905252&r2=905253&view=diff
==============================================================================
--- commons/proper/lang/branches/LANG_2_X/src/test/java/org/apache/commons/lang/StringUtilsSubstringTest.java
(original)
+++ commons/proper/lang/branches/LANG_2_X/src/test/java/org/apache/commons/lang/StringUtilsSubstringTest.java
Mon Feb  1 11:11:50 2010
@@ -247,6 +247,8 @@
             
     public void testSubstringBetween_StringStringString() {
         assertEquals(null, StringUtils.substringBetween(null, "", ""));
+        assertEquals(null, StringUtils.substringBetween("", null, ""));
+        assertEquals(null, StringUtils.substringBetween("", "", null));
         assertEquals("", StringUtils.substringBetween("", "", ""));
         assertEquals("", StringUtils.substringBetween("foo", "", ""));
         assertEquals(null, StringUtils.substringBetween("foo", "", "]"));

Modified: commons/proper/lang/branches/LANG_2_X/src/test/java/org/apache/commons/lang/StringUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/branches/LANG_2_X/src/test/java/org/apache/commons/lang/StringUtilsTest.java?rev=905253&r1=905252&r2=905253&view=diff
==============================================================================
--- commons/proper/lang/branches/LANG_2_X/src/test/java/org/apache/commons/lang/StringUtilsTest.java
(original)
+++ commons/proper/lang/branches/LANG_2_X/src/test/java/org/apache/commons/lang/StringUtilsTest.java
Mon Feb  1 11:11:50 2010
@@ -448,7 +448,7 @@
         String stringToSplitOnNulls = "ab   de fg" ;
         String[] splitOnNullExpectedResults = { "ab", "de", "fg" } ;
 
-        String[] splitOnNullResults = StringUtils.splitByWholeSeparator( "ab   de fg", null
) ;
+        String[] splitOnNullResults = StringUtils.splitByWholeSeparator( stringToSplitOnNulls,
null ) ;
         assertEquals( splitOnNullExpectedResults.length, splitOnNullResults.length ) ;
         for ( int i = 0 ; i < splitOnNullExpectedResults.length ; i+= 1 ) {
             assertEquals( splitOnNullExpectedResults[i], splitOnNullResults[i] ) ;
@@ -760,7 +760,6 @@
           String[] results = null;
           String[] expectedResults = {"ab", "  de fg"};
           results = StringUtils.splitPreserveAllTokens("ab   de fg", null, 2);
-          System.out.println("");
           assertEquals(expectedResults.length, results.length);
           for (int i = 0; i < expectedResults.length; i++) {
               assertEquals(expectedResults[i], results[i]);
@@ -1827,7 +1826,8 @@
         assertEquals("removeEndIgnoreCase(\"domain.com\", null)", StringUtils.removeEndIgnoreCase("domain.com",
null), "domain.com");   
 
         // Case insensitive:
-        assertEquals("removeEndIgnoreCase(\"www.domain.com\", \".com\")", StringUtils.removeEndIgnoreCase("www.domain.com",
".COM"), "www.domain");
+        assertEquals("removeEndIgnoreCase(\"www.domain.com\", \".COM\")", StringUtils.removeEndIgnoreCase("www.domain.com",
".COM"), "www.domain");
+        assertEquals("removeEndIgnoreCase(\"www.domain.COM\", \".com\")", StringUtils.removeEndIgnoreCase("www.domain.COM",
".com"), "www.domain");
     }
 
     public void testRemove_String() {



Mime
View raw message