Restart server on tests.

You should use new ServerConfigurationManager().restartGracefully() method. 
Once you restart the sever code coverage dump files will get overwritten, above mentioned method fixes it and restart the server in proper way. Other thing having 15s delay might not be enough in some cases.