commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject [1/2] [lang] StringUtilsEqualsIndexOfTest: fix checkstyle violations
Date Sun, 19 Mar 2017 09:33:37 GMT
Repository: commons-lang
Updated Branches:
  refs/heads/master 27d3d40f7 -> e702828e7


StringUtilsEqualsIndexOfTest: fix checkstyle violations


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

Branch: refs/heads/master
Commit: 99900ae089cf996bc969f0673349c06c2e6fbf1d
Parents: 27d3d40
Author: pascalschumacher <pascalschumacher@gmx.net>
Authored: Sun Mar 19 10:31:21 2017 +0100
Committer: pascalschumacher <pascalschumacher@gmx.net>
Committed: Sun Mar 19 10:31:21 2017 +0100

----------------------------------------------------------------------
 .../lang3/StringUtilsEqualsIndexOfTest.java     | 73 +++++++++-----------
 1 file changed, 33 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/99900ae0/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
index 4635a54..91c0451 100644
--- a/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
+++ b/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java
@@ -297,25 +297,24 @@ public class StringUtilsEqualsIndexOfTest  {
         
         //LANG-1300 tests go here
         final int CODE_POINT = 0x2070E;
-    	StringBuilder builder = new StringBuilder();
-    	builder.appendCodePoint(CODE_POINT);
-    	assertEquals(0, StringUtils.indexOf(builder, CODE_POINT, 0));
-    	assertEquals(0, StringUtils.indexOf(builder.toString(), CODE_POINT, 0));
-    	builder.appendCodePoint(CODE_POINT);
-    	assertEquals(2, StringUtils.indexOf(builder, CODE_POINT, 1));
-    	assertEquals(2, StringUtils.indexOf(builder.toString(), CODE_POINT, 1));
-    	//inner branch on the supplementary character block
-    	char[] tmp = {(char) 55361};
-    	builder = new StringBuilder();
-    	builder.append(tmp);
-    	assertEquals(-1, StringUtils.indexOf(builder, CODE_POINT, 0));
-    	assertEquals(-1, StringUtils.indexOf(builder.toString(), CODE_POINT, 0));
-    	builder.appendCodePoint(CODE_POINT);
-    	assertEquals(1, StringUtils.indexOf(builder, CODE_POINT, 0));
-    	assertEquals(1, StringUtils.indexOf(builder.toString(), CODE_POINT, 0));
-    	assertEquals(-1, StringUtils.indexOf(builder, CODE_POINT, 2));
+        StringBuilder builder = new StringBuilder();
+        builder.appendCodePoint(CODE_POINT);
+        assertEquals(0, StringUtils.indexOf(builder, CODE_POINT, 0));
+        assertEquals(0, StringUtils.indexOf(builder.toString(), CODE_POINT, 0));
+        builder.appendCodePoint(CODE_POINT);
+        assertEquals(2, StringUtils.indexOf(builder, CODE_POINT, 1));
+        assertEquals(2, StringUtils.indexOf(builder.toString(), CODE_POINT, 1));
+        // inner branch on the supplementary character block
+        char[] tmp = { (char) 55361 };
+        builder = new StringBuilder();
+        builder.append(tmp);
+        assertEquals(-1, StringUtils.indexOf(builder, CODE_POINT, 0));
+        assertEquals(-1, StringUtils.indexOf(builder.toString(), CODE_POINT, 0));
+        builder.appendCodePoint(CODE_POINT);
+        assertEquals(1, StringUtils.indexOf(builder, CODE_POINT, 0));
+        assertEquals(1, StringUtils.indexOf(builder.toString(), CODE_POINT, 0));
+        assertEquals(-1, StringUtils.indexOf(builder, CODE_POINT, 2));
         assertEquals(-1, StringUtils.indexOf(builder.toString(), CODE_POINT, 2));
-        
     }
 
     @Test
@@ -453,7 +452,6 @@ public class StringUtilsEqualsIndexOfTest  {
         assertEquals(0, StringUtils.indexOfAnyBut("zzabyycdxx", 'b','y'));
         assertEquals(-1, StringUtils.indexOfAnyBut("aba", 'a', 'b'));
         assertEquals(0, StringUtils.indexOfAnyBut("aba", 'z'));
-
     }
 
     @Test
@@ -550,30 +548,26 @@ public class StringUtilsEqualsIndexOfTest  {
         
         //LANG-1300 addition test
         final int CODE_POINT = 0x2070E;
-    	StringBuilder builder = new StringBuilder();
-    	builder.appendCodePoint(CODE_POINT);
-    	assertEquals(0, StringUtils.lastIndexOf(builder, CODE_POINT, 0));
-    	builder.appendCodePoint(CODE_POINT);
-    	assertEquals(0, StringUtils.lastIndexOf(builder, CODE_POINT, 0));
-    	assertEquals(0, StringUtils.lastIndexOf(builder, CODE_POINT, 1));
+        StringBuilder builder = new StringBuilder();
+        builder.appendCodePoint(CODE_POINT);
+        assertEquals(0, StringUtils.lastIndexOf(builder, CODE_POINT, 0));
+        builder.appendCodePoint(CODE_POINT);
+        assertEquals(0, StringUtils.lastIndexOf(builder, CODE_POINT, 0));
+        assertEquals(0, StringUtils.lastIndexOf(builder, CODE_POINT, 1));
         assertEquals(2, StringUtils.lastIndexOf(builder, CODE_POINT, 2));
 
-
-
-    	builder.append("aaaaa");
-    	assertEquals(2, StringUtils.lastIndexOf(builder, CODE_POINT, 4));
-    	//inner branch on the supplementary character block
-    	char[] tmp = {(char) 55361};
-    	builder = new StringBuilder();
-    	builder.append(tmp);
-    	assertEquals(-1, StringUtils.lastIndexOf(builder, CODE_POINT, 0));
-    	builder.appendCodePoint(CODE_POINT);
-    	assertEquals(-1, StringUtils.lastIndexOf(builder, CODE_POINT, 0 ));
+        builder.append("aaaaa");
+        assertEquals(2, StringUtils.lastIndexOf(builder, CODE_POINT, 4));
+        // inner branch on the supplementary character block
+        char[] tmp = { (char) 55361 };
+        builder = new StringBuilder();
+        builder.append(tmp);
+        assertEquals(-1, StringUtils.lastIndexOf(builder, CODE_POINT, 0));
+        builder.appendCodePoint(CODE_POINT);
+        assertEquals(-1, StringUtils.lastIndexOf(builder, CODE_POINT, 0));
         assertEquals(1, StringUtils.lastIndexOf(builder, CODE_POINT, 1 ));
         assertEquals(-1, StringUtils.lastIndexOf(builder.toString(), CODE_POINT, 0));
         assertEquals(1, StringUtils.lastIndexOf(builder.toString(), CODE_POINT, 1));
-
-
     }
 
     @Test
@@ -786,9 +780,8 @@ public class StringUtilsEqualsIndexOfTest  {
         assertEquals(2, StringUtils.ordinalIndexOf("abababab", "abab", 2));
         assertEquals(4, StringUtils.ordinalIndexOf("abababab", "abab", 3));
         assertEquals(-1, StringUtils.ordinalIndexOf("abababab", "abab", 4));
-
     }
-    
+
     @Test
     public void testLANG1193() {
         assertEquals(0, StringUtils.ordinalIndexOf("abc", "ab", 1));        


Mime
View raw message