{
/*
* Resolve (based on contextual properties if specified)
*/
final Object resolvedVaue;
final ArquillianContext arquillianContext = this.getArquillianContext(context);
final Class<?> type = field.getType();
// If Properties are defined
if (field.isAnnotationPresent(Properties.class))
{
final Properties properties = field.getAnnotation(Properties.class);
resolvedVaue = arquillianContext.get(type, properties);
}
// If just one property is defined
else if (field.isAnnotationPresent(Property.class))
{
final Property property = field.getAnnotation(Property.class);
final Properties properties = new PropertiesImpl(new Property[]
{property});
resolvedVaue = arquillianContext.get(type, properties);
}
// No properties defined; do type-based resolution only
else
{
resolvedVaue = arquillianContext.get(type);
}
// Inject
field.set(testCase, resolvedVaue);
}