X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FJAL1353bugdemo.java;h=868e19e32a34248dea79c3e336633ba0410577b1;hb=fddf3084802b37e5cee17829e32692a4aac3e60d;hp=486c098fb54b2c8ef40147616a04785c5600cfa8;hpb=fdf3e97f5e1100fcd499f76023bb5d293ff10d5e;p=jalview.git diff --git a/test/jalview/gui/JAL1353bugdemo.java b/test/jalview/gui/JAL1353bugdemo.java index 486c098..868e19e 100644 --- a/test/jalview/gui/JAL1353bugdemo.java +++ b/test/jalview/gui/JAL1353bugdemo.java @@ -1,9 +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 . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.gui; -import static org.junit.Assert.*; import jalview.bin.Cache; -import java.awt.Component; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -15,12 +33,11 @@ import javax.swing.JFrame; import javax.swing.JInternalFrame; import javax.swing.JMenu; import javax.swing.JMenuItem; -import javax.swing.JPanel; import javax.swing.JTextArea; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; public class JAL1353bugdemo { @@ -34,93 +51,103 @@ public class JAL1353bugdemo public static void tearDownAfterClass() throws Exception { } - volatile boolean finish=false; - @Test + volatile boolean finish = false; + + @Test(groups = + { "Functional" }, enabled = false) public void test() { Cache.initLogger(); // final Desktop foo = new Desktop(); final JFrame cfoo = new JFrame("Crash Java"); - final JDesktopPane foo=new JDesktopPane(); - foo.setPreferredSize(new Dimension(600,800)); + final JDesktopPane foo = new JDesktopPane(); + foo.setPreferredSize(new Dimension(600, 800)); cfoo.setSize(600, 800); final JInternalFrame cont = new JInternalFrame("My Frame"); JTextArea evt; cont.setPreferredSize(new Dimension(400, 300)); - cont.add(evt=new JTextArea("Click here and drag text over this window to freeze java.\n\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\n")); + cont.add(evt = new JTextArea( + "Click here and drag text over this window to freeze java.\n\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\n")); cont.pack(); - foo.add("A frame",cont); + foo.add("A frame", cont); foo.setVisible(true); foo.setEnabled(true); foo.doLayout(); cfoo.add(foo); final JMenu jm = new JMenu("Do"); - JMenuItem jmi=new JMenuItem("this"); + JMenuItem jmi = new JMenuItem("this"); jm.add(jmi); evt.addMouseListener(new MouseListener() { - + @Override public void mouseReleased(MouseEvent e) { } - + @Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub - + } - + @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub - + } - + @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub - + } - + @Override public void mouseClicked(MouseEvent e) { -// JFrame parent = new JFrame(); -// parent.setBounds(foo.getBounds()); -// JPanel oo = new JPanel(); -// parent.add(oo); -// oo.setVisible(true); -// parent.setVisible(true); - EditNameDialog end =new EditNameDialog("Sequence Name", "Sequence Description","label 1", "Label 2", "Try and drag between the two text fields", foo);//);cont.getRootPane()); - assert(end!=null); - finish=true; + // JFrame parent = new JFrame(); + // parent.setBounds(foo.getBounds()); + // JPanel oo = new JPanel(); + // parent.add(oo); + // oo.setVisible(true); + // parent.setVisible(true); + EditNameDialog end = new EditNameDialog("Sequence Name", + "Sequence Description", "label 1", "Label 2", + "Try and drag between the two text fields", foo);// );cont.getRootPane()); + assert (end != null); + finish = true; } }); cont.setVisible(true); jmi.addActionListener(new ActionListener() { - + @Override public void actionPerformed(ActionEvent arg0) { - EditNameDialog end =new EditNameDialog("Sequence Name", "Sequence Description","label 1", "Label 2", "Try and drag between the two text fields", cont); - assert(end!=null); - finish=true; + EditNameDialog end = new EditNameDialog("Sequence Name", + "Sequence Description", "label 1", "Label 2", + "Try and drag between the two text fields", cont); + assert (end != null); + finish = true; } }); foo.setVisible(true); cfoo.setVisible(true); while (!finish) { - try { + try + { Thread.sleep(100); - } catch (InterruptedException x) {} + } catch (InterruptedException x) + { + } } }