Don't depend on hash ordering.
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
|
||||
package com.samskivert.util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.junit.*;
|
||||
@@ -57,22 +59,22 @@ public class ConfigUtilTest
|
||||
try {
|
||||
String path = "util/child.properties";
|
||||
Properties props = ConfigUtil.loadInheritedProperties(path);
|
||||
assertTrue("props valid", props.toString().equals(DUMP));
|
||||
assertEquals("25", props.get("prop1"));
|
||||
assertEquals("twenty five", props.get("prop2"));
|
||||
assertEquals("9, 8, 7, 6", props.get("prop3"));
|
||||
assertEquals("one, two, three,, and a half, four", props.get("prop4"));
|
||||
assertEquals("5", props.get("sub.sub1"));
|
||||
assertEquals("whee!", props.get("sub.sub2"));
|
||||
|
||||
path = "test/test.properties";
|
||||
props = ConfigUtil.loadInheritedProperties(path);
|
||||
assertTrue("props valid", props.toString().equals(IDUMP));
|
||||
assertEquals("testAR - one", props.get("one"));
|
||||
assertEquals("testBR - two", props.get("two"));
|
||||
assertEquals("testC - three", props.get("three"));
|
||||
assertEquals("testBR - four", props.get("four"));
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
}
|
||||
}
|
||||
|
||||
protected static final String DUMP =
|
||||
"{prop4=one, two, three,, and a half, four, " +
|
||||
"prop3=9, 8, 7, 6, prop2=twenty five, prop1=25, " +
|
||||
"sub.sub2=whee!, sub.sub1=5}";
|
||||
|
||||
protected static final String IDUMP = "{two=testBR - two, " +
|
||||
"one=testAR - one, three=testC - three, four=testBR - four}";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user