Announcement Announcement Module
Collapse
No announcement yet.
Spring/Hib : Simulate a database down for test purposes... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring/Hib : Simulate a database down for test purposes...

    Hi,

    I'm using Spring/Hibernate and for test purposes, i'd like to simulate that my database is down, i don't want to modify my config Spring file because it's only few test among many others

    does anybody know a Spring class which i could call in my testcase to simulate it ?

    Thanks,

    Fabrice

  • #2
    Re: Spring/Hib : Simulate a database down for test purposes.

    I do not think that there is a ready to use spring class for this purpose. However, if I'd like to simulate an unreachable database I would do the following:
    1) Find out the reaction of the application if the database is really down. This would cause an exception of some kind.
    2) Write a special DAO implementation which throws this exception on the operation to test.
    3) Configure this DAO for my tests

    Hope that helps,
    Andreas

    Comment

    Working...
    X