*/
public class TestPropertiesPreferences extends TestCase {
public void testPropertiesPreference() throws Exception {
Preferences prefs1 = new PropertiesPreferences(makeInput("pe=é\npa=1\npb=xyz\n"));
assertEquals(1, prefs1.getLong("pa", 0));
assertEquals("xyz", prefs1.get("pb", ""));
assertEquals(-1, prefs1.getLong("pd", -1));
assertEquals("é", prefs1.get("pe", null));
Preferences prefs2 = new PropertiesPreferences(
makeInput("pa=1\na.pb=2\na.b.pc=3\na.b2.pd=uvw\nb.pe=42"));
String[] children = prefs2.childrenNames();
Arrays.sort(children);
assertEquals("a", children[0]);
assertEquals("b", children[1]);
assertEquals(1, prefs2.getLong("pa", 0));
assertEquals(2, prefs2.node("a").getLong("pb", 0));
assertEquals(2, prefs2.node("/a").getLong("pb", 0));
assertEquals(3, prefs2.node("/a/b").getLong("pc", 0));
Preferences prefs2a = prefs2.node("/a");
assertEquals(2, prefs2a.getLong("pb", 0));
assertEquals(-1, prefs2.node("/a/c").getLong("px", -1));
assertEquals(null, prefs2.node("/a/c").get("py", null));
Preferences prefs2ab2 = prefs2.node("/a/b2");
assertEquals("uvw", prefs2ab2.get("pd", null));
}