* Tests whether the returned configuration correctly wraps the builder.
*/
@Test
public void testConfigurationBuilderWrapper()
{
BaseHierarchicalConfiguration conf =
new BaseHierarchicalConfiguration();
ConfigurationBuilder<BaseHierarchicalConfiguration> builder =
createBuilderMock(conf);
EasyMock.replay(builder);
conf.addProperty("test1", "value1");
conf.addProperty("test2", "42");
BuilderConfigurationWrapperFactory factory =
new BuilderConfigurationWrapperFactory();
HierarchicalConfiguration<?> wrapper =
factory.createBuilderConfigurationWrapper(
HierarchicalConfiguration.class, builder);
assertEquals("Wrong value (1)", "value1", wrapper.getString("test1"));
assertEquals("Wrong value (2)", 42, wrapper.getInt("test2"));
assertSame("Wrong root node", conf.getNodeModel().getNodeHandler()
.getRootNode(), wrapper.getNodeModel().getNodeHandler()
.getRootNode());
}