}
public void testFromContextInject() throws Throwable
{
BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("test");
ValueMetaData value = builder.createFromContextInject(FromContext.CONTEXT, "foobar", ControllerState.CREATE, Search.CHILD_ONLY_DEPTH);
builder.addPropertyMetaData("someproprerty", value);
BeanMetaData bmd = builder.getBeanMetaData();
Set<PropertyMetaData> properties = bmd.getProperties();
assertNotNull(properties);
assertEquals(1, properties.size());
PropertyMetaData pmd = properties.iterator().next();
ValueMetaData vmd = pmd.getValue();
AbstractInjectionValueMetaData inject = assertInstanceOf(vmd, AbstractInjectionValueMetaData.class);
assertEquals(FromContext.CONTEXT, inject.getFromContext());
assertEquals("foobar", inject.getUnderlyingValue());
assertEquals(ControllerState.CREATE, inject.getDependentState());