X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Futil%2FStringUtilsTest.java;h=22324fc4983464909a68485a3d799e935045b567;hb=279c6495df1a0de231600a2d283098c7411c4730;hp=37506c03b79028ca169f7dd8e0bceb40821c6cd9;hpb=9135cbb74bbff06ea60485540194515ebcc018b0;p=jalview.git diff --git a/test/jalview/util/StringUtilsTest.java b/test/jalview/util/StringUtilsTest.java index 37506c0..22324fc 100644 --- a/test/jalview/util/StringUtilsTest.java +++ b/test/jalview/util/StringUtilsTest.java @@ -67,20 +67,23 @@ public class StringUtilsTest char[] c1 = "ABC".toCharArray(); // delete second position - assertTrue(Arrays.equals(new char[] { 'A', 'C' }, - StringUtils.deleteChars(c1, 1, 2))); + assertTrue( + Arrays.equals(new char[] + { 'A', 'C' }, StringUtils.deleteChars(c1, 1, 2))); // delete positions 1 and 2 - assertTrue(Arrays.equals(new char[] { 'C' }, - StringUtils.deleteChars(c1, 0, 2))); + assertTrue( + Arrays.equals(new char[] + { 'C' }, StringUtils.deleteChars(c1, 0, 2))); // delete positions 1-3 assertTrue(Arrays.equals(new char[] {}, StringUtils.deleteChars(c1, 0, 3))); // delete position 3 - assertTrue(Arrays.equals(new char[] { 'A', 'B' }, - StringUtils.deleteChars(c1, 2, 3))); + assertTrue( + Arrays.equals(new char[] + { 'A', 'B' }, StringUtils.deleteChars(c1, 2, 3))); // out of range deletion is ignore assertTrue(Arrays.equals(c1, StringUtils.deleteChars(c1, 3, 4))); @@ -116,8 +119,8 @@ public class StringUtilsTest * String delimited by | containing a quoted | (should not be treated as * delimiter) */ - assertEquals("[abc='|'d, ef, g]", Arrays.toString(StringUtils - .separatorListToArray("abc='|'d|ef|g", "|"))); + assertEquals("[abc='|'d, ef, g]", Arrays.toString( + StringUtils.separatorListToArray("abc='|'d|ef|g", "|"))); } @Test(groups = { "Functional" }) @@ -126,19 +129,19 @@ public class StringUtilsTest assertEquals("*", StringUtils.arrayToSeparatorList(null, "*")); assertEquals("*", StringUtils.arrayToSeparatorList(new String[] {}, "*")); - assertEquals( - "a*bc*cde", - StringUtils.arrayToSeparatorList(new String[] { "a", "bc", - "cde" }, "*")); - assertEquals( - "a*cde", - StringUtils.arrayToSeparatorList(new String[] { "a", null, - "cde" }, "*")); - assertEquals("a**cde", StringUtils.arrayToSeparatorList(new String[] { - "a", "", "cde" }, "*")); + assertEquals("a*bc*cde", + StringUtils.arrayToSeparatorList(new String[] + { "a", "bc", "cde" }, "*")); + assertEquals("a*cde", + StringUtils.arrayToSeparatorList(new String[] + { "a", null, "cde" }, "*")); + assertEquals("a**cde", + StringUtils.arrayToSeparatorList(new String[] + { "a", "", "cde" }, "*")); // delimiter within token is not (yet) escaped - assertEquals("a*b*c*cde", StringUtils.arrayToSeparatorList(new String[] - { "a", "b*c", "cde" }, "*")); + assertEquals("a*b*c*cde", + StringUtils.arrayToSeparatorList(new String[] + { "a", "b*c", "cde" }, "*")); } @Test(groups = { "Functional" }) @@ -151,7 +154,8 @@ public class StringUtilsTest assertEquals("now", StringUtils.listToDelimitedString(list, ";")); list.add("is"); assertEquals("now;is", StringUtils.listToDelimitedString(list, ";")); - assertEquals("now ; is", StringUtils.listToDelimitedString(list, " ; ")); + assertEquals("now ; is", + StringUtils.listToDelimitedString(list, " ; ")); list.add("the"); list.add("winter"); list.add("of"); @@ -199,7 +203,8 @@ public class StringUtilsTest assertEquals(-1, StringUtils.compareVersions("2.8.3", "2.9.2")); assertEquals(-1, StringUtils.compareVersions("2.8", "2.8.3")); assertEquals(-1, StringUtils.compareVersions("2.8.3", "2.8.3b1", "b")); - assertEquals(-1, StringUtils.compareVersions("2.8.3b1", "2.8.3b2", "b")); + assertEquals(-1, + StringUtils.compareVersions("2.8.3b1", "2.8.3b2", "b")); assertEquals(-1, StringUtils.compareVersions("2.8", "2.8.0", "b")); assertEquals(-1, StringUtils.compareVersions("2", "12")); assertEquals(-1, StringUtils.compareVersions("3.2.4", "3.12.11")); @@ -234,18 +239,18 @@ public class StringUtilsTest { assertNull(StringUtils.stripHtmlTags(null)); assertEquals("", StringUtils.stripHtmlTags("")); - assertEquals( - "label", - StringUtils - .stripHtmlTags("label")); + assertEquals("label", + StringUtils.stripHtmlTags( + "label")); // if no "" tag, < and > get html-encoded (not sure why) assertEquals("<a href=\"something\">label</href>", - StringUtils.stripHtmlTags("label")); + StringUtils + .stripHtmlTags("label")); // gets removed but not (is this intentional?) - assertEquals("hello", - StringUtils.stripHtmlTags("hello")); + assertEquals("hello", StringUtils + .stripHtmlTags("hello")); assertEquals("kdHydro < 12.53", StringUtils.stripHtmlTags("kdHydro < 12.53"));
hello", - StringUtils.stripHtmlTags("
hello")); + assertEquals("
hello", StringUtils + .stripHtmlTags("
hello")); assertEquals("kdHydro < 12.53", StringUtils.stripHtmlTags("kdHydro < 12.53"));