File tree Expand file tree Collapse file tree 3 files changed +31
-3
lines changed
src/fi/helsinki/cs/tmc/ui
test/qa-functional/src/fi/helsinki/cs/tmc/functionaltests Expand file tree Collapse file tree 3 files changed +31
-3
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ public void showPreferencesDialog(final ActionListener dialogListener) {
8585 ActionListener closeListener = new ActionListener () {
8686 @ Override
8787 public void actionPerformed (ActionEvent e ) {
88- destroyDialog ();
88+ forgetDialog ();
8989 dialogListener .actionPerformed (e );
9090 }
9191 };
@@ -101,7 +101,7 @@ public void actionPerformed(ActionEvent e) {
101101 dialog .addWindowListener (new WindowAdapter () {
102102 @ Override
103103 public void windowClosed (WindowEvent we ) {
104- destroyDialog ();
104+ forgetDialog ();
105105 }
106106 });
107107 SwingUtilities .invokeLater (new Runnable () {
@@ -112,7 +112,7 @@ public void run() {
112112 });
113113 }
114114
115- private void destroyDialog () {
115+ private void forgetDialog () {
116116 panel = null ;
117117 dialog = null ;
118118 }
Original file line number Diff line number Diff line change 1+
2+ package fi .helsinki .cs .tmc .functionaltests ;
3+
4+ import fi .helsinki .cs .tmc .functionaltests .utils .SettingsOperator ;
5+ import fi .helsinki .cs .tmc .functionaltests .utils .TmcFunctionalTestCase ;
6+ import static fi .helsinki .cs .tmc .functionaltests .utils .TmcFunctionalTestCase .loadSuite ;
7+ import junit .framework .Test ;
8+
9+ public class ClosingSettingsDialogTest extends TmcFunctionalTestCase {
10+ public static Test suite () {
11+ return loadSuite (ClosingSettingsDialogTest .class );
12+ }
13+
14+ public ClosingSettingsDialogTest () {
15+ super ("ClosingSettingsDialogTest" );
16+ }
17+
18+
19+ public void testClosingSettingsDialog () throws Exception {
20+ SettingsOperator settings = SettingsOperator .openSettingsDialog ();
21+ settings .closeDialogWindow ();
22+ settings = SettingsOperator .openSettingsDialog ();
23+ }
24+ }
Original file line number Diff line number Diff line change @@ -73,6 +73,10 @@ public void clickCancel() {
7373 new JButtonOperator (dialog , "Cancel" ).doClick ();
7474 }
7575
76+ public void closeDialogWindow (){
77+ dialog .close ();
78+ }
79+
7680 public void setProjectDownloadDirToTestWorkDir (NbTestCase testCase ) throws IOException {
7781 // doClick blocks waiting for the file chooser so we send it to the background
7882 SwingUtilities .invokeLater (new Runnable () {
You can’t perform that action at this time.
0 commit comments