// reset mock response
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
// close desktop windows/frames
- Desktop.instance.closeAll_actionPerformed(null);
+ if (Desktop.instance != null)
+ Desktop.instance.closeAll_actionPerformed(null);
// reset debug delay
Jalview2XML.setDebugDelaySave(20);
+ // load normal testprops
+ Cache.loadProperties("test/jalview/testProps.jvprops");
}
@BeforeMethod(alwaysRun = true)
// reset mock response
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
// close desktop windows/frames
- Desktop.instance.closeAll_actionPerformed(null);
+ if (Desktop.instance != null)
+ Desktop.instance.closeAll_actionPerformed(null);
// reset debug delay
Cache.setProperty("DEBUG_DELAY_SAVE", "false");
Jalview2XML.setDebugDelaySave(3);
Assert.assertTrue(end - start < 500,
"Quit-with-no-save-needed took too long (" + (end - start)
+ "ms)");
- Desktop.instance.closeAll_actionPerformed(null);
}
@Test(groups = { "Functional" }, singleThreaded = true, priority = 10)
Assert.assertEquals(response, QResponse.QUIT);
Assert.assertTrue(end - start > 2900,
"Quit-whilst-saving was too short (" + (end - start) + "ms)");
-
- Desktop.instance.closeAll_actionPerformed(null);
}
@Test(groups = { "Functional" }, singleThreaded = true, priority = 9)
Cache.setProperty("DEBUG_DELAY_SAVE", "false");
af.saveAlignment(saveProjectFile, FileFormat.Jalview);
- Thread.sleep(1000); // give time for file to save
-
// this is only a two button dialog [Quit] [Cancel] so use NO_OPTION (to
// mean [CANCEL] -- file should already be saved so this doesn't happen and
// we get a QUIT response)
// if not saved this would be CANCEL_QUIT
Assert.assertEquals(response, QResponse.QUIT);
- Desktop.instance.closeAll_actionPerformed(null);
}
@Test(groups = { "Functional" }, singleThreaded = true, priority = 9)
// if not saved this would be CANCEL_QUIT
Assert.assertEquals(response, QResponse.QUIT);
- Desktop.instance.closeAll_actionPerformed(null);
}
@Test(groups = { "Functional" }, singleThreaded = true, priority = 1)
QResponse response = QuitHandler.getQuitResponse(true);
Assert.assertEquals(response, QResponse.CANCEL_QUIT);
- Desktop.instance.closeAll_actionPerformed(null);
}
@Test(groups = { "Functional" }, singleThreaded = true, priority = 1)
QResponse response = QuitHandler.getQuitResponse(false);
Assert.assertEquals(response, QResponse.QUIT);
- Desktop.instance.closeAll_actionPerformed(null);
}
@Test(groups = { "Functional" }, singleThreaded = true, priority = 11)
"Force-Quit-whilst-saving was too long (" + (end - start)
+ "ms)");
- Desktop.instance.closeAll_actionPerformed(null);
}
}