Setting a server for JWebunit Tests

151 Views Asked by At

I'm using JwebUnit to test my JSP pages in a web application. Since JWebUnit requires a base urlto work. JwebUnit has setBaseUrl("http://localhost:8080/MyWebapp"); to set the base url which is used @Beforeof Junit Test. I need to start a server and deploy the webapp there before each test and stop the server after that. Can anyone please suggest me a simple way to do this with Jetty or other options...

1

There are 1 best solutions below

0
On

You may have a look at Server Rule. It provides a JUnit rule that starts and stops a Jetty web server.