X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FJvSwingUtilsTest.java;fp=test%2Fjalview%2Fgui%2FJvSwingUtilsTest.java;h=214a3ad9c563954447939ea5c5c9bc09b47fe978;hp=61c5c9b9b42ff08414436a6210a688d57be7c4a5;hb=7d602d0e4b439e56af3e4551ed71f181a8025534;hpb=adcef27f5747b4e70e89a56c3735bc3afb8ce9bf diff --git a/test/jalview/gui/JvSwingUtilsTest.java b/test/jalview/gui/JvSwingUtilsTest.java index 61c5c9b..214a3ad 100644 --- a/test/jalview/gui/JvSwingUtilsTest.java +++ b/test/jalview/gui/JvSwingUtilsTest.java @@ -86,7 +86,12 @@ public class JvSwingUtilsTest JvSwingUtils.wrapTooltip(true, tip)); tip = "0123456789012345678901234567890123456789012345678901234567890"; // 61 - assertFalse(tip.equals(JvSwingUtils.wrapTooltip(false, 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 +105,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 +129,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); } }