You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Chi Kim (JIRA)" <ji...@apache.org> on 2016/11/15 22:04:58 UTC

[jira] [Commented] (CAMEL-10484) AbstractCamelTestNGSpringContextTests does not support JavaConfig

    [ https://issues.apache.org/jira/browse/CAMEL-10484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15668531#comment-15668531 ] 

Chi Kim commented on CAMEL-10484:
---------------------------------

Like you said, JUnit ones work flawlessly,  it would be nice to see that support for TestNG is deprecated in the documentation.
Thank you.

> 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)