X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=test%2Fjalview%2Fgui%2FJvSwingUtilsTest.java;h=fc186e5a5fe3775c2274acc25676e31ae3699acc;hb=f6bde21f2fba3f12afedd6486bc8326a63f1373f;hp=868fe38134e1f05932fd3d026de159faa3fac8df;hpb=3412b273e964fb1a9d22564b04a5f0c827ec2461;p=jalview.git
diff --git a/test/jalview/gui/JvSwingUtilsTest.java b/test/jalview/gui/JvSwingUtilsTest.java
index 868fe38..fc186e5 100644
--- a/test/jalview/gui/JvSwingUtilsTest.java
+++ b/test/jalview/gui/JvSwingUtilsTest.java
@@ -1,13 +1,36 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1)
+ * Copyright (C) 2015 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)); + } }