*/
public void testConfig5() throws Exception {
String configPath = "config5.xml";
InputStream configStream = getClass().getResourceAsStream(configPath);
Conf config = XmlConfBuilder.build(configStream, configPath);
assertTrue(config.getChild("boolean").getValueAsBoolean());
assertEquals(5, config.getChild("int").getValueAsInteger());
assertEquals(6l, config.getChild("long").getValueAsLong());
assertEquals(3.3f, config.getChild("float").getValueAsFloat(), 0.0001f);
assertEquals(5.5d, config.getChild("double").getValueAsDouble(), 0.0001d);
// Test fallback to default
assertTrue(config.getChild("boolean2").getValueAsBoolean(true));
assertEquals(new Integer(5), config.getChild("int2").getValueAsInteger(5));
assertEquals(new Long(6l), config.getChild("long2").getValueAsLong(6l));
assertEquals(3.3f, config.getChild("float2").getValueAsFloat(3.3f), 0.0001f);
assertEquals(5.5d, config.getChild("double2").getValueAsDouble(5.5d), 0.0001d);
// Test attributes
assertTrue(config.getAttributeAsBoolean("boolean"));
assertEquals(5, config.getAttributeAsInteger("int"));
assertEquals(6l, config.getAttributeAsLong("long"));
assertEquals(3.3f, config.getAttributeAsFloat("float"), 0.0001f);
assertEquals(5.5d, config.getAttributeAsDouble("double"), 0.0001d);
// Test attribute fallback to default
assertTrue(config.getAttributeAsBoolean("boolean2", true));
assertEquals(new Integer(5), config.getAttributeAsInteger("int2", 5));
assertEquals(new Long(6l), config.getAttributeAsLong("long2", 6l));
assertEquals(3.3f, config.getAttributeAsFloat("float2", 3.3f), 0.0001f);
assertEquals(5.5d, config.getAttributeAsDouble("double2", 5.5d), 0.0001d);
}