junit - Recompiling sources with a test specific jar -


i have multimodule project dependent on rather large thirdparty library/apis. not possible run automated junit tests actual library, since apis interact system external management of dev environment. workaround, created classes mocked interfaces/apis junits. use eclipse our ide development, run junits, move jar higher in classpath, recompile, run our junits, , works great.

looking similar solution moving maven. basically, after building our code, need rebuild of again using mock jar run junit tests. goes across modules of application. tried adding jar in test scope, used compiling test classes; sources classes still compiled real jar. however, fails @ runtime since our mock jar not match signatures of real jar (so hot swap of jar doesn't work; making signatures match large undertaking). source needs recompiled jar.

so appears there 2 options: 1) make standalone test module somehow pulls in source modules code , recompiles using mock jar , runs tests or 2) each module creates testjar in addition installable jar compiled mock jar, used dependent modules during test phase.

please advise. examples of how either of above appreciated.

check out link. think has need. can handle using 2 maven profiles. according can have different dependencies each profile.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -