Browse Source

ActionManagerTest now removes its groups when the test has finished, to appease the grand muppet

ActionsManagerDialogTest also does the same, and uses the ClassFinder harness instead of an AIC

git-svn-id: http://svn.dmdirc.com/trunk@4423 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Chris Smith 16 years ago
parent
commit
03b6295816

+ 14
- 2
test/com/dmdirc/actions/ActionManagerTest.java View File

25
 import java.io.File;
25
 import java.io.File;
26
 
26
 
27
 import java.util.ArrayList;
27
 import java.util.ArrayList;
28
+import org.junit.AfterClass;
28
 import org.junit.BeforeClass;
29
 import org.junit.BeforeClass;
29
 import org.junit.Test;
30
 import org.junit.Test;
30
 import static org.junit.Assert.*;
31
 import static org.junit.Assert.*;
34
     @BeforeClass
35
     @BeforeClass
35
     public void setUpClass() throws Exception {
36
     public void setUpClass() throws Exception {
36
         ActionManager.init();
37
         ActionManager.init();
37
-        ActionManager.removeGroup("unit-test");
38
-        ActionManager.removeGroup("unit-test-two");
38
+        
39
+        tearDownClass();
40
+    }
41
+    
42
+    @AfterClass
43
+    public void tearDownClass() throws Exception {
44
+        if (ActionManager.getGroups().containsKey("unit-test")) {
45
+            ActionManager.removeGroup("unit-test");
46
+        }
47
+        
48
+        if (ActionManager.getGroups().containsKey("unit-test-two")) {
49
+            ActionManager.removeGroup("unit-test-two");
50
+        }
39
     }
51
     }
40
 
52
 
41
     @Test
53
     @Test

+ 6
- 6
test/com/dmdirc/ui/swing/dialogs/actionsmanager/ActionsManagerDialogTest.java View File

60
         if (window != null) {
60
         if (window != null) {
61
             window.cleanUp();
61
             window.cleanUp();
62
         }
62
         }
63
+        
64
+        if (ActionManager.getGroups().containsKey("amd-ui-test1")) {
65
+            ActionManager.removeGroup("amd-ui-test1");
66
+        }
63
     }
67
     }
64
     
68
     
65
     @Test
69
     @Test
84
         assertEquals("New action group", newwin.target.getTitle());
88
         assertEquals("New action group", newwin.target.getTitle());
85
         newwin.button(new ButtonTextFinder("OK")).requireDisabled();
89
         newwin.button(new ButtonTextFinder("OK")).requireDisabled();
86
         
90
         
87
-        newwin.textBox(new GenericTypeMatcher<JTextComponent>() {
88
-            @Override
89
-            protected boolean isMatching(JTextComponent arg0) {
90
-                return arg0.getClass().equals(javax.swing.JTextField.class);
91
-            }
92
-        }).enterText("amd-ui-test1");
91
+        newwin.textBox(new ClassFinder<JTextComponent>(javax.swing.JTextField.class, null))
92
+                .enterText("amd-ui-test1");
93
         newwin.button(new ButtonTextFinder("OK")).requireEnabled().click();
93
         newwin.button(new ButtonTextFinder("OK")).requireEnabled().click();
94
         
94
         
95
         // Ensure it's added
95
         // Ensure it's added

Loading…
Cancel
Save