|
@@ -1,108 +0,0 @@
|
1
|
|
-/*
|
2
|
|
- * Copyright (c) 2006-2011 DMDirc Developers
|
3
|
|
- *
|
4
|
|
- * Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
|
- * of this software and associated documentation files (the "Software"), to deal
|
6
|
|
- * in the Software without restriction, including without limitation the rights
|
7
|
|
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
|
- * copies of the Software, and to permit persons to whom the Software is
|
9
|
|
- * furnished to do so, subject to the following conditions:
|
10
|
|
- *
|
11
|
|
- * The above copyright notice and this permission notice shall be included in
|
12
|
|
- * all copies or substantial portions of the Software.
|
13
|
|
- *
|
14
|
|
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
|
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
|
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
|
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
|
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
|
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
20
|
|
- * SOFTWARE.
|
21
|
|
- */
|
22
|
|
-
|
23
|
|
-package com.dmdirc.addons.ui_swing;
|
24
|
|
-
|
25
|
|
-import com.dmdirc.harness.ui.DMDircUITestCase;
|
26
|
|
-import org.junit.Test;
|
27
|
|
-import org.uispec4j.Trigger;
|
28
|
|
-import org.uispec4j.Window;
|
29
|
|
-import org.uispec4j.interception.WindowInterceptor;
|
30
|
|
-
|
31
|
|
-public class MainFrameTest extends DMDircUITestCase {
|
32
|
|
-
|
33
|
|
- private static Window window;
|
34
|
|
-
|
35
|
|
- static {
|
36
|
|
- SwingController controller = getMockedController();
|
37
|
|
-
|
38
|
|
- window = new Window(new MainFrame(controller));
|
39
|
|
- window.containsMenuBar().check();
|
40
|
|
- WindowInterceptor.run(new Trigger() {
|
41
|
|
-
|
42
|
|
- @Override
|
43
|
|
- public void run() throws Exception {
|
44
|
|
- window.getAwtComponent().setVisible(true);
|
45
|
|
- }
|
46
|
|
- });
|
47
|
|
- }
|
48
|
|
-
|
49
|
|
- @Test
|
50
|
|
- public void testNewServerDialog() {
|
51
|
|
- Window popup = WindowInterceptor.run(window.getMenuBar()
|
52
|
|
- .getMenu("Server").getSubMenu("New Server...").triggerClick());
|
53
|
|
- popup.titleEquals("DMDirc: Connect to a new server").check();
|
54
|
|
- }
|
55
|
|
-
|
56
|
|
- @Test
|
57
|
|
- public void testAboutDialog() {
|
58
|
|
- Window popup = WindowInterceptor.run(window.getMenuBar()
|
59
|
|
- .getMenu("Help").getSubMenu("About").triggerClick());
|
60
|
|
- popup.titleEquals("DMDirc: About").check();
|
61
|
|
- }
|
62
|
|
-
|
63
|
|
- @Test
|
64
|
|
- public void testFeedbackDialog() {
|
65
|
|
- Window popup = WindowInterceptor.run(window.getMenuBar()
|
66
|
|
- .getMenu("Help").getSubMenu("Send Feedback").triggerClick());
|
67
|
|
- popup.titleEquals("DMDirc: Feedback").check();
|
68
|
|
- }
|
69
|
|
-
|
70
|
|
- @Test
|
71
|
|
- public void testPreferencesDialog() {
|
72
|
|
- Window popup = WindowInterceptor.run(window.getMenuBar()
|
73
|
|
- .getMenu("Settings").getSubMenu("Preferences").triggerClick());
|
74
|
|
- popup.titleEquals("DMDirc: Preferences").check();
|
75
|
|
- }
|
76
|
|
-
|
77
|
|
- @Test
|
78
|
|
- public void testProfileManagerDialog() {
|
79
|
|
- Window main = WindowInterceptor.run(Trigger.DO_NOTHING);
|
80
|
|
- Window popup = WindowInterceptor.run(window.getMenuBar()
|
81
|
|
- .getMenu("Settings").getSubMenu("Profile Manager").triggerClick());
|
82
|
|
- popup.titleEquals("DMDirc: Profile Editor").check();
|
83
|
|
- }
|
84
|
|
-
|
85
|
|
- @Test
|
86
|
|
- public void testActionsManagerDialog() {
|
87
|
|
- Window popup = WindowInterceptor.run(window.getMenuBar()
|
88
|
|
- .getMenu("Settings").getSubMenu("Actions Manager").triggerClick());
|
89
|
|
- popup.titleEquals("DMDirc: Actions Manager").check();
|
90
|
|
- }
|
91
|
|
-
|
92
|
|
- @Test
|
93
|
|
- public void testAliasManagerDialog() {
|
94
|
|
- Window popup = WindowInterceptor.run(window.getMenuBar()
|
95
|
|
- .getMenu("Settings").getSubMenu("Alias Manager").triggerClick());
|
96
|
|
- popup.titleEquals("DMDirc: Alias manager").check();
|
97
|
|
- }
|
98
|
|
-
|
99
|
|
- @Test
|
100
|
|
- public void testChannelServerSettings() {
|
101
|
|
- assertFalse(window.getMenuBar().getMenu("Channel").getSubMenu("Channel Settings").isEnabled());
|
102
|
|
- }
|
103
|
|
-
|
104
|
|
- @Test
|
105
|
|
- public void testServerServerSettings() {
|
106
|
|
- assertFalse(window.getMenuBar().getMenu("Server").getSubMenu("Server Settings").isEnabled());
|
107
|
|
- }
|
108
|
|
-}
|