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()
{
public void testWrapTooltip_longText()
{
String tip = "Now is the winter of our discontent made glorious summer by this sun of York";
- String expected = "<style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">"
- + tip + "</p>";
+ String expected = "<style> div.ttip {width:350px;white-space:pre-wrap;padding:2px;overflow-wrap:break-word;}</style>"
+ + "<div class=\"ttip\">" + tip + " </div>";
assertEquals("<html>" + expected + "</html>",
JvSwingUtils.wrapTooltip(true, tip));
assertEquals(expected, JvSwingUtils.wrapTooltip(false, tip));