X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FJvSwingUtilsTest.java;fp=test%2Fjalview%2Fgui%2FJvSwingUtilsTest.java;h=b185f53017d1e9ae449ffec5591af21141164d56;hb=d043ce47fc710d3eb2629ba926a8a7417bd67d8c;hp=e6f40419e809b2126ed254a9611e953404e5d23d;hpb=04c8f7bff663aa469127e9eed4164e02933782f1;p=jalview.git diff --git a/test/jalview/gui/JvSwingUtilsTest.java b/test/jalview/gui/JvSwingUtilsTest.java index e6f4041..b185f53 100644 --- a/test/jalview/gui/JvSwingUtilsTest.java +++ b/test/jalview/gui/JvSwingUtilsTest.java @@ -86,9 +86,13 @@ public class JvSwingUtilsTest JvSwingUtils.wrapTooltip(true, tip)); tip = "0123456789012345678901234567890123456789012345678901234567890"; // 61 - assertFalse(tip.equals(JvSwingUtils.wrapTooltip(false, tip))); - assertFalse(("" + tip + "") - .equals(JvSwingUtils.wrapTooltip(true, tip))); + // n/a -- message is too long for "false" +// +// assertFalse(tip.equals(JvSwingUtils.wrapTooltip(false, tip))); +// + + assertFalse(("" + tip + "").equals(JvSwingUtils + .wrapTooltip(true, tip))); } /** @@ -100,9 +104,21 @@ public class JvSwingUtilsTest public void testWrapTooltip_multilineShortText() { String tip = "Now is the winter of our discontent
Made glorious summer by this sun of York"; - assertEquals(tip, JvSwingUtils.wrapTooltip(false, tip)); - assertEquals("" + tip + "", - JvSwingUtils.wrapTooltip(true, tip)); + String tip2 = "Now is the winter of our discontent
Made glorious summer by this sun of York"; + +// BH not applicable in Jalview; "false" is only for when no
and only for short j2s2Discover messages +// +// String s = JvSwingUtils.wrapTooltip(false, tip); +// System.out.println("" + tip + ""); +// assertEquals(tip, s); + + String s; + s = JvSwingUtils.wrapTooltip(true, tip); + System.out.println(s); + assertEquals("" + tip + "", s); + s = JvSwingUtils.wrapTooltip(true, tip2); + System.out.println(s); + assertEquals("" + tip + "", s); } /** @@ -112,11 +128,13 @@ public class JvSwingUtilsTest @Test(groups = { "Functional" }) public void testWrapTooltip_longText() { + // BH should work in Java and JavaScript String tip = "Now is the winter of our discontent made glorious summer by this sun of York"; - String expected = "" - + "
" + tip + "
"; - assertEquals("" + expected + "", - JvSwingUtils.wrapTooltip(true, tip)); - assertEquals(expected, JvSwingUtils.wrapTooltip(false, tip)); + String expected = JvSwingUtils.HTML_PREFIX + tip + ""; + String s = JvSwingUtils.wrapTooltip(true, tip); + assertEquals(expected, s); + // BH not applicable in Jalview; "false" is only for when no
and only for short j2s2Discover messages +// s = JvSwingUtils.wrapTooltip(false, tip); +// assertEquals(expected, s); } }