assertDefaultElementValues(foo);
}
public void testProviders() {
DatatypeConverter.setDatatypeConverter(new DatatypeConverterImpl());
Foo foo = new org.apache.cxf.configuration.foo.ObjectFactory().createFoo();
ConfigurationProvider provider = new ConfigurationProvider() {
public Object getObject(String name) {
if ("integerAttr".equals(name) || "integerAttrNoDefault".equals(name)) {
return BigInteger.TEN;
}
return null;
}
};
assertNull(foo.getIntegerAttrNoDefault());
assertEquals(new BigInteger("111"), foo.getIntegerAttr());
List<ConfigurationProvider> providers = foo.getFallbackProviders();
assertNull(providers);
providers = new ArrayList<ConfigurationProvider>();
providers.add(provider);
foo.setFallbackProviders(providers);
assertEquals(BigInteger.TEN, foo.getIntegerAttrNoDefault());
assertEquals(BigInteger.TEN, foo.getIntegerAttr());
foo.setFallbackProviders(null);
providers = foo.getOverwriteProviders();
assertNull(providers);
providers = new ArrayList<ConfigurationProvider>();
providers.add(provider);
foo.setOverwriteProviders(providers);
assertEquals(BigInteger.TEN, foo.getIntegerAttrNoDefault());
assertEquals(BigInteger.TEN, foo.getIntegerAttr());
}