You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ba...@apache.org on 2011/04/07 06:04:26 UTC
svn commit: r1089725 - in
/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3:
StringUtilsStartsEndsWithTest.java StringUtilsTest.java
Author: bayard
Date: Thu Apr 7 04:04:26 2011
New Revision: 1089725
URL: http://svn.apache.org/viewvc?rev=1089725&view=rev
Log:
Added CharSequence endsWithAny and startsWithAny tests
Modified:
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsStartsEndsWithTest.java
commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsStartsEndsWithTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsStartsEndsWithTest.java?rev=1089725&r1=1089724&r2=1089725&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsStartsEndsWithTest.java (original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsStartsEndsWithTest.java Thu Apr 7 04:04:26 2011
@@ -17,6 +17,7 @@
package org.apache.commons.lang3;
import junit.framework.TestCase;
+import org.apache.commons.lang3.text.StrBuilder;
/**
* Unit tests {@link org.apache.commons.lang3.StringUtils} - StartsWith/EndsWith methods
@@ -144,6 +145,8 @@ public class StringUtilsStartsEndsWithTe
assertTrue("StringUtils.endsWithAny(abcxyz, new String[] {null, xyz, abc})", StringUtils.endsWithAny("abcxyz", new String[] {null, "xyz", "abc"}));
assertFalse("StringUtils.endsWithAny(defg, new String[] {null, xyz, abc})", StringUtils.endsWithAny("defg", new String[] {null, "xyz", "abc"}));
+ assertTrue("StringUtils.endsWithAny(abcxyz, StringBuilder(abc), StringBuffer(xyz))", StringUtils.endsWithAny("abcxyz", new StringBuilder("abc"), new StringBuffer("xyz")));
+ assertTrue("StringUtils.endsWithAny( StrBuilder(abcxyz), StringBuilder(abc), StringBuffer(xyz))", StringUtils.endsWithAny( new StrBuilder("abcxyz"), new StringBuilder("abc"), new StringBuffer("xyz")));
}
Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java?rev=1089725&r1=1089724&r2=1089725&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringUtilsTest.java Thu Apr 7 04:04:26 2011
@@ -26,6 +26,7 @@ import java.util.Locale;
import junit.framework.TestCase;
+import org.apache.commons.lang3.text.StrBuilder;
import org.apache.commons.lang3.text.WordUtils;
/**
@@ -1871,6 +1872,9 @@ public class StringUtilsTest extends Tes
assertTrue(StringUtils.startsWithAny("abcxyz", "abc"));
assertTrue(StringUtils.startsWithAny("abcxyz", null, "xyz", "abc"));
assertFalse(StringUtils.startsWithAny("abcxyz", null, "xyz", "abcd"));
+
+ assertTrue("StringUtils.startsWithAny(abcxyz, StringBuilder(xyz), StringBuffer(abc))", StringUtils.startsWithAny("abcxyz", new StringBuilder("xyz"), new StringBuffer("abc")));
+ assertTrue("StringUtils.startsWithAny( StrBuilder(abcxyz), StringBuilder(xyz), StringBuffer(abc))", StringUtils.startsWithAny( new StrBuilder("abcxyz"), new StringBuilder("xyz"), new StringBuffer("abc")));
}
public void testNormalizeSpace() {