1 | // Jomic - a viewer for comic book archives. |
2 | // Copyright (C) 2004-2011 Thomas Aglassinger |
3 | // |
4 | // This program is free software: you can redistribute it and/or modify |
5 | // it under the terms of the GNU General Public License as published by |
6 | // the Free Software Foundation, either version 3 of the License, or |
7 | // (at your option) any later version. |
8 | // |
9 | // This program is distributed in the hope that it will be useful, |
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | // GNU General Public License for more details. |
13 | // |
14 | // You should have received a copy of the GNU General Public License |
15 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | package net.sf.jomic.ui; |
17 | |
18 | import java.awt.Window; |
19 | |
20 | import javax.swing.JMenuItem; |
21 | |
22 | import net.roydesign.app.Application; |
23 | import net.sf.jomic.JomicTestFixture; |
24 | import abbot.tester.WindowTester; |
25 | |
26 | /** |
27 | * <p> |
28 | * |
29 | * Test help menu. </p> <p> |
30 | * |
31 | * Note: To run this test from Eclipse, <code>jomic-help.jar</code> must be added to the run |
32 | * target's classpath. This JAR is generated by <code>ant jomic-help.jar</code>, so it cannot |
33 | * be added to the static project classpath. </p> |
34 | * |
35 | * @author Thomas Aglassinger |
36 | */ |
37 | public class HelpMenuTest extends JomicTestFixture |
38 | { |
39 | public void testHelpMenu() |
40 | throws Exception { |
41 | JomicFrame jomicFrame = setUpJomicFrame(); |
42 | JMenuItem helpItem = findMenuItem("Help|Help"); |
43 | JMenuItem systemInfoItem = findMenuItem("Help|System information"); |
44 | JMenuItem aboutItem = Application.getInstance().getAboutJMenuItem(); |
45 | WindowTester windowTester = new WindowTester(); |
46 | |
47 | // Test help. |
48 | helpItem.doClick(); |
49 | |
50 | Window helpFrame = waitForWindowToShow("Jomic User Guide"); |
51 | |
52 | windowTester.actionClose(helpFrame); |
53 | |
54 | // Test about. |
55 | aboutItem.doClick(); |
56 | |
57 | Window aboutFrame = waitForWindowToShow(""); |
58 | |
59 | windowTester.actionClose(aboutFrame); |
60 | |
61 | // Test system information. |
62 | systemInfoItem.doClick(); |
63 | |
64 | Window systemInfoFrame = waitForWindowToShow("/System information.*/"); |
65 | |
66 | windowTester.actionClose(systemInfoFrame); |
67 | |
68 | jomicFrame.dispose(); |
69 | } |
70 | } |