Results 1 to 2 of 2

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

  1. #1
    Join Date
    Aug 2004
    Posts
    15

    Default 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. #2
    Join Date
    Aug 2004
    Posts
    2,715

    Default 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

Similar Threads

  1. Replies: 4
    Last Post: Oct 26th, 2006, 02:20 AM
  2. Replies: 1
    Last Post: Jul 18th, 2005, 12:43 PM
  3. History tables and error logging
    By turgayz in forum AOP
    Replies: 4
    Last Post: Oct 12th, 2004, 11:55 AM

Posting Permissions

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