1

I have a webservice deployed on Glassfish (version 3.1.2.2). On startup a method is run (using @PostConstruct) that is to retrieve unfinished requests from a database and queue them for processing.

I would like to test the startup behavior of the server (whether all unfinished requests are retrieved, enqueued, finished, etc.). I mean an integration testing here, not unit testing. What would be the best approach to do that using JUnit?

I tried using an embedded container, but had not too much luck configuring it to use the same applications and configuration as the original instance of Glassfish. Should I give it a second try, or is there a better way to do that? Also, having another server instance would force me to use a different port for the new one which is quite an obstacle, because it would require my Jersey client to use different configuration depending on a test case being executed (it's not that bad though, can be worked around somehow).

I'll be grateful for any suggestions.

Wojtek
  • 2,514
  • 5
  • 26
  • 31

0 Answers0