commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [1/2] [lang] Split tests up according to methods tested
Date Fri, 12 Jun 2015 16:38:09 GMT
Repository: commons-lang
Updated Branches:
  refs/heads/master f37f4b68f -> 5f479e70c


Split tests up according to methods tested

Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/0822b422
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/0822b422
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/0822b422

Branch: refs/heads/master
Commit: 0822b4226f31e50ec244d311e56e3446a8e5811f
Parents: f37f4b6
Author: Sebb <sebb@apache.org>
Authored: Fri Jun 12 13:47:11 2015 +0100
Committer: Sebb <sebb@apache.org>
Committed: Fri Jun 12 13:47:11 2015 +0100

----------------------------------------------------------------------
 .../apache/commons/lang3/StringUtilsTest.java   | 64 ++++++++++++--------
 1 file changed, 38 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/0822b422/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
index a83eed6..90447e4 100644
--- a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
@@ -209,15 +209,37 @@ public class StringUtilsTest {
         assertTrue(StringUtils.isNoneBlank("foo", "bar"));
     }
 
-    //-----------------------------------------------------------------------
     @Test
-    public void testCaseFunctions() {
+    public void testUpperCase() {
         assertNull(StringUtils.upperCase(null));
         assertNull(StringUtils.upperCase(null, Locale.ENGLISH));
+        assertEquals("upperCase(String) failed",
+                "FOO TEST THING", StringUtils.upperCase("fOo test THING"));
+        assertEquals("upperCase(empty-string) failed",
+                "", StringUtils.upperCase(""));
+        assertEquals("upperCase(String, Locale) failed",
+                "FOO TEST THING", StringUtils.upperCase("fOo test THING", Locale.ENGLISH));
+        assertEquals("upperCase(empty-string, Locale) failed",
+                "", StringUtils.upperCase("", Locale.ENGLISH));
+    }
+
+    @Test
+    public void testLowerCase() {
         assertNull(StringUtils.lowerCase(null));
         assertNull(StringUtils.lowerCase(null, Locale.ENGLISH));
+        assertEquals("lowerCase(String) failed",
+                "foo test thing", StringUtils.lowerCase("fOo test THING"));
+        assertEquals("lowerCase(empty-string) failed",
+                "", StringUtils.lowerCase(""));
+        assertEquals("lowerCase(String, Locale) failed",
+                "foo test thing", StringUtils.lowerCase("fOo test THING", Locale.ENGLISH));
+        assertEquals("lowerCase(empty-string, Locale) failed",
+                "", StringUtils.lowerCase("", Locale.ENGLISH));
+    }
+
+    @Test
+    public void testCapitalize() {
         assertNull(StringUtils.capitalize(null));
-        assertNull(StringUtils.uncapitalize(null));
 
         assertEquals("capitalize(empty-string) failed",
                 "", StringUtils.capitalize(""));
@@ -227,6 +249,11 @@ public class StringUtilsTest {
                 FOO_CAP, StringUtils.capitalize(FOO_CAP));
         assertEquals("capitalize(string) failed",
                 FOO_CAP, StringUtils.capitalize(FOO_UNCAP));
+    }
+
+    @Test
+    public void testUnCapitalize() {
+        assertNull(StringUtils.uncapitalize(null));
 
         assertEquals("uncapitalize(String) failed",
                 FOO_UNCAP, StringUtils.uncapitalize(FOO_CAP));
@@ -237,6 +264,14 @@ public class StringUtilsTest {
         assertEquals("uncapitalize(single-char-string) failed",
                 "x", StringUtils.uncapitalize("X"));
 
+        // Examples from uncapitalize Javadoc
+        assertEquals("cat", StringUtils.uncapitalize("cat"));
+        assertEquals("cat", StringUtils.uncapitalize("Cat"));
+        assertEquals("cAT", StringUtils.uncapitalize("CAT"));
+    }
+
+    @Test
+    public void testReCapitalize() {
         // reflection type of tests: Sentences.
         assertEquals("uncapitalize(capitalize(String)) failed",
                 SENTENCE_UNCAP, StringUtils.uncapitalize(StringUtils.capitalize(SENTENCE_UNCAP)));
@@ -248,29 +283,6 @@ public class StringUtilsTest {
                 FOO_UNCAP, StringUtils.uncapitalize(StringUtils.capitalize(FOO_UNCAP)));
         assertEquals("capitalize(uncapitalize(String)) failed",
                 FOO_CAP, StringUtils.capitalize(StringUtils.uncapitalize(FOO_CAP)));
-
-        assertEquals("upperCase(String) failed",
-                "FOO TEST THING", StringUtils.upperCase("fOo test THING"));
-        assertEquals("upperCase(empty-string) failed",
-                "", StringUtils.upperCase(""));
-        assertEquals("lowerCase(String) failed",
-                "foo test thing", StringUtils.lowerCase("fOo test THING"));
-        assertEquals("lowerCase(empty-string) failed",
-                "", StringUtils.lowerCase(""));
-
-        assertEquals("upperCase(String, Locale) failed",
-                "FOO TEST THING", StringUtils.upperCase("fOo test THING", Locale.ENGLISH));
-        assertEquals("upperCase(empty-string, Locale) failed",
-                "", StringUtils.upperCase("", Locale.ENGLISH));
-        assertEquals("lowerCase(String, Locale) failed",
-                "foo test thing", StringUtils.lowerCase("fOo test THING", Locale.ENGLISH));
-        assertEquals("lowerCase(empty-string, Locale) failed",
-                "", StringUtils.lowerCase("", Locale.ENGLISH));
-
-        // Examples from uncapitalize Javadoc
-        assertEquals("cat", StringUtils.uncapitalize("cat"));
-        assertEquals("cat", StringUtils.uncapitalize("Cat"));
-        assertEquals("cAT", StringUtils.uncapitalize("CAT"));
     }
 
     @Test


Mime
View raw message