use of org.apache.aries.blueprint.reflect.BeanMetadataImpl in project geronimo-xbean by apache.
the class FavoriteUsingBlueprintTest method testFavs.
public void testFavs() throws Exception {
BeanMetadataImpl meta = (BeanMetadataImpl) reg.getComponentDefinition("favoriteService");
assertEquals(1, meta.getProperties().size());
BeanProperty prop = propertyByName("favorites", meta);
MapMetadata favorites = (MapMetadata) prop.getValue();
assertEquals(3, favorites.getEntries().size());
MapEntry me = favorites.getEntries().get(0);
assertEquals("Dan", ((ValueMetadata) me.getKey()).getStringValue());
assertEquals("Grey Goose", ((ValueMetadata) me.getValue()).getStringValue());
me = favorites.getEntries().get(1);
assertEquals("IndecisiveDan", ((ValueMetadata) me.getKey()).getStringValue());
CollectionMetadata cm = (CollectionMetadata) me.getValue();
assertEquals(2, cm.getValues().size());
assertEquals("Malbec", ((ValueMetadata) cm.getValues().get(0)).getStringValue());
assertEquals("0", ((ValueMetadata) ((BeanMetadata) cm.getValues().get(1)).getArguments().get(0).getValue()).getStringValue());
me = favorites.getEntries().get(2);
assertEquals("WithInnerBean", ((ValueMetadata) me.getKey()).getStringValue());
BeanMetadata bm = (BeanMetadata) me.getValue();
assertEquals(GinService.class.getName(), bm.getClassName());
assertEquals("Bombay Sapphire", ((ValueMetadata) bm.getProperties().get(0).getValue()).getStringValue());
}
use of org.apache.aries.blueprint.reflect.BeanMetadataImpl in project geronimo-xbean by apache.
the class GinUsingXBeanTest method testWine.
public void testWine() throws Exception {
BeanMetadataImpl meta = (BeanMetadataImpl) reg.getComponentDefinition("ginService");
checkPropertyValue("name", "Bombay Sapphire", meta);
}
use of org.apache.aries.blueprint.reflect.BeanMetadataImpl in project geronimo-xbean by apache.
the class VodkaUsingBlueprintTest method testWine.
public void testWine() throws Exception {
BeanMetadataImpl meta = (BeanMetadataImpl) reg.getComponentDefinition("vodkaService");
checkPropertyValue("name", "Grey Goose", meta);
checkPropertyValue("id", "vodkaService", meta);
// Test more complex classes
checkPropertyValue("vodkaClass", VodkaService.class.getName(), meta);
}
Aggregations