Rince
Rince

Reputation: 2325

Automatically start jetty when running acceptance tests from IntelliJ IDEA

I have a bunch of acceptance tests that need the application to be running. It all works fine when I test from command line (thanks to some gradle magic) but I would like to be able to run these tests from IntelliJ IDEA without worrying about starting up Jetty.

Is there any clever way to achieve that automation? I do not even know where to begin.

Thank you very much.

Upvotes: 2

Views: 431

Answers (2)

Thomas Becker
Thomas Becker

Reputation: 944

For testing purposes it's generally a good idea to use jetty embedded. That way you can fully automate start/stop of jetty and it will work completely independent from build tools/ide.

It's really simple. With few lines of code you have a full featured jetty configured and running for testing.

This is one of the most beloved features of jetty. Have a look at this: http://www.eclipse.org/jetty/documentation/current/advanced-embedding.html

Upvotes: 1

CrazyCoder
CrazyCoder

Reputation: 402235

You can do it with Maven/Ant, other Run configurations, but not Gradle at the moment, at least until this feature request is implemented.

Upvotes: 1

Related Questions