Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
Automatic Mocking with Spring framework Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Automatic Mocking with Spring framework

    Hi,

    I am suppose to write unit testing code for my business layer by mocking DAO layer.

    I have tried to use the JMock API for this and i could inject the Mock DAO objects into the Business objects manually.

    But i thought that it is a dirty way to inject mock objects. The tough think i could face using JMock is in setting up the mock data and injecting the mock objects manually.

    As i am already using Spring framework for my application, i thought of making use of Spring for unit testing and automatically injecting DAO mock objects into BO objects while unit-testing.

    Is there a way to define mock objects, setting expectations for mock objects, maintaining test
    data
    using spring specifically using Spring configuration files. (in a configurable way)

    Hope iam clear on my requirement. Thanks in advance for your time and attention.
Working...
X