Skip to content

Commit

Permalink
GEODE-5002: Create geode-test sub-module (apache#1867)
Browse files Browse the repository at this point in the history
  * created new gradle module to hold test framework
  * moved dunit test framework into geode-test
  * merged geode-junit and geode-old-versions into geode-test
  * modified each module's gradle build script to consider geode-test
  * changes necessary to support idea and eclipse IDEs
  • Loading branch information
sboorlagadda authored May 16, 2018
1 parent 324d066 commit 10563d6
Show file tree
Hide file tree
Showing 264 changed files with 204 additions and 230 deletions.
2 changes: 1 addition & 1 deletion extensions/geode-modules-session/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
exclude group: 'javax.servlet'
}

testCompile project(path: ':geode-junit')
testCompile project(path: ':geode-test', configuration: 'runtime')
}

jar {
Expand Down
6 changes: 3 additions & 3 deletions extensions/geode-modules-tomcat7/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ dependencies {
testRuntime 'javax.servlet:javax.servlet-api:' + project.'javax.servlet-api.version'
testRuntime 'org.eclipse.persistence:javax.persistence:' + project.'javax.persistence-api.version'

testCompile project(path: ':geode-junit')
testCompile files(project(':geode-core').sourceSets.test.output)
testCompile files(project(':extensions/geode-modules').sourceSets.test.output)
testCompile project(path: ':geode-core', configuration: 'testOutput')
testCompile project(path: ':geode-test', configuration: 'runtime')
testCompile project(path: ':extensions/geode-modules', configuration: 'testOutput')

eclipse.classpath.file {
whenMerged { classpath ->
Expand Down
9 changes: 4 additions & 5 deletions extensions/geode-modules-tomcat8/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ dependencies {
testRuntime 'org.eclipse.persistence:javax.persistence:' + project.'javax.persistence-api.version'
testCompile 'javax.security.auth.message:javax.security.auth.message-api:' + '1.1'

testCompile project(path: ':geode-junit')
testCompile files(project(':geode-core').sourceSets.test.output)
testCompile files(project(':extensions/geode-modules').sourceSets.test.output)
testCompile files(project(':geode-old-versions').sourceSets.main.output)
testCompile project(path: ':geode-core', configuration: 'testOutput')
testCompile project(path: ':geode-test', configuration: 'runtime')
testCompile project(path: ':extensions/geode-modules', configuration: 'testOutput')

eclipse.classpath.file {
whenMerged { classpath ->
Expand All @@ -50,4 +49,4 @@ dependencies {
}
}

disableMavenPublishing()
disableMavenPublishing()
6 changes: 3 additions & 3 deletions extensions/geode-modules/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

dependencies {
compile project(':geode-core')

compile 'org.slf4j:slf4j-api:' + project.'slf4j-api.version'
compile ('org.apache.tomcat:catalina-ha:' + project.'tomcat6.version') {
exclude module: 'annotations-api'
Expand All @@ -30,8 +30,8 @@ dependencies {
testCompile 'org.httpunit:httpunit:' + project.'httpunit.version'
testRuntime 'org.apache.tomcat:coyote:' + project.'tomcat6.version'

testCompile project(path: ':geode-junit')
testCompile files(project(':geode-core').sourceSets.test.output)
testCompile project(path: ':geode-core', configuration: 'testOutput')
testCompile project(path: ':geode-test', configuration: 'runtime')
}

disableMavenPublishing()
28 changes: 13 additions & 15 deletions geode-assembly/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ dependencies {
archives project(':geode-cq')
archives project(':geode-rebalancer')

testCompile project(':geode-junit')
testCompile project(':geode-pulse')
testCompile files(project(':geode-core').sourceSets.test.output)
testCompile files(project(':geode-pulse').sourceSets.test.output)
testCompile project(path: ':geode-core', configuration: 'testClassesOutput')
testCompile project(path: ':geode-test', configuration: 'runtime')
testCompile project(path: ':geode-pulse', configuration: 'testClassesOutput')
testCompile ('org.springframework:spring-web:' + project.'springframework.version') {
exclude module: 'aopalliance'
exclude module: 'spring-aop'
Expand Down Expand Up @@ -108,8 +108,6 @@ dependencies {
exclude module: 'spring-core'
exclude module: 'commons-logging'
}

testCompile files(project(':geode-old-versions').sourceSets.main.output)
}

sourceSets {
Expand All @@ -133,7 +131,7 @@ task defaultDistributionConfig(type: JavaExec, dependsOn: classes) {
main 'org.apache.geode.distributed.internal.DefaultPropertiesGenerator'
classpath project(':geode-core').sourceSets.main.runtimeClasspath
workingDir buildDir

doFirst {
buildDir.mkdirs()
}
Expand Down Expand Up @@ -231,7 +229,7 @@ task depsJar (type: Jar, dependsOn: ':geode-core:classes') {
description 'Assembles the jar archive that defines the gemfire classpath.'
archiveName 'geode-dependencies.jar'
doFirst {
manifest {
manifest {
attributes("Class-Path": cp())
}
}
Expand All @@ -244,7 +242,7 @@ task gfshDepsJar (type: Jar, dependsOn: ':geode-core:classes') {
archiveName 'gfsh-dependencies.jar'
doFirst {
manifest {
attributes("Class-Path": cp() +
attributes("Class-Path": cp() +
' ' + project(':geode-core').webJar.archiveName +
' ' + configurations.gfshDependencies.collect{ it.getName() }.flatten().join(' ')
)
Expand Down Expand Up @@ -340,7 +338,7 @@ distributions {
contents {
duplicatesStrategy 'exclude'
exclude '*.asc'

exclude '*.asc'
exclude '*-sources.jar'
exclude '*-javadoc.jar'
Expand All @@ -351,10 +349,10 @@ distributions {
from defaultCacheConfig
from defaultDistributionConfig
from (project(':geode-core').sourceSets.main.resources.files.find {
it.name == 'log4j2.xml'
it.name == 'log4j2.xml'
})
}

into ('lib') {
from project(":geode-common").configurations.runtime
from project(":geode-common").configurations.archives.allArtifacts.files
Expand All @@ -373,10 +371,10 @@ distributions {

from project(":geode-lucene").configurations.runtime
from project(":geode-lucene").configurations.archives.allArtifacts.files

from project(":geode-connectors").configurations.runtime
from project(":geode-connectors").configurations.archives.allArtifacts.files

from project(":geode-old-client-support").configurations.runtime
from project(":geode-old-client-support").configurations.archives.allArtifacts.files

Expand Down Expand Up @@ -459,11 +457,11 @@ build.dependsOn installDist

installDist.dependsOn ':extensions/geode-modules-assembly:dist'
distributedTest.dependsOn ':extensions/session-testing-war:war'
distributedTest.dependsOn ':geode-old-versions:build'
distributedTest.dependsOn ':geode-test:build'

/**Print the names of all jar files in a fileTree */
def printJars(tree) {
tree.matching {include("**/*.jar")}.visit{ file ->
tree.matching {include("**/*.jar")}.visit{ file ->
if(!file.isDirectory()) {
println file.name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void checkGfshDefault() {
@Test
public void checkGfsh130() {
assertThat(gfsh130.getGfshPath().toString())
.contains("geode-old-versions/build/apache-geode-1.3.0/bin/gfsh");
.contains("geode-test/build/apache-geode-1.3.0/bin/gfsh");
}

}
2 changes: 1 addition & 1 deletion geode-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
*/

dependencies {
testCompile project(':geode-junit')
testCompile project(':geode-test')
}
7 changes: 2 additions & 5 deletions geode-connectors/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,15 @@ dependencies {
compile project(':geode-common')
compile group: 'com.zaxxer', name: 'HikariCP', version: project.'HikariCP.version'


testCompile project(':geode-junit')

//Connectors test framework.
testRuntime 'org.apache.derby:derby:' + project.'derby.version'
testCompile group: 'mysql', name: 'mysql-connector-java', version: '5.1.46'
testCompile group: 'org.postgresql', name: 'postgresql', version: '42.2.2'
testCompile 'com.palantir.docker.compose:docker-compose-rule-junit4:0.31.1'
testCompile 'com.pholser:junit-quickcheck-core:' + project.'junit-quickcheck.version'
testCompile 'com.pholser:junit-quickcheck-generators:' + project.'junit-quickcheck.version'
testCompile files(project(':geode-core').sourceSets.test.output)
testCompile files(project(':geode-old-versions').sourceSets.main.output)
testCompile project(path: ':geode-core', configuration: 'testClassesOutput')
testCompile project(path: ':geode-test', configuration: 'runtime')
}

integrationTest.forkEvery 0
33 changes: 15 additions & 18 deletions geode-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@ sourceSets {
}
}



configurations {
//declaring new configuration that will be used to associate with artifacts
archives
classesOutput {
extendsFrom compile
description 'a dependency that exposes the compiled classes'
}
testClassesOutput {
extendsFrom compile
description 'a dependency that exposes the compiled test classes'
}
}

dependencies {
Expand Down Expand Up @@ -130,11 +136,11 @@ dependencies {

jcaCompile sourceSets.main.output

testCompile project(':geode-junit')

testCompile files(project(':geode-old-versions').sourceSets.main.output)

// Test Dependencies
testCompile(project(path: ':geode-test')) {
transitive = false
}

// External
testCompile 'com.jayway.jsonpath:json-path-assert:' + project.'json-path-assert.version'
testCompile 'org.apache.bcel:bcel:' + project.'bcel.version'
Expand All @@ -155,6 +161,9 @@ dependencies {

testRuntime 'xerces:xercesImpl:' + project.'xercesImpl.version'
testCompile project(':geode-concurrency-test')

classesOutput sourceSets.main.output
testClassesOutput sourceSets.test.output
}

def generatedResources = "$buildDir/generated-resources/main"
Expand Down Expand Up @@ -229,16 +238,4 @@ task jcaJar (type: Jar, dependsOn: raJar) {
from raJar.archivePath
}

configurations {
classesOutput {
extendsFrom compile
description 'a dependency that exposes the compiled classes'
}
}

dependencies {
classesOutput sourceSets.main.output
}

tasks.eclipse.dependsOn(generateGrammarSource)

5 changes: 2 additions & 3 deletions geode-cq/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
dependencies {
provided project(':geode-core')

testCompile files(project(':geode-core').sourceSets.test.output)
testCompile files(project(':geode-old-versions').sourceSets.main.output)
testCompile project(':geode-junit')
testCompile project(path: ':geode-core', configuration: 'testClassesOutput')
testCompile project(path: ':geode-test', configuration: 'runtime')
}
4 changes: 2 additions & 2 deletions geode-experimental-driver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {

compile 'com.google.protobuf:protobuf-java:' + project.'protobuf-java.version'
testCompile project(':geode-core')
testCompile project(':geode-junit')
testCompile project(':geode-test')
testCompile project(':geode-protobuf')
testCompile files(project(':geode-core').sourceSets.test.output)
testCompile project(path: ':geode-core', configuration: 'testClassesOutput')
}
4 changes: 2 additions & 2 deletions geode-json/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
*/

dependencies {
testCompile project(':geode-junit')
}
testCompile project(':geode-test')
}
39 changes: 0 additions & 39 deletions geode-junit/build.gradle

This file was deleted.

7 changes: 2 additions & 5 deletions geode-lucene/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,14 @@ dependencies {
exclude module: 'lucene-sandbox'
}

testCompile project(':geode-junit')

//Lucene test framework.
testCompile 'org.apache.lucene:lucene-test-framework:' + project.'lucene.version'
testCompile 'org.apache.lucene:lucene-codecs:' + project.'lucene.version'
testCompile 'com.pholser:junit-quickcheck-core:' + project.'junit-quickcheck.version'
testCompile 'org.apache.lucene:lucene-analyzers-phonetic:' + project.'lucene.version'
testCompile 'com.pholser:junit-quickcheck-generators:' + project.'junit-quickcheck.version'
testCompile files(project(':geode-core').sourceSets.test.output)
testCompile files(project(':geode-old-versions').sourceSets.main.output)

testCompile project(path: ':geode-core', configuration: 'testClassesOutput')
testCompile project(path: ':geode-test', configuration: 'runtime')
}

//The lucene integration tests don't have any issues that requiring forking
Expand Down
6 changes: 2 additions & 4 deletions geode-old-client-support/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ dependencies {
compile project(':geode-core')
compile project(':geode-common')

testCompile project(':geode-junit')

testCompile files(project(':geode-core').sourceSets.test.output)
testCompile files(project(':geode-old-versions').sourceSets.main.output)
testCompile project(path: ':geode-core', configuration: 'testClassesOutput')
testCompile project(path: ':geode-test', configuration: 'runtime')
}
Loading

0 comments on commit 10563d6

Please sign in to comment.