CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 38

Threaded View

  1. #27
    Join Date
    Apr 2007
    Posts
    425

    Re: How can I Initialize getJdbcTemplate()?

    Have you annotated your JUnit test class one way or another to tell it to load the application context that it needs to wire the beans that you plan to use for testing. I have a feeling that your job bean is probably null at this point.

    Code:
    @RunWith (SpringJUnit4ClassRunner.class)
    @ContextConfiguration (locations={"/application-context.xml"})
    assuming that you have an 'application-context.xml' in the same project, otherwise you have to use
    Code:
    classpath*:out-of-scope-context.xml
    note that these names application-context.xml and out-of-scope-context.xml need to match your contexts
    Last edited by Deliverance; October 26th, 2009 at 09:22 AM.
    ------
    If you are satisfied with the responses, add to the user's rep!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured