开发者

Integration testing environment set up with Maven with not embedable dependency

I would like to discuss scenario when the part of our product is not embedable in JVM but has to take part during integration testing.

Scenario: I am using Maven. My app uses following tools

A) Active MQ

B) Cassandra DB

C) CXF WebService.

Solution 1 to integration testing: I am lucky that all A B and C are embedable开发者_Go百科. So I could just mock up A B C in my JVM and use it. This obviously works but this is not what I would like to discuss.

Solution 2: Use Maven phases related to integration testing to setup whole enviro. So steps:

1a) package A, B, C binaries to module so that it can unpack and prepare these products in pre-integration-test phase (something like homemade Cargo) OR 1b) in pre-integration-test phase download these binaries from web and unpack etc etc (again emulating cargo project) 2) shut everything down in post-integration-test.

How to carry out the solution 2 with Maven? Is there any plugin that would help with downloading, unpacking (and remembering not downloading again on same machine?). How to start up and shut down ABC provided their's location is known? Which Maven plugin? Should I just use antrun plugin and create scripts that will start up ABC from command line and then somehow tear them down (i dont know how to do this maybe by killing processes)?


The Cargo team makes available some maven archetypes you might find helpful. Take a look especially at the Separate Functional Test Module Archetype, which includes a module dedicated to integration (functional) tests which does exactly what you describe:

  • uses cargo to deploy artifacts to an app container in the pre-integration-tests phase
  • artifacts can be either part of your reactor or normal dependencies
  • integration tests are executed
  • post-integration-tests phase is used to tear down the container

Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