maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <>
Subject RE: Need advice automating a Java test suite.
Date Thu, 09 Jan 2014 00:44:32 GMT


> Date: Wed, 8 Jan 2014 17:08:53 -0500
> Subject: Need advice automating a Java test suite.
> From:
> To:
> Hello,
> We have a java multi-module project that has a somewhat painful to run test
> suite that I would like to get under control using Maven.
> Currently it takes 5 separate Maven commands to setup, run, and teardown
> all the tests and test databases. I'd like to get this down to one command.
> Also I would like this structured so that individual parts of the process
> can be run separately to aid in debugging problems.
> The pom has 1 profile for each part of the task, all bound to the "test"
> goal:
MG>My initial thought was to bind each profile-group to different phases
MG>that way the reactor will govern the execution order of who gets executed first (mvn
MG>which profile gets executed second (mvn generate-test-sources) 
MG>and finally last profile gets executed (mvn package)
MG>the problem is you have alot of testcases to run so perhaps running a string of profiles
maybe the answer
> mvn clean test -P test-setup-1,local-enterprise-test-db (exec:java plugin
> to setup up a database)
> mvn test -P test-setup-2,local-enterprise-test-db (exec:java
> plugin to setup up a 2nd database)
> mvn test -P test-design,local-enterprise-test-db (surefire
> plugin to run a subset of the tests with maven properties set)
> mvn test -P test-transactional,local-enterprise-test-db (surefire plugin
> to run a different subset of the tests with different maven properties set)

> mvn test -P test-tear-down,local-enterprise-test-db (exec:java
> plugin to teardown the databases)
MG>Off the top of my head i would setup a 'marker file' for the successful completion of
each Profile
MG>When marker file from Profile1 exists trigger Profile 2 
MG>When marker file from Profile2 exists trigger Profile3
MG>mvn help:active-profiles -P Profile1,Profile2,Profile3 

> The problem I am running into is how to get this organized so that it all
> happens with 1 command. It seems nearly unpossible.
> Can anyone offer any advice on how to accomplish this? Pointer to relevant
> articles, blog posts, stackoverflow questions would be most appreciated.
> Thanks!
> -Todd
MG>assuming the IDentifiers are unique (and presence of marker files are unique) synchronous
profile execution *should* work
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message