8

I am writing a set of integration tests and each test class start the server and stop the server, which takes long time. Is it possible to create a test suite, where a single instance of server can be used for a set of test classes?

Thanks, Manish

krmanish007
  • 6,749
  • 16
  • 58
  • 100
  • Assuming you are using JUnit, then the start and stop server actions can take place in the setup and teardown methods. All tests in the same class can then use the server instance. – kiwiron Mar 31 '16 at 08:50
  • 1
    You don't need setup or tear down, as Spring will do it for you. Question was about creating a set of classes under a single suite. – krmanish007 Mar 31 '16 at 09:02
  • http://stackoverflow.com/questions/6580670/testsuite-setup-in-junit-4 – Stefan Mar 31 '16 at 09:40
  • That a nice option, but it needs a different runner, and so we won't able to use spring runner. But its a good option if we want to run the test server manually. – krmanish007 Mar 31 '16 at 10:38
  • 1
    Possible duplicate of [If a Java EE application is designed to run in a Tomcat container, should all integration tests run in a similar container?](http://stackoverflow.com/questions/9657249/if-a-java-ee-application-is-designed-to-run-in-a-tomcat-container-should-all-in) – Paul Sweatte Dec 07 '16 at 16:57

0 Answers0