0

I am trying to accomplish something fairly simple. I have a project that builds a war.

I am using the Gretty Plugin to deploy the war and run it on Jetty.

What I want to do is basically:

  1. Start the Jetty server
  2. Deploy the war
  3. Run the tests
  4. Stop the Jetty server

The gretty configuration supports 'integrationTestTask' that seems to do the following:

  1. Start the Jetty server
  2. Run the tests
  3. Stop the Jetty server

I can't figure out how to ensure the war is deployed before the tests are run.

When I do ./gradlew appStartWar - I can see my war is getting deployed and I am able to test it via curl/etc - but when I try run my automation tests there doesn't seem to be a way to do that...

I think I am missing something basic - but I am not sure what...any help will be greatly appreciated.

py y
  • 31
  • 1
  • 4

1 Answers1

0

I don't think this is supported in Gretty at the moment. Gretty starts the servlet container against the compiled classes, not against the war file. It does not execute the war task. Have a look at the "Uses WAR" column here:

http://akhikhl.github.io/gretty-doc/Gretty-tasks.html

If you can make your application run by executing ./gradlew appStart then the integrationTest task should work as expected too. You might need to put web.xml in src/main/webapp/WEB-INF or figure out how to configure its location outside the war {} configuration.

andersaa
  • 113
  • 9