SystemPropertiesTestpublic class SystemPropertiesTest extends TestCase
Fields Summary |
---|
private static final String | KEY | private static final String | PERSIST_KEY |
Methods Summary |
---|
public void | testProperties()
String value;
SystemProperties.set(KEY, "");
value = SystemProperties.get(KEY, "default");
assertEquals("default", value);
SystemProperties.set(KEY, "SA");
value = SystemProperties.get(KEY, "default");
assertEquals("SA", value);
value = SystemProperties.get(KEY);
assertEquals("SA", value);
SystemProperties.set(KEY, "");
value = SystemProperties.get(KEY, "default");
assertEquals("default", value);
value = SystemProperties.get(KEY);
assertEquals("", value);
| public void | testStressMemoryPropertyConsistency()
for (int i = 0; i < 100; ++i) {
SystemProperties.set(KEY, Long.toString(i));
long ret = SystemProperties.getLong(KEY, -1);
assertEquals(i, ret);
}
| public void | testStressPersistPropertyConsistency()
for (int i = 0; i < 100; ++i) {
SystemProperties.set(PERSIST_KEY, Long.toString(i));
long ret = SystemProperties.getLong(PERSIST_KEY, -1);
assertEquals(i, ret);
}
|
|