public JUnitImplementation load(XMLStreamReader reader, IntrospectionContext context) throws XMLStreamException {
String className = reader.getAttributeValue(null, "class");
JUnitImplementation implementation = new JUnitImplementation(className);
validateAttributes(reader, context, implementation);
InjectingComponentType componentType = implementationProcessor.introspect(className, context);
implementation.setComponentType(componentType);
ContextConfiguration configuration = loadConfiguration(reader, implementation, context);
for (AbstractService serviceDefinition : implementation.getComponentType().getServices().values()) {
if (serviceDefinition.getServiceContract().getQualifiedInterfaceName().equals(implementation.getImplementationClass())) {
JUnitBindingDefinition bindingDefinition = new JUnitBindingDefinition(configuration);
serviceDefinition.addBinding(bindingDefinition);
break;
}
}
return implementation;
}