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