X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FJvSwingUtilsTest.java;h=e6f40419e809b2126ed254a9611e953404e5d23d;hb=31aca2e9990ff33e088faa41419bb60014a6fbcf;hp=8a8cba21609f6e8c9a5e457ea0fce17e8ec8a6ed;hpb=c19d2a91ca05e052e3408bf5852d88eb5d0608f1;p=jalview.git diff --git a/test/jalview/gui/JvSwingUtilsTest.java b/test/jalview/gui/JvSwingUtilsTest.java index 8a8cba2..e6f4041 100644 --- a/test/jalview/gui/JvSwingUtilsTest.java +++ b/test/jalview/gui/JvSwingUtilsTest.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2) - * Copyright (C) 2015 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -25,11 +25,19 @@ import static org.testng.AssertJUnit.assertFalse; import javax.swing.JScrollBar; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class JvSwingUtilsTest { + @BeforeClass(alwaysRun = true) + public void setUpJvOptionPane() + { + JvOptionPane.setInteractiveMode(false); + JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); + } + @Test(groups = { "Functional" }) public void testGetScrollBarProportion() { @@ -79,8 +87,8 @@ public class JvSwingUtilsTest tip = "0123456789012345678901234567890123456789012345678901234567890"; // 61 assertFalse(tip.equals(JvSwingUtils.wrapTooltip(false, tip))); - assertFalse(("" + tip + "").equals(JvSwingUtils - .wrapTooltip(true, tip))); + assertFalse(("" + tip + "") + .equals(JvSwingUtils.wrapTooltip(true, tip))); } /** @@ -105,8 +113,8 @@ public class JvSwingUtilsTest public void testWrapTooltip_longText() { String tip = "Now is the winter of our discontent made glorious summer by this sun of York"; - String expected = "

" - + tip + "

"; + String expected = "" + + "
" + tip + "
"; assertEquals("" + expected + "", JvSwingUtils.wrapTooltip(true, tip)); assertEquals(expected, JvSwingUtils.wrapTooltip(false, tip));