Quellcode durchsuchen

Added crazy mainframe unit test, and fest libs to test it. Incoming bamboo breakage!


git-svn-id: http://svn.dmdirc.com/trunk@4420 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Chris Smith vor 16 Jahren
Ursprung
Commit
1d76875ef0

BIN
lib/MRJToolkitStubs-1.0.jar Datei anzeigen


BIN
lib/fest-assert-1.0a1.jar Datei anzeigen


BIN
lib/fest-reflect-0.4.jar Datei anzeigen


BIN
lib/fest-swing-1.0b1.jar Datei anzeigen


BIN
lib/fest-swing-junit-1.0b1.jar Datei anzeigen


BIN
lib/fest-util-0.4.jar Datei anzeigen


+ 8
- 2
nbproject/genfiles.properties Datei anzeigen

@@ -4,5 +4,11 @@ build.xml.stylesheet.CRC32=240b97a2
4 4
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 5
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6 6
 nbproject/build-impl.xml.data.CRC32=bd5a0d51
7
-nbproject/build-impl.xml.script.CRC32=71da8a92
8
-nbproject/build-impl.xml.stylesheet.CRC32=eb00e44a
7
+nbproject/build-impl.xml.script.CRC32=7dae1a01
8
+nbproject/build-impl.xml.stylesheet.CRC32=295adcf5
9
+nbproject/profiler-build-impl.xml.data.CRC32=bd5a0d51
10
+nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
11
+nbproject/profiler-build-impl.xml.stylesheet.CRC32=42cb6bcf
12
+nbproject/build-impl.xml.data.CRC32=bd5a0d51
13
+nbproject/build-impl.xml.script.CRC32=c389cfac
14
+nbproject/build-impl.xml.stylesheet.CRC32=487672f9

+ 14
- 2
nbproject/project.properties Datei anzeigen

@@ -1,3 +1,9 @@
1
+file.reference.fest-assert-1.0a1.jar=lib/fest-assert-1.0a1.jar
2
+file.reference.fest-reflect-0.4.jar=lib/fest-reflect-0.4.jar
3
+file.reference.fest-swing-1.0b1.jar=lib/fest-swing-1.0b1.jar
4
+file.reference.fest-swing-junit-1.0b1.jar=lib/fest-swing-junit-1.0b1.jar
5
+file.reference.fest-util-0.4.jar=lib/fest-util-0.4.jar
6
+
1 7
 libs.junit.classpath=/usr/share/java/junit.jar
2 8
 libs.junit_4.classpath=/usr/share/java/junit4.jar
3 9
 libs.junit.javadoc=
@@ -36,7 +42,12 @@ javac.target=1.6
36 42
 javac.test.classpath=\
37 43
     ${javac.classpath}:\
38 44
     ${build.classes.dir}:\
39
-    ${libs.junit_4.classpath}
45
+    ${libs.junit_4.classpath}:\
46
+    ${file.reference.fest-swing-junit-1.0b1.jar}:\
47
+    ${file.reference.fest-swing-1.0b1.jar}:\
48
+    ${file.reference.fest-assert-1.0a1.jar}:\
49
+    ${file.reference.fest-reflect-0.4.jar}:\
50
+    ${file.reference.fest-util-0.4.jar}
40 51
 javadoc.additionalparam=-overview ${src.dir}/overview.html
41 52
 javadoc.author=false
42 53
 javadoc.encoding=
@@ -62,6 +73,7 @@ run.jvmargs=
62 73
 run.test.classpath=\
63 74
     ${javac.test.classpath}:\
64 75
     ${build.test.classes.dir}:\
65
-    ${libs.junit.classpath}:${libs.junit_4.classpath}
76
+    ${libs.junit.classpath}:\
77
+    ${libs.junit_4.classpath}
66 78
 src.dir=src
67 79
 test.src.dir=test

+ 126
- 0
test/com/dmdirc/ui/swing/MainFrameTest.java Datei anzeigen

