Maven and python integration test set up

507 Views Asked by At

What I am trying to do

I currently have a Java project which leverage Maven as it's build system. In an effort to implement some integration test coverage, I've created a python test suite which runs my process, feeds data to it, and verifies that the results are all as expected.

This has worked well for me, however, I am struggling to properly set up the environment of my test suite. For the test suite to run correctly I need to be able to locate the JAR file of my executable and to determine the correct class path. Right now all of these things are hard coded to my workspace.

Workspace Layout

├── log
├── src
│   ├── integration-test
│   │   ├── python
│   │   └── resources
│   ├── main
│   │   ├── assembly
│   │   ├── env
│   │   ├── java
│   │   └── resources
│   └── test
│       ├── java
│       ├── resources
│       └── scripts
└── target
    ├── <Service JAR File>

Questions

  1. Currently I use maven to populate some property files with settings derived from the POM using the maven-resources-plugin. But this only seems to work with static settings. Is it possible to do something like this with a dynamic setting like the JAR name? Would this be the right way to get the jar file path to my integration test?
  2. What's the ideal way to tie my integration tests into the maven build process? Ideally after successful builds I would like to run my integration tests, just like the unit tests.`
0

There are 0 best solutions below