Browse Source

Test fixes

tags/0.6.3m1rc1
Chris Smith 15 years ago
parent
commit
a248ca7092
1 changed files with 7 additions and 5 deletions
  1. 7
    5
      test/com/dmdirc/config/prefs/PreferencesSettingTest.java

+ 7
- 5
test/com/dmdirc/config/prefs/PreferencesSettingTest.java View File

29
 import java.util.HashMap;
29
 import java.util.HashMap;
30
 import java.util.Map;
30
 import java.util.Map;
31
 import org.junit.Before;
31
 import org.junit.Before;
32
+import org.junit.BeforeClass;
32
 import org.junit.Test;
33
 import org.junit.Test;
33
 import static org.junit.Assert.*;
34
 import static org.junit.Assert.*;
34
 
35
 
35
 public class PreferencesSettingTest {
36
 public class PreferencesSettingTest {
36
     
37
     
37
-    @Before
38
-    public void setUp() throws Exception {        
38
+    @BeforeClass
39
+    public static void setUp() throws Exception {
39
         IdentityManager.load();
40
         IdentityManager.load();
40
     }    
41
     }    
41
 
42
 
128
                 "option", "title", "helptext");
129
                 "option", "title", "helptext");
129
         ps2.setValue(null);
130
         ps2.setValue(null);
130
         ps2.dismiss();
131
         ps2.dismiss();
131
-        assertEquals(null, ps2.getValue());        
132
+        assertEquals("fallback", ps2.getValue());
132
     }
133
     }
133
     
134
     
134
     @Test
135
     @Test
158
         ps.setValue("abcdefg");
159
         ps.setValue("abcdefg");
159
         assertTrue(ps.needsSaving());
160
         assertTrue(ps.needsSaving());
160
 
161
 
162
+        IdentityManager.getConfigIdentity().setOption("domain", "option2", "fallback");
161
         final PreferencesSetting ps2 = new PreferencesSetting(PreferencesType.TEXT, "domain",
163
         final PreferencesSetting ps2 = new PreferencesSetting(PreferencesType.TEXT, "domain",
162
-                "option", "title", "helptext");
164
+                "option2", "title", "helptext");
163
         
165
         
164
         ps2.setValue(null);
166
         ps2.setValue(null);
165
-        assertFalse(ps2.needsSaving());
167
+        assertTrue(ps2.needsSaving());
166
     }
168
     }
167
     
169
     
168
     @Test
170
     @Test

Loading…
Cancel
Save