@@ -0,0 +1,126 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack, Gregory Holmes
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.ui.swing;
24
+
25
+import com.dmdirc.config.IdentityManager;
26
+import com.dmdirc.ui.swing.dialogs.FeedbackDialog;
27
+import com.dmdirc.ui.swing.dialogs.NewServerDialog;
28
+import com.dmdirc.ui.swing.dialogs.about.AboutDialog;
29
+import com.dmdirc.ui.swing.dialogs.actionsmanager.ActionsManagerDialog;
30
+import com.dmdirc.ui.swing.dialogs.aliases.AliasManagerDialog;
31
+import com.dmdirc.ui.swing.dialogs.prefs.SwingPreferencesDialog;
32
+import com.dmdirc.ui.swing.dialogs.profiles.ProfileManagerDialog;
33
+
34
+import org.fest.swing.finder.WindowFinder;
35
+import org.fest.swing.fixture.DialogFixture;
36
+import org.fest.swing.fixture.FrameFixture;
37
+import org.junit.After;
38
+import org.junit.Before;
39
+import org.junit.Test;
40
+import static org.junit.Assert.*;
41
+
42
+public class MainFrameTest {
43
+    
44
+    private FrameFixture window;
45
+    
46
+    @Before
47
+    public void setUp() {
48
+        IdentityManager.load();
49
+        window = new FrameFixture(SwingController.getMainFrame());
50
+        window.show();
51
+    }
52
+    
53
+    @After
54
+    public void tearDown() {
55
+        if (window != null) {
56
+            window.cleanUp();
57
+        }
58
+    }
59
+    
60
+    @Test
61
+    public void testNewServerDialog() {
62
+        window.menuItemWithPath("Server", "New Server...").click();
63
+        DialogFixture newwin = WindowFinder.findDialog(NewServerDialog.class)
64
+                .withTimeout(5000).using(window.robot);
65
+        newwin.requireVisible();
66
+    }
67
+    
68
+    @Test
69
+    public void testAboutDialog() {
70
+        window.menuItemWithPath("Help", "About").click();
71
+        DialogFixture newwin = WindowFinder.findDialog(AboutDialog.class)
72
+                .withTimeout(5000).using(window.robot);
73
+        newwin.requireVisible();
74
+    }
75
+    
76
+    @Test
77
+    public void testFeedbackDialog() {
78
+        window.menuItemWithPath("Help", "Send Feedback").click();
79
+        DialogFixture newwin = WindowFinder.findDialog(FeedbackDialog.class)
80
+                .withTimeout(5000).using(window.robot);
81
+        newwin.requireVisible();
82
+    }
83
+    
84
+    @Test
85
+    public void testPreferencesDialog() {
86
+        window.menuItemWithPath("Settings", "Preferences").click();
87
+        DialogFixture newwin = WindowFinder.findDialog(SwingPreferencesDialog.class)
88
+                .withTimeout(5000).using(window.robot);
89
+        newwin.requireVisible();
90
+    }
91
+    
92
+    @Test
93
+    public void testProfileManagerDialog() {
94
+        window.menuItemWithPath("Settings", "Profile Manager").click();
95
+        DialogFixture newwin = WindowFinder.findDialog(ProfileManagerDialog.class)
96
+                .withTimeout(5000).using(window.robot);
97
+        newwin.requireVisible();
98
+    }
99
+    
100
+    @Test
101
+    public void testActionsManagerDialog() {
102
+        window.menuItemWithPath("Settings", "Actions Manager").click();
103
+        DialogFixture newwin = WindowFinder.findDialog(ActionsManagerDialog.class)
104
+                .withTimeout(5000).using(window.robot);
105
+        newwin.requireVisible();
106
+    }
107
+    
108
+    @Test
109
+    public void testAliasManagerDialog() {
110
+        window.menuItemWithPath("Settings", "Alias Manager").click();
111
+        DialogFixture newwin = WindowFinder.findDialog(AliasManagerDialog.class)
112
+                .withTimeout(5000).using(window.robot);
113
+        newwin.requireVisible();
114
+    }
115
+    
116
+    @Test
117
+    public void testChannelServerSettings() {
118
+        window.menuItemWithPath("Settings", "Server settings").requireDisabled();
119
+        window.menuItemWithPath("Settings", "Channel Settings").requireDisabled();
120
+    }
121
+
122
+    public static junit.framework.Test suite() {
123
+        return new junit.framework.JUnit4TestAdapter(MainFrameTest.class);
124
+    }
125
+
126
+}

Laden…
Abbrechen
Speichern