X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FJvSwingUtilsTest.java;h=f1358d82a69e47d3f1b9328d48685969240f6669;hb=c96c7cbd9b1cf8b2f0c0715180e698f6c3f657d1;hp=1a16053fbd2ddd691f383c108901ebfac15671f6;hpb=c93b9ad2ebfab4cad4608a8890132918589576be;p=jalview.git
diff --git a/test/jalview/gui/JvSwingUtilsTest.java b/test/jalview/gui/JvSwingUtilsTest.java
index 1a16053..f1358d8 100644
--- a/test/jalview/gui/JvSwingUtilsTest.java
+++ b/test/jalview/gui/JvSwingUtilsTest.java
@@ -1,6 +1,27 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see
Made glorious summer by this sun of York";
+ assertEquals(tip, JvSwingUtils.wrapTooltip(false, tip));
+ assertEquals("" + tip + "",
+ JvSwingUtils.wrapTooltip(true, tip));
+ }
+
+ /**
+ * Test wrap tooltip where it is more than 60 characters long - word break and
+ * word wrap styling should be applied
+ */
+ @Test(groups = { "Functional" })
+ public void testWrapTooltip_longText()
+ {
+ 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)); + } }