Преглед на файлове

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 години
родител
ревизия
03b6295816
променени са 2 файла, в които са добавени 20 реда и са изтрити 8 реда
  1. 14
    2
      test/com/dmdirc/actions/ActionManagerTest.java
  2. 6
    6
      test/com/dmdirc/ui/swing/dialogs/actionsmanager/ActionsManagerDialogTest.java

+ 14
- 2
test/com/dmdirc/actions/ActionManagerTest.java Целия файл

@@ -25,6 +25,7 @@ import com.dmdirc.actions.interfaces.ActionType;
25 25
 import java.io.File;
26 26
 
27 27
 import java.util.ArrayList;
28
+import org.junit.AfterClass;
28 29
 import org.junit.BeforeClass;
29 30
 import org.junit.Test;
30 31
 import static org.junit.Assert.*;
@@ -34,8 +35,19 @@ public class ActionManagerTest extends junit.framework.TestCase {
34 35
     @BeforeClass
35 36
     public void setUpClass() throws Exception {
36 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 53
     @Test

+ 6
- 6
test/com/dmdirc/ui/swing/dialogs/actionsmanager/ActionsManagerDialogTest.java Целия файл

@@ -60,6 +60,10 @@ public class ActionsManagerDialogTest {
60 60
         if (window != null) {
61 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 69
     @Test
@@ -84,12 +88,8 @@ public class ActionsManagerDialogTest {
84 88
         assertEquals("New action group", newwin.target.getTitle());
85 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 93
         newwin.button(new ButtonTextFinder("OK")).requireEnabled().click();
94 94
         
95 95
         // Ensure it's added

Loading…
Отказ
Запис