Skip to content

Commit

Permalink
GEODE-5987: Do not inject dependencies into all subprojects in test.g…
Browse files Browse the repository at this point in the history
…radle (apache#2782)

* Removed several unnecessary testCompile dependencies: 
* Moved other dependencies to those modules that require them (and are not having them leaked by other project modules)
* Injection of testRuntime dependency on cglib to be addressed in a future commit.
  • Loading branch information
PurelyApplied authored Nov 6, 2018
1 parent 72a5b0b commit 10df202
Show file tree
Hide file tree
Showing 15 changed files with 79 additions and 32 deletions.
2 changes: 2 additions & 0 deletions extensions/geode-modules/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ dependencies {
compile('org.slf4j:slf4j-api:' + project.'slf4j-api.version')

testCompile('org.apache.bcel:bcel:' + project.'bcel.version')
testCompile('junit:junit:' + project.'junit.version')
testCompile('org.assertj:assertj-core:' + project.'assertj-core.version')

integrationTestCompile('junit:junit:' + project.'junit.version')

Expand Down
3 changes: 3 additions & 0 deletions geode-assembly/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ dependencies {


distributedTestCompile(project(':geode-core'))
distributedTestCompile(project(':geode-dunit')){
exclude module: 'geode-core'
}
distributedTestCompile(project(':extensions:session-testing-war'))
distributedTestCompile(project(':geode-assembly:geode-assembly-test'))
distributedTestCompile('org.apache.httpcomponents:httpclient:' + project.'httpclient.version')
Expand Down
5 changes: 5 additions & 0 deletions geode-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

dependencies {
testCompile('junit:junit:' + project.'junit.version')
testCompile('org.assertj:assertj-core:' + project.'assertj-core.version')
}
5 changes: 5 additions & 0 deletions geode-connectors/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ dependencies {
distributedTestCompile(project(':geode-junit')) {
exclude module: 'geode-core'
}
distributedTestCompile(project(':geode-dunit')){
exclude module: 'geode-core'
}
acceptanceTestCompile(project(':geode-dunit')) {
exclude module: 'geode-core'
}
Expand All @@ -63,6 +66,7 @@ dependencies {
ext.optional = true
}

testCompile('pl.pragmatists:JUnitParams:' + project.'JUnitParams.version')

integrationTestCompile('junit:junit:' + project.'junit.version')
integrationTestCompile('junit:junit:4.12')
Expand All @@ -80,6 +84,7 @@ dependencies {
acceptanceTestCompile('org.awaitility:awaitility:' + project.'awaitility.version')
acceptanceTestCompile('org.mockito:mockito-core:' + project.'mockito-core.version')
acceptanceTestCompile(group: 'com.palantir.docker.compose', name: 'docker-compose-rule-core', version: '0.31.1')

acceptanceTestCompile(group: 'com.palantir.docker.compose', name: 'docker-compose-rule-junit4', version: '0.31.1')

acceptanceTestRuntime(group: 'mysql', name: 'mysql-connector-java', version: '5.1.46')
Expand Down
8 changes: 8 additions & 0 deletions geode-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ dependencies {
testCompile('org.mockito:mockito-core:' + project.'mockito-core.version')
testCompile('org.springframework:spring-test:' + project.'springframework.version')
testCompile('com.pholser:junit-quickcheck-core:' + project.'junit-quickcheck.version')
testCompile('org.powermock:powermock-core:' + project.'powermock.version')
testCompile('org.powermock:powermock-module-junit4:' + project.'powermock.version')
testCompile('org.powermock:powermock-api-mockito2:' + project.'powermock.version')
testCompile('pl.pragmatists:JUnitParams:' + project.'JUnitParams.version')

testCompile files("${System.getProperty('java.home')}/../lib/tools.jar")

testRuntime('commons-collections:commons-collections:' + project.'commons-collections.version')
Expand All @@ -287,6 +292,9 @@ dependencies {
integrationTestCompile('org.apache.bcel:bcel:' + project.'bcel.version')
integrationTestCompile('org.apache.logging.log4j:log4j-core:' + project.'log4j.version' + ':tests')
integrationTestCompile('org.apache.logging.log4j:log4j-core:' + project.'log4j.version' + ':test-sources')
integrationTestCompile('org.powermock:powermock-core:' + project.'powermock.version')
integrationTestCompile('org.powermock:powermock-module-junit4:' + project.'powermock.version')
integrationTestCompile('org.powermock:powermock-api-mockito2:' + project.'powermock.version')
integrationTestCompile('org.springframework:spring-test:' + project.'springframework.version')
integrationTestCompile('net.spy:spymemcached:' + project.'spymemcached.version')
integrationTestCompile('pl.pragmatists:JUnitParams:' + project.'JUnitParams.version')
Expand Down
3 changes: 3 additions & 0 deletions geode-cq/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ dependencies {
distributedTestCompile(project(':geode-junit')) {
exclude module: 'geode-core'
}
distributedTestCompile(project(':geode-dunit')){
exclude module: 'geode-core'
}
upgradeTestCompile(project(':geode-dunit')) {
exclude module: 'geode-core'
}
Expand Down
2 changes: 2 additions & 0 deletions geode-junit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ dependencies {

compile('org.bouncycastle:bcpkix-jdk15on:' + project.'bouncycastle.version')

testCompile('pl.pragmatists:JUnitParams:' + project.'JUnitParams.version')

runtimeOnly(project(':geode-old-versions'))
}

Expand Down
9 changes: 9 additions & 0 deletions geode-lucene/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ dependencies {
distributedTestCompile('org.hamcrest:hamcrest-library:' + project.'hamcrest-all.version')

testCompile('com.carrotsearch.randomizedtesting:randomizedtesting-runner:' + project.'carrotsearch.version')
testCompile('org.powermock:powermock-core:' + project.'powermock.version')
testCompile('org.powermock:powermock-module-junit4:' + project.'powermock.version')
testCompile('org.powermock:powermock-api-mockito2:' + project.'powermock.version')

upgradeTestCompile('commons-io:commons-io:' + project.'commons-io.version')

testCompile(project(':geode-junit')) {
Expand All @@ -58,6 +62,8 @@ dependencies {
testCompile('org.apache.lucene:lucene-test-framework:' + project.'lucene.version')
testCompile('com.pholser:junit-quickcheck-generators:' + project.'junit-quickcheck.version')

testCompile('pl.pragmatists:JUnitParams:' + project.'JUnitParams.version')


integrationTestCompile(project(':geode-dunit')) {
exclude module: 'geode-core'
Expand All @@ -69,6 +75,9 @@ dependencies {

distributedTestCompile(project(':geode-lucene:geode-lucene-test'))
distributedTestCompile('pl.pragmatists:JUnitParams:' + project.'JUnitParams.version')
distributedTestCompile(project(':geode-dunit')){
exclude module: 'geode-core'
}


upgradeTestCompile(project(':geode-dunit')) {
Expand Down
7 changes: 6 additions & 1 deletion geode-old-client-support/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
*/

dependencies {
distributedTestCompile('junit:junit:' + project.'junit.version')
compile(project(':geode-core'))
distributedTestCompile(project(':geode-dunit')){
exclude module: 'geode-core'
}


distributedTestCompile('junit:junit:' + project.'junit.version')
}
3 changes: 3 additions & 0 deletions geode-protobuf/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ dependencies {
exclude module: 'geode-core'
}
integrationTestCompile(project(':geode-protobuf:geode-protobuf-test'))
distributedTestCompile(project(':geode-dunit')){
exclude module: 'geode-core'
}
distributedTestCompile(project(':geode-junit')) {
exclude module: 'geode-core'
}
Expand Down
22 changes: 15 additions & 7 deletions geode-pulse/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ dependencies {
compile('commons-digester:commons-digester:' + project.'commons-digester.version')
compile('commons-lang:commons-lang:' + project.'commons-lang.version')
compile('org.springframework.ldap:spring-ldap-core:' + project.'spring-ldap-core.version')
runtimeOnly('org.springframework:spring-expression:' + project.'springframework.version')

// added only to ensure common version with other geode modules
runtimeOnly('org.slf4j:slf4j-api:' + project.'slf4j-api.version')


compile('org.springframework.security:spring-security-config:' + project.'spring-security.version') {
exclude module: 'aopalliance'
exclude module: 'spring-expression'
Expand Down Expand Up @@ -61,23 +57,35 @@ dependencies {
compile('com.fasterxml.jackson.core:jackson-core:' + project.'jackson.version')
compile('com.fasterxml.jackson.core:jackson-databind:' + project.'jackson.version')

providedCompile('commons-logging:commons-logging:' + project.'commons-logging.version')

compileOnly('org.mortbay.jetty:servlet-api:' + project.'mortbay-jetty-servlet-api.version')

runtimeOnly('org.springframework:spring-expression:' + project.'springframework.version')

// added only to ensure common version with other geode modules
runtimeOnly('org.slf4j:slf4j-api:' + project.'slf4j-api.version')

providedCompile('commons-logging:commons-logging:' + project.'commons-logging.version')


testCompile(project(':geode-junit')) {
exclude module: 'geode-core'
}
testCompile(project(':geode-core'))
testCompile('org.springframework:spring-test:' + project.'springframework.version')
testCompile('org.powermock:powermock-core:' + project.'powermock.version')
testCompile('org.powermock:powermock-module-junit4:' + project.'powermock.version')
testCompile('org.powermock:powermock-api-mockito2:' + project.'powermock.version')



integrationTestCompile(project(':geode-junit')) {
exclude module: 'geode-core'
}
integrationTestCompile(project(':geode-core'))
integrationTestCompile(project(':geode-pulse:geode-pulse-test'))
integrationTestCompile('org.powermock:powermock-core:' + project.'powermock.version')
integrationTestCompile('org.powermock:powermock-module-junit4:' + project.'powermock.version')
integrationTestCompile('org.powermock:powermock-api-mockito2:' + project.'powermock.version')
integrationTestCompile('org.springframework:spring-test:' + project.'springframework.version')


Expand Down
7 changes: 7 additions & 0 deletions geode-rebalancer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ dependencies {
exclude module: 'spring-expression'
exclude module: 'spring-aop'
}


testCompile('org.assertj:assertj-core:' + project.'assertj-core.version')
testCompile('org.powermock:powermock-core:' + project.'powermock.version')
testCompile('org.powermock:powermock-module-junit4:' + project.'powermock.version')
testCompile('org.powermock:powermock-api-mockito2:' + project.'powermock.version')

integrationTestCompile('junit:junit:' + project.'junit.version')
integrationTestCompile('junit:junit:' + project.'junit.version')
integrationTestCompile('org.awaitility:awaitility:' + project.'awaitility.version')
integrationTestCompile('org.hamcrest:hamcrest-all:' + project.'hamcrest-all.version')
Expand Down
3 changes: 3 additions & 0 deletions geode-wan/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ dependencies {
integrationTestCompile(project(':geode-junit')) {
exclude module: 'geode-core'
}
distributedTestCompile(project(':geode-dunit')){
exclude module: 'geode-core'
}
upgradeTestCompile(project(':geode-dunit')) {
exclude module: 'geode-core'
}
Expand Down
3 changes: 3 additions & 0 deletions geode-web/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ dependencies {
}


distributedTestCompile(project(':geode-dunit')){
exclude module: 'geode-core'
}
distributedTestCompile('pl.pragmatists:JUnitParams:' + project.'JUnitParams.version')

distributedTestRuntime(files(war.destinationDir))
Expand Down
29 changes: 5 additions & 24 deletions gradle/test.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ subprojects {
}

dependencies {
// Do not add dependencies here that are not part of a custom configuration.
// Dependencies should be explicit in the relevant build.gradle files to keep our modules
// as decoupled as possible.

// This 'apt' configuration to be removed by GEODE-5606.
apt files("${rootProject.projectDir}/buildSrc/build/libs/buildSrc.jar")
apt(group: 'junit', name: 'junit', version: project.'junit.version') {
transitive = false
Expand All @@ -113,33 +118,9 @@ subprojects {
transitive = false
}

testCompile('com.github.stefanbirkner:system-rules:' + project.'system-rules.version') {
exclude module: 'junit-dep'
}
testCompile 'com.google.code.tempus-fugit:tempus-fugit:' + project.'tempus-fugit.version'
testCompile 'org.awaitility:awaitility:' + project.'awaitility.version'
testCompile 'junit:junit:' + project.'junit.version'
testCompile 'org.assertj:assertj-core:' + project.'assertj-core.version'
testCompile 'org.hamcrest:hamcrest-all:' + project.'hamcrest-all.version'

testCompile 'org.mockito:mockito-core:' + project.'mockito-core.version'
testCompile 'org.powermock:powermock-core:' + project.'powermock.version'
testCompile 'org.powermock:powermock-module-junit4:' + project.'powermock.version'
testCompile 'org.powermock:powermock-api-mockito2:' + project.'powermock.version'

testCompile 'pl.pragmatists:JUnitParams:' + project.'JUnitParams.version'

testRuntime('cglib:cglib:' + project.'cglib.version') {
exclude module: 'org.apache.ant'
}

integrationTestCompile 'org.mockito:mockito-core:' + project.'mockito-core.version'

integrationTestCompile 'org.powermock:powermock-core:' + project.'powermock.version'
integrationTestCompile 'org.powermock:powermock-module-junit4:' + project.'powermock.version'
integrationTestCompile 'org.powermock:powermock-api-mockito2:' + project.'powermock.version'

distributedTestCompile project(":geode-dunit")
}

configure([integrationTest, distributedTest, performanceTest, acceptanceTest, uiTest,
Expand Down

0 comments on commit 10df202

Please sign in to comment.