• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to automate testing with database/web servers

 
Siegfried Heintze
Ranch Hand
Posts: 408
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way my junit test can
(1) check to see if mysql or hsql is running and if not start one?
(2) check to see if tomcat or jetty is running if not start one?
Thanks,
Siegfried
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could look at Cargo for some help with starting and stopping Tomcat. For the database, I'd suggest starting up an in-memory HSQLDB rather than relying on the underlying system to have such things installed/running.
 
Siegfried Heintze
Ranch Hand
Posts: 408
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't I have to start and stop HSQL just like any other database (except MSAccess)?

Thanks,
Siegfried
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is quite easy to start an in memory HSQLDB instance in the setup of a JUnit test.
 
Siegfried Heintze
Ranch Hand
Posts: 408
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is quite easy to start an in memory HSQLDB instance in the setup of a JUnit test.


Could you elaborate a bit? I assume I could turn it off too?
Thanks,
Siegfried
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Siegfried Heintze:
Could you elaborate a bit? I assume I could turn it off too?

Yes, you can. Check out this section of the documentation for details.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic