Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6349023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:32:03+00:00 2026-05-24T21:32:03+00:00

It is explained here how combining java & xml configuration is done. It works.

  • 0

It is explained here how combining java & xml configuration is done. It works. Test Context framework has java config support since 3.1.0.M2 :

@ContextConfiguration(loader = AnnotationConfigContextLoader.class)
public class LangDetectorTest extends AbstractTestNGSpringContextTests {
@Configuration
    static class ContextConfiguration {

        @Bean
        public LangDetector langDetector() throws SystemException {
            LangDetector orderService = new LangDetector();
            return orderService;
        }
    }
}

Though I can’t figure out how to have java config as the main configuration and load something like util:properties and stuff from XML configuration.

I’d need to do somwthing like this:

@ContextConfiguration(loader = AnnotationConfigContextLoader.class)
@ImportResource("classpath:context/LangDetectorTest-test.xml")
public class LangDetectorTest extends AbstractTestNGSpringContextTests {

    @Configuration
        static class ContextConfiguration {

            @Bean
            public LangDetector langDetector() throws SystemException {
                LangDetector orderService = new LangDetector();
                return orderService;
            }
        }
    }

Otherwise java config support for Test Context framework is useless, considering that there are tons of things that can be done only via XML configuration.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:32:04+00:00Added an answer on May 24, 2026 at 9:32 pm

    Quoting from springsource blog post :

    For Spring 3.1 RC1 we plan to introduce a
    DelegatingSmartContextLoader that will delegate to a list of candidate
    SmartContextLoaders (i.e., GenericXmlContextLoader and
    AnnotationConfigContextLoader) to determine which context loader is
    appropriate for a given test class’s configuration. The winning
    candidate will then be used to actually load the context. Once this
    work is complete, DelegatingSmartContextLoader will replace
    GenericXmlContextLoader as the default loader. Feel free to follow the
    progress of this development in JIRA: SPR-8387.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried creating a test plan as explained here . But the only problem
I'm trying to use embedded ActiveMQ broker for unit testing, as explained here: http://activemq.apache.org/how-to-unit-test-jms-code.html
Git's pull output has been explained here fairly well. In spite of this I'm
As explained here , Math.Ceiling returns: The smallest integral value that is greater than
The singleton is explained here: http://en.wikipedia.org/wiki/Singleton_pattern#PHP_5 . I want to use the singleton class
Here is a snippet of CSS that I need explained: #section { width: 860px;
I've updated php.ini and moved php_mysql.dll as explained in steps 6 and 8 here.
I've seen several similar scenarios explained here but not my particular one. I wonder
How to set the values for filter is explained here link text . I
I implemented customized rating bar as explained here How to create Custom Ratings bar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.