From 473359a5cc15b0f24987eb738bb61b6a6396bc71 Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Thu, 7 Apr 2011 04:05:57 +0000 Subject: [PATCH] Moving a startsWith test to the right test class git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1089726 13f79535-47bb-0310-9956-ffa450edef68 --- .../lang3/StringUtilsStartsEndsWithTest.java | 13 +++++++++++++ .../org/apache/commons/lang3/StringUtilsTest.java | 14 -------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsStartsEndsWithTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsStartsEndsWithTest.java index 9d6a3c478..27d7b09ee 100644 --- a/src/test/java/org/apache/commons/lang3/StringUtilsStartsEndsWithTest.java +++ b/src/test/java/org/apache/commons/lang3/StringUtilsStartsEndsWithTest.java @@ -84,6 +84,19 @@ public class StringUtilsStartsEndsWithTest extends TestCase { assertFalse("startsWithIgnoreCase(FOOBAR, bar)", StringUtils.startsWithIgnoreCase(FOOBAR, bar)); } + public void testStartsWithAny() { + assertFalse(StringUtils.startsWithAny(null, (String[])null)); + assertFalse(StringUtils.startsWithAny(null, "abc")); + assertFalse(StringUtils.startsWithAny("abcxyz", (String[])null)); + assertFalse(StringUtils.startsWithAny("abcxyz")); + 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"))); + } + /** * Test StringUtils.endsWith() diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java index c4073db6e..5e2aa479b 100644 --- a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java @@ -26,7 +26,6 @@ import java.util.Locale; import junit.framework.TestCase; -import org.apache.commons.lang3.text.StrBuilder; import org.apache.commons.lang3.text.WordUtils; /** @@ -1864,19 +1863,6 @@ public class StringUtilsTest extends TestCase { assertEquals("i am a ", StringUtils.getCommonPrefix("i am a machine", "i am a robot")); } - public void testStartsWithAny() { - assertFalse(StringUtils.startsWithAny(null, (String[])null)); - assertFalse(StringUtils.startsWithAny(null, "abc")); - assertFalse(StringUtils.startsWithAny("abcxyz", (String[])null)); - assertFalse(StringUtils.startsWithAny("abcxyz")); - 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() { assertEquals(null, StringUtils.normalizeSpace(null)); assertEquals("", StringUtils.normalizeSpace(""));