Skip to content

Commit 65c7984

Browse files
GEODE-5530: Removes test dependency from other test source sets (apache#2294)
Moves common sources to geode-dunit or geode-junit. Co-authored-by: Finn Sutherland <[email protected]>
1 parent 0a9da64 commit 65c7984

File tree

345 files changed

+1308
-926
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

345 files changed

+1308
-926
lines changed

extensions/geode-modules-session/build.gradle

+9-13
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,18 @@ dependencies {
2121
compile project(':extensions/geode-modules-session-internal')
2222
compile project(':geode-core')
2323

24-
testCompile project(':geode-junit')
25-
26-
testCompile 'javax.servlet:javax.servlet-api:' + project.'javax.servlet-api.version'
27-
testCompile 'org.slf4j:slf4j-api:' + project.'slf4j-api.version'
28-
testCompile('com.mockrunner:mockrunner-servlet:' + project.'mockrunner.version') {
24+
integrationTestCompile project(":geode-dunit")
25+
integrationTestCompile ('org.httpunit:httpunit:' + project.'httpunit.version') {
26+
exclude group: 'javax.servlet'
27+
}
28+
integrationTestCompile(group: 'org.eclipse.jetty', name: 'jetty-http', version: project.'jetty.version', classifier: 'tests')
29+
integrationTestCompile(group: 'org.eclipse.jetty', name: 'jetty-servlet', version: project.'jetty.version', classifier: 'tests')
30+
integrationTestCompile 'javax.servlet:javax.servlet-api:' + project.'javax.servlet-api.version'
31+
integrationTestCompile 'org.slf4j:slf4j-api:' + project.'slf4j-api.version'
32+
integrationTestCompile('com.mockrunner:mockrunner-servlet:' + project.'mockrunner.version') {
2933
exclude group: 'jboss'
3034
exclude group: 'xerces'
3135
}
32-
testCompile(group: 'org.eclipse.jetty', name: 'jetty-http', version: project.'jetty.version', classifier: 'tests')
33-
testCompile(group: 'org.eclipse.jetty', name: 'jetty-servlet', version: project.'jetty.version', classifier: 'tests')
34-
testCompile ('org.httpunit:httpunit:' + project.'httpunit.version') {
35-
exclude group: 'javax.servlet'
36-
}
37-
38-
39-
integrationTestCompile project(":geode-dunit")
4036
}
4137

4238
jar {

extensions/geode-modules-tomcat7/build.gradle

+8-10
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,17 @@ dependencies {
3232
}
3333
compile 'org.apache.tomcat:tomcat-juli:' + project.'tomcat7.version'
3434

35-
testCompile 'org.httpunit:httpunit:' + project.'httpunit.version'
36-
37-
testRuntime 'javax.annotation:jsr250-api:' + project.'javax.jsr250-api.version'
38-
testRuntime 'javax.ejb:ejb-api:' + project.'javax.ejb-api.version'
39-
testRuntime 'javax.servlet:javax.servlet-api:' + project.'javax.servlet-api.version'
40-
testRuntime 'org.eclipse.persistence:javax.persistence:' + project.'javax.persistence-api.version'
41-
42-
testCompile project(path: ':geode-junit')
43-
testCompile files(project(':extensions/geode-modules').sourceSets.test.output)
44-
4535
integrationTestCompile project(":geode-dunit")
36+
integrationTestCompile 'org.httpunit:httpunit:' + project.'httpunit.version'
37+
38+
// TODO fix test dependency on other projects
4639
integrationTestCompile files(project(':extensions/geode-modules').sourceSets.integrationTest.output)
4740

41+
integrationTestRuntime 'javax.annotation:jsr250-api:' + project.'javax.jsr250-api.version'
42+
integrationTestRuntime 'javax.ejb:ejb-api:' + project.'javax.ejb-api.version'
43+
integrationTestRuntime 'javax.servlet:javax.servlet-api:' + project.'javax.servlet-api.version'
44+
integrationTestRuntime 'org.eclipse.persistence:javax.persistence:' + project.'javax.persistence-api.version'
45+
4846
eclipse.classpath.file {
4947
whenMerged { classpath ->
5048
classpath.entries.removeAll { entry -> entry.path.contains('geode-modules/build')}

extensions/geode-modules-tomcat8/build.gradle

+5-3
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@ dependencies {
3030
exclude module: 'tomcat-servlet-api'
3131
}
3232
compile 'org.apache.tomcat:tomcat-juli:' + project.'tomcat8.version'
33-
34-
testCompile 'org.httpunit:httpunit:' + project.'httpunit.version'
33+
compile 'javax.servlet:javax.servlet-api:' + '3.1.0'
3534

3635
testRuntime 'javax.annotation:jsr250-api:' + project.'javax.jsr250-api.version'
3736
testRuntime 'javax.ejb:ejb-api:' + project.'javax.ejb-api.version'
38-
compile 'javax.servlet:javax.servlet-api:' + '3.1.0'
3937
testRuntime 'org.eclipse.persistence:javax.persistence:' + project.'javax.persistence-api.version'
4038
testCompile 'javax.security.auth.message:javax.security.auth.message-api:' + '1.1'
4139

@@ -45,6 +43,10 @@ dependencies {
4543
testCompile files(project(':geode-old-versions').sourceSets.main.output)
4644

4745
distributedTestCompile project(":geode-dunit")
46+
distributedTestCompile 'org.httpunit:httpunit:' + project.'httpunit.version'
47+
// TODO remove shared source dependency
48+
distributedTestCompile sourceSets.integrationTest.output
49+
distributedTestCompile project(':extensions/geode-modules').sourceSets.integrationTest.output
4850

4951
eclipse.classpath.file {
5052
whenMerged { classpath ->

extensions/geode-modules/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ dependencies {
3131
testCompile project(':geode-junit')
3232

3333
testCompile 'org.apache.bcel:bcel:' + project.'bcel.version'
34-
testCompile 'org.httpunit:httpunit:' + project.'httpunit.version'
35-
testRuntime 'org.apache.tomcat:coyote:' + project.'tomcat6.version'
3634

3735
integrationTestCompile project(":geode-dunit")
36+
integrationTestCompile 'org.httpunit:httpunit:' + project.'httpunit.version'
37+
integrationTestCompile 'org.apache.tomcat:coyote:' + project.'tomcat6.version'
3838
}
3939

4040
disableMavenPublishing()

geode-assembly/build.gradle

+39-49
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ configurations {
6565
}
6666

6767
dependencies {
68-
compileOnly project(':geode-core')
69-
testCompile project(':geode-core')
70-
7168
archives project(':geode-common')
7269
archives project(':geode-json')
7370
archives project(':geode-core')
@@ -82,74 +79,67 @@ dependencies {
8279
archives project(':geode-cq')
8380
archives project(':geode-rebalancer')
8481

85-
testCompile project(':geode-junit')
86-
testCompile project(':geode-pulse')
87-
testCompile files(project(':geode-core').sourceSets.test.output)
88-
testCompile files(project(':geode-pulse').sourceSets.test.output)
89-
testCompile ('org.springframework:spring-web:' + project.'springframework.version') {
90-
exclude module: 'aopalliance'
91-
exclude module: 'spring-aop'
92-
}
93-
94-
testCompile 'org.apache.httpcomponents:httpclient:' + project.'httpclient.version'
95-
testCompile 'org.apache.httpcomponents:httpcore:' + project.'httpcore.version'
96-
testCompile 'com.google.guava:guava:' + project.'guava.version'
97-
testCompile 'org.apache.commons:commons-exec:' + project.'commons-exec.version'
9882

99-
testCompile group: 'org.codehaus.cargo', name: 'cargo-core-uberjar', version: '1.6.3'
100-
101-
testCompile (project(':extensions/geode-modules')) {
102-
// Remove everything related to Tomcat
103-
exclude group: 'org.apache.tomcat'
104-
}
105-
testCompile (project(':extensions/geode-modules-session-internal')) {
106-
// Remove everything related to Tomcat
107-
exclude group: 'org.apache.tomcat'
108-
}
83+
testCompile project(':geode-core')
84+
testCompile project(':geode-junit')
10985

110-
testCompile project(':extensions/session-testing-war')
11186

112-
testCompile 'org.seleniumhq.selenium:selenium-api:' + project.'selenium.version'
113-
testCompile 'org.seleniumhq.selenium:selenium-chrome-driver:' + project.'selenium.version'
114-
testCompile 'org.seleniumhq.selenium:selenium-support:' + project.'selenium.version'
87+
integrationTestCompile project(':geode-core')
88+
integrationTestCompile project(":geode-junit")
89+
integrationTestCompile project(":geode-dunit")
90+
integrationTestCompile project(":geode-pulse")
91+
integrationTestCompile 'org.apache.httpcomponents:httpclient:' + project.'httpclient.version'
11592

116-
testRuntime files("${System.getProperty('java.home')}/../lib/tools.jar")
117-
testRuntime files("$buildDir/install/${distributions.main.baseName}/lib/geode-dependencies.jar")
11893

94+
distributedTestCompile project(':geode-core')
95+
distributedTestCompile project(':extensions/session-testing-war')
96+
distributedTestCompile group: 'org.codehaus.cargo', name: 'cargo-core-uberjar', version: '1.6.3'
97+
distributedTestCompile 'org.apache.httpcomponents:httpclient:' + project.'httpclient.version'
98+
// TODO refactor out common test framework
99+
distributedTestCompile sourceSets.integrationTest.output
119100

120-
gfshDependencies ('org.springframework:spring-web:' + project.'springframework.version'){
121-
exclude module: 'spring-core'
122-
exclude module: 'commons-logging'
101+
distributedTestRuntime (project(':extensions/geode-modules-session-internal')) {
102+
exclude group: 'org.apache.tomcat'
123103
}
124104

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

127-
integrationTestCompile project(":geode-dunit")
106+
acceptanceTestCompile project(':geode-core')
107+
acceptanceTestCompile project(":geode-dunit")
128108

129-
distributedTestCompile project(":geode-dunit")
130109

131-
acceptanceTestCompile project(":geode-dunit")
110+
uiTestCompile project(':geode-core')
111+
uiTestCompile project(":geode-dunit")
112+
uiTestCompile project(":geode-pulse")
113+
uiTestCompile 'org.seleniumhq.selenium:selenium-api:' + project.'selenium.version'
114+
uiTestCompile 'org.seleniumhq.selenium:selenium-remote-driver:' + project.'selenium.version'
115+
uiTestCompile 'org.seleniumhq.selenium:selenium-support:' + project.'selenium.version'
132116
// TODO refactor out common test framework
133-
upgradeTestCompile sourceSets.distributedTest.output
117+
uiTestCompile sourceSets.integrationTest.output
118+
uiTestCompile project(":geode-pulse").sourceSets.uiTest.output
134119

135-
uiTestCompile project(":geode-dunit")
120+
uiTestRuntime project(":geode-core")
121+
uiTestRuntime 'org.seleniumhq.selenium:selenium-chrome-driver:' + project.'selenium.version'
136122

123+
124+
upgradeTestCompile project(':geode-core')
137125
upgradeTestCompile project(":geode-dunit")
138126
// TODO refactor out common test framework
139127
upgradeTestCompile sourceSets.distributedTest.output
140-
}
128+
upgradeTestCompile sourceSets.test.output
141129

142-
sourceSets {
143-
}
130+
upgradeTestRuntime group: 'org.codehaus.cargo', name: 'cargo-core-uberjar', version: '1.6.3'
131+
upgradeTestRuntime 'org.apache.httpcomponents:httpclient:' + project.'httpclient.version'
132+
upgradeTestRuntime project(':extensions/session-testing-war')
144133

145-
test {
146-
// test from the actual classpath not the gradle classpath
147-
dependsOn installDist
148-
// @TODO: this doesn't seem to be working need to get basename first.
149-
classpath += files "$buildDir/install/${distributions.main.baseName}/lib/geode-dependencies.jar"
134+
135+
gfshDependencies ('org.springframework:spring-web:' + project.'springframework.version'){
136+
exclude module: 'spring-core'
137+
exclude module: 'commons-logging'
138+
}
150139
}
151140

152141
tasks.withType(Test){
142+
dependsOn installDist
153143
environment 'GEODE_HOME', "$buildDir/install/${distributions.main.baseName}"
154144
}
155145

geode-assembly/src/distributedTest/java/org/apache/geode/rest/internal/web/RestFunctionExecuteDUnitTest.java

+6-9
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
import static org.assertj.core.api.Assertions.assertThat;
2121

2222
import java.io.File;
23-
import java.net.URI;
24-
import java.net.URISyntaxException;
25-
import java.net.URL;
2623
import java.util.Properties;
2724

2825
import org.junit.BeforeClass;
@@ -39,6 +36,7 @@
3936
import org.apache.geode.test.junit.categories.RestAPITest;
4037
import org.apache.geode.test.junit.rules.GeodeDevRestClient;
4138
import org.apache.geode.test.junit.rules.GfshCommandRule;
39+
import org.apache.geode.util.test.TestUtil;
4240

4341
@Category({RestAPITest.class})
4442
public class RestFunctionExecuteDUnitTest {
@@ -111,13 +109,12 @@ public void connectToServer2() throws Exception {
111109
}
112110

113111
// find ImplementsFunction.java in the geode-core resource
114-
private static File loadClassToFile() throws URISyntaxException {
115-
URL resourceFileURL = Function.class.getClassLoader()
116-
.getResource("org/apache/geode/management/internal/deployment/ImplementsFunction.java");
117-
assertThat(resourceFileURL).isNotNull();
112+
private static File loadClassToFile() {
113+
String resourcePath = TestUtil.getResourcePath(Function.class.getClassLoader(),
114+
"org/apache/geode/management/internal/deployment/ImplementsFunction.java");
115+
assertThat(resourcePath).isNotNull();
118116

119-
URI resourceUri = resourceFileURL.toURI();
120-
return new File(resourceUri);
117+
return new File(resourcePath);
121118
}
122119

123120

geode-connectors/build.gradle

+16-21
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,30 @@
1818
evaluationDependsOn(":geode-core")
1919

2020
repositories {
21-
maven {
22-
url 'https://dl.bintray.com/palantir/releases'
23-
// docker-compose-rule is published on bintray
24-
}
21+
maven {
22+
// docker-compose-rule is published on bintray
23+
url 'https://dl.bintray.com/palantir/releases'
24+
}
2525
}
2626

2727
dependencies {
28-
compile project(':geode-core')
29-
compile project(':geode-common')
30-
compile group: 'com.zaxxer', name: 'HikariCP', version: project.'HikariCP.version'
28+
compile project(':geode-core')
29+
compile project(':geode-common')
30+
compile group: 'com.zaxxer', name: 'HikariCP', version: project.'HikariCP.version'
3131

3232

33-
testCompile project(':geode-junit')
33+
testCompile project(':geode-junit')
3434

35-
//Connectors test framework.
36-
testRuntime 'org.apache.derby:derby:' + project.'derby.version'
37-
testCompile group: 'mysql', name: 'mysql-connector-java', version: '5.1.46'
38-
testCompile group: 'org.postgresql', name: 'postgresql', version: '42.2.2'
39-
testCompile 'com.palantir.docker.compose:docker-compose-rule-junit4:0.31.1'
40-
testCompile 'com.pholser:junit-quickcheck-core:' + project.'junit-quickcheck.version'
41-
testCompile 'com.pholser:junit-quickcheck-generators:' + project.'junit-quickcheck.version'
42-
testCompile files(project(':geode-old-versions').sourceSets.main.output)
4335

44-
integrationTestCompile project(":geode-dunit")
36+
integrationTestCompile project(":geode-dunit")
4537

46-
distributedTestCompile project(":geode-dunit")
4738

48-
acceptanceTestCompile project(":geode-dunit")
49-
}
39+
acceptanceTestCompile project(":geode-dunit")
40+
acceptanceTestCompile group: 'mysql', name: 'mysql-connector-java', version: '5.1.46'
41+
acceptanceTestCompile group: 'com.palantir.docker.compose', name: 'docker-compose-rule-junit4', version: '0.31.1'
5042

51-
integrationTest.forkEvery 0
43+
acceptanceTestRuntime group: 'org.apache.derby', name: 'derby', version: project.'derby.version'
44+
acceptanceTestRuntime group: 'org.postgresql', name: 'postgresql', version: '42.2.2'
45+
}
5246

47+
integrationTest.forkEvery 0

geode-connectors/src/integrationTest/java/org/apache/geode/codeAnalysis/AnalyzeConnectorsSerializablesJUnitTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import org.apache.geode.test.junit.categories.SerializationTest;
2020

2121
@Category({SerializationTest.class})
22-
public class AnalyzeConnectorsSerializablesJUnitTest extends AnalyzeSerializablesJUnitTest {
22+
public class AnalyzeConnectorsSerializablesJUnitTest extends AnalyzeSerializablesJUnitTestBase {
2323

2424
@Override
2525
protected String getModuleName() {

geode-core/build.gradle

+28-17
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ dependencies {
4646

4747
// External
4848
compileOnly files("${System.getProperty('java.home')}/../lib/tools.jar")
49-
testCompile files("${System.getProperty('java.home')}/../lib/tools.jar")
5049
compile 'com.github.stephenc.findbugs:findbugs-annotations:' + project.'stephenc-findbugs.version'
5150
compile 'org.jgroups:jgroups:' + project.'jgroups.version'
5251
compile 'antlr:antlr:' + project.'antlr.version'
@@ -140,37 +139,49 @@ dependencies {
140139
compile project(':geode-common')
141140
compile project(':geode-json')
142141

143-
jcaCompile sourceSets.main.output
144142

145-
testCompile project(':geode-junit')
143+
jcaCompile sourceSets.main.output
146144

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

149-
// Test Dependencies
150-
// External
151-
testCompile 'com.jayway.jsonpath:json-path-assert:' + project.'json-path-assert.version'
146+
testCompile project(':geode-junit')
147+
testCompile project(':geode-concurrency-test')
152148
testCompile 'org.apache.bcel:bcel:' + project.'bcel.version'
153-
testRuntime 'org.apache.derby:derby:' + project.'derby.version'
154149
testCompile 'org.mockito:mockito-core:' + project.'mockito-core.version'
150+
testCompile 'org.springframework:spring-test:' + project.'springframework.version'
151+
testCompile 'com.pholser:junit-quickcheck-core:' + project.'junit-quickcheck.version'
152+
testCompile files("${System.getProperty('java.home')}/../lib/tools.jar")
153+
155154
testRuntime 'commons-collections:commons-collections:' + project.'commons-collections.version'
156155
testRuntime 'commons-configuration:commons-configuration:' + project.'commons-configuration.version'
157156
testRuntime 'commons-io:commons-io:' + project.'commons-io.version'
158157
testRuntime 'commons-validator:commons-validator:' + project.'commons-validator.version'
159-
testCompile 'net.spy:spymemcached:' + project.'spymemcached.version'
160-
testCompile 'redis.clients:jedis:' + project.'jedis.version'
161-
testCompile 'org.springframework:spring-test:' + project.'springframework.version'
158+
testRuntime 'com.pholser:junit-quickcheck-generators:' + project.'junit-quickcheck.version'
162159

163160

164-
testCompile 'com.pholser:junit-quickcheck-core:' + project.'junit-quickcheck.version'
165-
testCompile 'com.pholser:junit-quickcheck-generators:' + project.'junit-quickcheck.version'
166-
testCompile 'com.pholser:junit-quickcheck-guava:' + project.'junit-quickcheck.version'
161+
integrationTestCompile project(":geode-dunit")
162+
integrationTestCompile project(':geode-concurrency-test')
163+
integrationTestCompile 'redis.clients:jedis:' + project.'jedis.version'
164+
integrationTestCompile 'org.apache.bcel:bcel:' + project.'bcel.version'
165+
integrationTestCompile 'org.springframework:spring-test:' + project.'springframework.version'
166+
integrationTestCompile 'net.spy:spymemcached:' + project.'spymemcached.version'
167+
integrationTestCompile 'pl.pragmatists:JUnitParams:' + project.'JUnitParams.version'
168+
169+
integrationTestRuntime 'org.apache.derby:derby:' + project.'derby.version'
170+
integrationTestRuntime 'xerces:xercesImpl:' + project.'xercesImpl.version'
167171

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

171-
integrationTestCompile project(":geode-dunit")
172173
distributedTestCompile project(":geode-dunit")
174+
distributedTestCompile 'redis.clients:jedis:' + project.'jedis.version'
175+
distributedTestCompile 'pl.pragmatists:JUnitParams:' + project.'JUnitParams.version'
176+
distributedTestCompile 'com.jayway.jsonpath:json-path-assert:' + project.'json-path-assert.version'
177+
178+
distributedTestRuntime 'org.apache.derby:derby:' + project.'derby.version'
179+
180+
173181
upgradeTestCompile project(":geode-dunit")
182+
183+
184+
performanceTestCompile project(":geode-junit")
174185
}
175186

176187
def generatedResources = "$buildDir/generated-resources/main"

0 commit comments

Comments
 (0)