doTestRemoveEntry(names[i], infos[i]);
}
public void testReplaceKey() {
try {
Global global = new Global();
global.getProperty().set("test1", "key1");
global.getProperty().set("test2", "key2");
global.getProperty().set("test3", "key3");
global.getProperty().set("test.one.two.${test0}", "test0");
global.getProperty().set("test.one.two.${test1}", "test1");
global.getProperty().set("test.one.two.${test2}", "test2");
global.getProperty().set("test.one.two.${test3}", "test3");
global.getProperty().set("${test.replace.key}", "testReplaceKey");
global.getProperty().set("${test.replace.key1}", "testReplaceKey1");
global.getProperty().set("someKey3", "testReplaceKey1");
global.getProperty().set("${test.replace.key}", "testReplaceKey");
global.getProperty().set("test.replace.key", "someKey");
GlobalInfo info = new OwnGlobalInfo();
info.init(global, null);
String val = info.get("someKey", null);
assertNotNull("The value must be set", val);
assertEquals("wrong value of replaced key", "testReplaceKey", val);
val = info.get("${test.replace.key1}", null);
assertNotNull("The value must be set", val);
val = global.getProperty().get("someKey3", (String)null);
assertNotNull("The value must be set", val);
Properties props = new Properties();
props.put("one", "one");
val = props.getProperty("one");
assertNotNull("The value must be set", val);
props.remove("one");
val = props.getProperty("one");
assertNull("The value must NOT be set", val);
global.getProperty().removeProperty("someKey3");
val = global.getProperty().get("someKey3", (String)null);
assertNull("The value must NOT be set", val);
val = info.get("${test.replace.key}", null);
assertNotNull("The value must be set", val);
val = global.getProperty().get("someKey3", (String)null);
assertNull("The value must NOT be set", val);
}
catch (XmlBlasterException ex) {