bug 317231 fix the default attribute of the <property> element in jetty.xml files

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2037 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Hugues Malphettes 2010-06-22 16:05:21 +00:00
parent 9b39c2f374
commit ca3ad1b7d5
4 changed files with 12 additions and 1 deletions

View File

@ -792,7 +792,7 @@ public class XmlConfiguration
if (_propertyMap!=null && _propertyMap.containsKey(name))
prop=_propertyMap.get(name);
else
prop=System.getProperty(name,defval);
prop=defval;
if (id != null)
_idMap.put(id, prop);
if (prop!=null)

View File

@ -32,6 +32,7 @@ public class TestConfiguration extends HashMap
public int[] ia;
public int testField1;
public int testField2;
public int propValue;
public void setTest(Object value)
{
@ -42,6 +43,12 @@ public class TestConfiguration extends HashMap
{
testInt=value;
}
public void setPropertyTest(int value)
{
propValue=value;
}
public void call()
{

View File

@ -69,6 +69,8 @@ public class XmlConfigurationTest
assertEquals("Set String","SetValue",tc.testObject);
assertEquals("Set Type",2,tc.testInt);
assertEquals(18080, tc.propValue);
assertEquals("Put","PutValue",tc.get("Test"));
assertEquals("Put dft","2",tc.get("TestDft"));

View File

@ -5,6 +5,8 @@
<Set name="Test">SetValue</Set>
<Set name="Test" type="int">2</Set>
<Set name="PropertyTest"><Property name="anIntegerNoActualPropDefined" default="18080"/></Set>
<Put name="Test">PutValue</Put>
<Put name="TestDft">2</Put>