Chi Kim created CAMEL-10484:
-------------------------------
Summary: AbstractCamelTestNGSpringContextTests does not support
JavaConfig
Key: CAMEL-10484
URL: https://issues.apache.org/jira/browse/CAMEL-10484
Project: Camel
Issue Type: Bug
Components: camel-test
Affects Versions: 2.17.3
Reporter: Chi Kim
Priority: Minor
AbstractCamelTestNGSpringContextTests seems to only support xml configuration.
It uses CamelSpringTestContextLoader to load the context which only load bean
definition using XmlBeanDefinitionReader.
{code}
public class CamelSpringTestContextLoader extends AbstractContextLoader {
...
@Override
public ApplicationContext loadContext(MergedContextConfiguration
mergedConfig) throws Exception {
Class<?> testClass = getTestClass();
if (LOG.isDebugEnabled()) {
LOG.debug("Loading ApplicationContext for merged context
configuration [{}].", mergedConfig);
}
try {
GenericApplicationContext context = createContext(testClass,
mergedConfig);
context.getEnvironment().setActiveProfiles(mergedConfig.getActiveProfiles());
loadBeanDefinitions(context, mergedConfig);
return loadContext(context, testClass);
} finally {
cleanup(testClass);
}
}
...
protected void loadBeanDefinitions(GenericApplicationContext context,
MergedContextConfiguration mergedConfig) {
(new
XmlBeanDefinitionReader(context)).loadBeanDefinitions(mergedConfig.getLocations());
}
...
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)