Results 1 to 5 of 5

Thread: Is there TestNG integration for JavaConfig?

Hybrid View

  1. #1
    Join Date
    Oct 2008
    Location
    Cambridge, MA
    Posts
    56

    Default Is there TestNG integration for JavaConfig?

    Hello All,
    JavaConfig looks very promising and I can't wait to integrate it into my next project. Is there any TestNG integration?

    Presently I use AbstractTestNGSpringContextTests as well as XML config and <context: property-placeholder../> plus a properties file (for machine-specific information, like passwords).

    Are these features available in Spring JavaConfig?

    Thanks in Advance,
    Steven
    Last edited by JavaGeek_Boston; Oct 15th, 2008 at 01:15 PM.

  2. #2
    Join Date
    Oct 2008
    Posts
    3

    Default

    I'm also interested in these features...

  3. #3
    Join Date
    Oct 2008
    Posts
    3

    Default

    I wonder if you could use the "loader" attribute of @ContextConfiguration by writing a custom ContextLoader that returns your JavaConfigApplicationContext.

    I'll try this out over the next few days and post my results.

    Anyone else tried this?

  4. #4
    Join Date
    Apr 2007
    Posts
    307

    Default

    There is a JavaConfigContextLoader implementation in the latest m4 snapshots. This should get you what you're looking for.

    Steven, as to your question about property-placeholder, equivalent support is available with the combination of @PropertiesValueSource and @ExternalValue. Again, these are both available in the nightlies. See the javadoc and unit tests for examples of use. And, of course, feel free to ask questions here.
    Chris Beams
    Spring Framework committer, VMware
    http://github.com/cbeams

  5. #5
    Join Date
    Oct 2008
    Posts
    3

    Default

    Thanks Chris,

    I used some of the code from the m4 snapshot to write a custom ContextLoader and everything works great. I'll switch over to the correct loader once m4 is out.

Tags for this Thread

Posting Permissions

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