0

I have REST client/server application based on a Jetty Servlet That I deploy on Tomcat. The client and servers and two different modules.

I have also created a third module (webapp-tests) that is only responsible for launching integration tests.

I would like to deploy several instances of the "war" created by the server module by using the "Cargo" plugin, before running the tests.

Indeed, I have a configuration file located in 'WEB-INF/' that contains some settings (like MySQL connection settings, timouts, etc ...). And I would like to alter this config file within the WAR file before deploying it with Cargo, with several flavours of configuration (several MySQL versions, ..., etc)

Do you have an idea of how I can manage this.

Thanks in advance for your help, Best regards,

Raphael

Community
  • 1
  • 1
Raphael Jolivet
  • 3,940
  • 5
  • 36
  • 56
  • Hm..Integration Test against a database very good, but why would you like to test against different databases? What would you like to test or what would you like to proove with it? – khmarbaise Mar 15 '11 at 10:55
  • BTW, I have serveral schemas filled with different sets of test data. I would like the different webapps to points to those different datasets to test different cases. And anyway, I would like to ship my standard packaged WAR with dummy / example parameters for the config files, and to override them with custom integration-test Settings afterwards : Our partners shouldn't have connection info / passwords, etc of our internal, integration databases. I've heard also about overlays for the WAR plugin, but I don't know how to mix it with cargo deployment. – Raphael Jolivet Mar 17 '11 at 09:39

1 Answers1

1

In the integration test module you can use the dependency-plugin to get the dependency (war-file) and decompress the war file and replace the configuration file and run the integration test. It's only depending how often you call the integration tests...

khmarbaise
  • 92,914
  • 28
  • 189
  • 235
  • Hi, thanks for your answer. I have found how to copy / unpack the dependency, but not how to alter / repackage a war file with custom config file resources: http://maven.apache.org/plugins/maven-dependency-plugin/examples/copying-artifacts.html Am I missing something ? Do you have an example of such a configuration ? Thanks in advance. Raphael – Raphael Jolivet Mar 16 '11 at 14:43
  • Use the assembly plugin to repackage your war file. Sorry don't have an example for that. – khmarbaise Mar 16 '11 at 15:16