| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
package jalview.gui; |
| 22 |
|
|
| 23 |
|
import java.awt.Dimension; |
| 24 |
|
import java.awt.event.MouseAdapter; |
| 25 |
|
import java.awt.event.MouseEvent; |
| 26 |
|
|
| 27 |
|
import javax.swing.JDesktopPane; |
| 28 |
|
import javax.swing.JFrame; |
| 29 |
|
import javax.swing.JInternalFrame; |
| 30 |
|
import javax.swing.JTextArea; |
| 31 |
|
|
| 32 |
|
import org.testng.annotations.AfterClass; |
| 33 |
|
import org.testng.annotations.BeforeClass; |
| 34 |
|
import org.testng.annotations.Test; |
| 35 |
|
|
| 36 |
|
import jalview.bin.Console; |
| 37 |
|
|
| |
|
| 0% |
Uncovered Elements: 40 (40) |
Complexity: 8 |
Complexity Density: 0.26 |
|
| 38 |
|
public class JAL1353bugdemo |
| 39 |
|
{ |
| 40 |
|
|
| |
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 41 |
0 |
@BeforeClass(alwaysRun = true)... |
| 42 |
|
public void setUpJvOptionPane() |
| 43 |
|
{ |
| 44 |
0 |
JvOptionPane.setInteractiveMode(false); |
| 45 |
0 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
| 46 |
|
} |
| 47 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 48 |
0 |
@BeforeClass(alwaysRun = true)... |
| 49 |
|
public static void setUpBeforeClass() throws Exception |
| 50 |
|
{ |
| 51 |
|
} |
| 52 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 53 |
0 |
@AfterClass(alwaysRun = true)... |
| 54 |
|
public static void tearDownAfterClass() throws Exception |
| 55 |
|
{ |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
volatile boolean finish = false; |
| 59 |
|
|
| |
|
| 0% |
Uncovered Elements: 29 (29) |
Complexity: 3 |
Complexity Density: 0.11 |
|
| 60 |
0 |
@Test(groups = { "Functional" }, enabled = false)... |
| 61 |
|
public void test() |
| 62 |
|
{ |
| 63 |
0 |
Console.initLogger(); |
| 64 |
|
|
| 65 |
0 |
final JFrame cfoo = new JFrame("Crash Java"); |
| 66 |
0 |
final JDesktopPane foo = new JDesktopPane(); |
| 67 |
0 |
foo.setPreferredSize(new Dimension(600, 800)); |
| 68 |
0 |
cfoo.setSize(600, 800); |
| 69 |
0 |
final JInternalFrame cont = new JInternalFrame("My Frame"); |
| 70 |
0 |
cont.setPreferredSize(new Dimension(400, 400)); |
| 71 |
0 |
String msg = "This is a dummy string. See the dummy string go.\n"; |
| 72 |
0 |
msg += msg; |
| 73 |
0 |
msg += msg; |
| 74 |
0 |
msg += msg; |
| 75 |
0 |
msg += msg; |
| 76 |
0 |
JTextArea evt = new JTextArea( |
| 77 |
|
"Click here and drag text over this window to freeze java.\n\n" |
| 78 |
|
+ msg); |
| 79 |
0 |
cont.add(evt); |
| 80 |
0 |
cont.pack(); |
| 81 |
0 |
foo.add("A frame", cont); |
| 82 |
0 |
foo.setVisible(true); |
| 83 |
0 |
foo.setEnabled(true); |
| 84 |
0 |
foo.doLayout(); |
| 85 |
0 |
cfoo.add(foo); |
| 86 |
|
|
| 87 |
|
|
| 88 |
|
|
| 89 |
0 |
evt.addMouseListener(new MouseAdapter() |
| 90 |
|
{ |
| 91 |
|
|
| |
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
| 92 |
0 |
@Override... |
| 93 |
|
public void mouseClicked(MouseEvent e) |
| 94 |
|
{ |
| 95 |
|
|
| 96 |
|
|
| 97 |
|
|
| 98 |
|
|
| 99 |
|
|
| 100 |
|
|
| 101 |
0 |
EditNameDialog end = new EditNameDialog("Sequence Name", |
| 102 |
|
"Try and drag between the two text fields", "label 1", |
| 103 |
|
"Label 2"); |
| 104 |
0 |
assert (end != null); |
| 105 |
0 |
finish = true; |
| 106 |
|
} |
| 107 |
|
}); |
| 108 |
0 |
cont.setVisible(true); |
| 109 |
|
|
| 110 |
|
|
| 111 |
|
|
| 112 |
|
|
| 113 |
|
|
| 114 |
|
|
| 115 |
|
|
| 116 |
|
|
| 117 |
|
|
| 118 |
|
|
| 119 |
|
|
| 120 |
|
|
| 121 |
|
|
| 122 |
|
|
| 123 |
0 |
foo.setVisible(true); |
| 124 |
0 |
cfoo.setVisible(true); |
| 125 |
0 |
while (!finish) |
| 126 |
|
{ |
| 127 |
0 |
try |
| 128 |
|
{ |
| 129 |
0 |
Thread.sleep(100); |
| 130 |
|
} catch (InterruptedException x) |
| 131 |
|
{ |
| 132 |
|
} |
| 133 |
|
} |
| 134 |
|
} |
| 135 |
|
|
| 136 |
|
} |