mardi 30 décembre 2014

Gradle dependency for tests only

I have a java project A and B.


For compile there is no dependency from A to B.


For testing, tests of A have a dependency to B.


Adding this to build.gradle of project A did not solve it:




dependencies {
...
testCompile project(':B')
}


Note: What I am trying to accomplish here is to write a test for a class in A(say ClassA) that requires an interface IX. I want to test ClassA with an implementation in project B(say ClassB implements IX), so actually this is kinda integration test.


I would appreciate any pointers for testing two(or more) projects that have no compile dependency but probable runtime dependency(for Java,Eclipse,Gradle).


Aucun commentaire:

Enregistrer un commentaire