Skip to content

Commit

Permalink
Remove all references to non-jakarta servlet containers from integrat…
Browse files Browse the repository at this point in the history
…ion tests (#144)
  • Loading branch information
f4lco committed Sep 17, 2020
1 parent 7c15c5c commit 598a07e
Show file tree
Hide file tree
Showing 28 changed files with 30 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ class FarmIntegrationTestPlugin extends BasePlugin {
integrationTestContainers.retainAll(Eval.me(project.testAllContainers))
}

// farmSecure tests not working on Jetty 9.3 and 9.4, see https://github.com/gretty-gradle-plugin/gretty/issues/67
if (project.path.startsWith(':farmSecure')) {
println "Excluding farmSecure tests from Jetty 9.3/9.4, see https://github.com/gretty-gradle-plugin/gretty/issues/67 ."
integrationTestContainers -= ['jetty9.3', 'jetty9.4']
}

integrationTestContainers.each { container ->

project.farms.farm container, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,27 +85,10 @@ class IntegrationTestPlugin extends BasePlugin {
if (!integrationTestContainers)
integrationTestContainers = ServletContainerConfig.getConfigNames().collect() // returns immutable and we want to filter later

if (JavaVersion.current().isJava9Compatible()) {
// excluding jetty7 and jetty8 under JDK9, can no longer compile JSPs to default 1.5 target,
// see https://github.com/gretty-gradle-plugin/gretty/issues/15
integrationTestContainers -= ['jetty7', 'jetty8']
}

if (JavaVersion.current().isJava10Compatible()) {
// excluding jetty9 under JDK10, can no longer compile JSPs to default 1.7 target,
integrationTestContainers -= ['jetty9']
}

if (project.hasProperty('testAllContainers') && project.testAllContainers) {
integrationTestContainers.retainAll(Eval.me(project.testAllContainers))
}

// farmSecure tests not working on Jetty 9.3 and 9.4, see https://github.com/gretty-gradle-plugin/gretty/issues/67
if (project.path.startsWith(':farmSecure')) {
println "Excluding farmSecure tests from Jetty 9.3/9.4, see https://github.com/gretty-gradle-plugin/gretty/issues/67 ."
integrationTestContainers -= ['jetty9.3', 'jetty9.4']
}

integrationTestContainers.each { String container ->

project.task('integrationTest_' + container, type: Test) { thisTask ->
Expand Down
1 change: 0 additions & 1 deletion integrationTests/farmSecure/MyWebApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies {
gretty {
httpEnabled = false
httpsEnabled = true
//servletContainer = 'tomcat8'
realm = 'auth'
realmConfigFile = '../security'
singleSignOn = true
Expand Down
1 change: 0 additions & 1 deletion integrationTests/gretty-taglib-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ dependencies {
}

gretty {
servletContainer = 'jetty9'
contextPath = '/'
}

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

gretty {
// Possible servletContainer values are 'jetty7', 'jetty8', 'jetty9', 'tomcat85', 'tomcat9'. Default is 'jetty9'.
// servletContainer = 'tomcat8'
// httpsEnabled = true
httpIdleTimeout = 424242
}

Expand Down
1 change: 0 additions & 1 deletion integrationTests/helloGrettyOverlay/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ apply plugin: 'org.gretty.internal.integrationTests.IntegrationTestPlugin'
gretty {
contextPath = '/helloGrettyOverlay'
overlay ':helloGretty'
servletContainer = 'jetty7'
}

defineIntegrationTest()
Expand Down
2 changes: 0 additions & 2 deletions integrationTests/helloGrettySecure/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ gretty {
httpEnabled = false
httpsEnabled = true
httpsIdleTimeout = 424242
// Possible servletContainer values are 'jetty7', 'jetty8', 'jetty9', 'tomcat85', 'tomcat9'. Default is 'jetty9'.
servletContainer = 'jetty9'
realm 'auth'
// realmConfigFile is optional. When omitted, 'jetty-realm.properties' or 'tomcat-users.xml' is assumed.
// If path is relative, the file will be searched in projectDir, build/resources/main and src/main/webapp/WEB-INF.
Expand Down
3 changes: 2 additions & 1 deletion integrationTests/helloJersey/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ dependencies {
compile "org.glassfish.jersey.containers:jersey-container-servlet-core:$jersey_version"
compile "org.glassfish.jersey.inject:jersey-hk2:$jersey_version"
compile 'javax.xml.bind:jaxb-api:2.3.1'
integrationTestCompile "javax.servlet:servlet-api:$jetty7_servlet_api_version"
// FIXME
//integrationTestCompile "javax.servlet:servlet-api:$jetty7_servlet_api_version"
}

war {
Expand Down
7 changes: 4 additions & 3 deletions integrationTests/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ include 'testAnnotationsOverlay'
include 'testDependency'
include 'testDuplicatingResources'
include 'testInitParameter'
include 'testJettyContextConfig'
include 'testJettyRandomPorts'
include 'testJettyServerConfig'
// FIXME Jetty 10 servlet container is not implemented yet (#162)
// include 'testJettyContextConfig'
// include 'testJettyRandomPorts'
// include 'testJettyServerConfig'
include 'testTomcatContextConfig'
include 'testTomcatRandomPorts'
include 'testTomcatServerConfig'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ gretty {
springBoot = true
httpEnabled = false
httpsEnabled = true
servletContainer = 'jetty9'
realm = 'auth'
realmConfigFile = '../security'
singleSignOn = true
Expand All @@ -26,7 +25,7 @@ farm {

defineIntegrationTest()

testAll.dependsOn defineFarmIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat85', 'tomcat9'], {
testAll.dependsOn defineFarmIntegrationTestAllContainers({
webapp project
webapp ':spring-boot-farm-secure:spring-boot-webservice'
webapp ':spring-boot-farm-secure:jee-webservice'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ gretty {
}

defineIntegrationTest()
testAll.dependsOn defineIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat85', 'tomcat9'])
testAll.dependsOn defineIntegrationTestAllContainers()
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ gretty {

farm {
managedClassReload = true
servletContainer = 'jetty8'
httpPort = 8081
webapp project
webapp ':spring-boot-farm:spring-boot-webservice1'
Expand All @@ -24,7 +23,7 @@ farm {

defineIntegrationTest()

testAll.dependsOn defineFarmIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat85', 'tomcat9'], {
testAll.dependsOn defineFarmIntegrationTestAllContainers({
webapp project
webapp ':spring-boot-farm:spring-boot-webservice1'
webapp ':spring-boot-farm:spring-boot-webservice2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ gretty {
}

defineIntegrationTest()
testAll.dependsOn defineIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat85', 'tomcat9'])
testAll.dependsOn defineIntegrationTestAllContainers()
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ gretty {
}

defineIntegrationTest()
testAll.dependsOn defineIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat85', 'tomcat9'])
testAll.dependsOn defineIntegrationTestAllContainers()
2 changes: 1 addition & 1 deletion integrationTests/spring-boot-simple/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ gretty {
}

defineIntegrationTest()
testAll.dependsOn defineIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat85', 'tomcat9'])
testAll.dependsOn defineIntegrationTestAllContainers()
3 changes: 1 addition & 2 deletions integrationTests/springBootWebSocket/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ dependencies {

gretty {
springBoot = true
servletContainer = 'tomcat9'
}

defineIntegrationTest()
testAll.dependsOn defineIntegrationTestAllContainers(['jetty9', 'tomcat85', 'tomcat9'])
testAll.dependsOn defineIntegrationTestAllContainers()
2 changes: 1 addition & 1 deletion integrationTests/testAnnotations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ dependencies {
compile 'org.apache.velocity:velocity:1.7'
}

testAll.dependsOn defineIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat85', 'tomcat9'])
testAll.dependsOn defineIntegrationTestAllContainers()
4 changes: 1 addition & 3 deletions integrationTests/testAnnotationsOverlay/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ gretty {
overlay ':testAnnotations'
}

// annotations are not supported in jetty7

testAll.dependsOn defineIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat85', 'tomcat9'])
testAll.dependsOn defineIntegrationTestAllContainers()
5 changes: 0 additions & 5 deletions integrationTests/testDuplicatingResources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ dependencies {
compile 'io.reactivex:rxjava:1.1.5'
}

ext {
integrationTestContainers = ['tomcat85', 'tomcat9']
}

gretty {
servletContainer = 'tomcat9'
contextPath = '/bug'
}

Expand Down
3 changes: 2 additions & 1 deletion integrationTests/testJettyContextConfig/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ dependencies {
}

defineIntegrationTest()
testAll.dependsOn defineIntegrationTestAllContainers(['jetty7', 'jetty8', 'jetty9'])
// FIXME (#162)
// testAll.dependsOn defineIntegrationTestAllContainers(['jetty10'])
3 changes: 2 additions & 1 deletion integrationTests/testJettyRandomPorts/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ gretty {
}

defineIntegrationTest()
testAll.dependsOn defineIntegrationTestAllContainers(['jetty7', 'jetty8', 'jetty9'])
// FIXME (#162)
// testAll.dependsOn defineIntegrationTestAllContainers(['jetty10'])
3 changes: 2 additions & 1 deletion integrationTests/testJettyServerConfig/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ dependencies {
}

defineIntegrationTest()
testAll.dependsOn defineIntegrationTestAllContainers(['jetty7', 'jetty8', 'jetty9'])
// FIXME (#162)
// testAll.dependsOn defineIntegrationTestAllContainers([''jetty10'])
4 changes: 2 additions & 2 deletions integrationTests/testTomcatContextConfig/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dependencies {
}

gretty {
servletContainer = 'tomcat9'
servletContainer = 'tomcat10'
}

defineIntegrationTest()
testAll.dependsOn defineIntegrationTestAllContainers(['tomcat85', 'tomcat9'])
testAll.dependsOn defineIntegrationTestAllContainers(['tomcat10'])
4 changes: 2 additions & 2 deletions integrationTests/testTomcatRandomPorts/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ dependencies {
}

gretty {
servletContainer = 'tomcat85'
servletContainer = 'tomcat10'
httpPort = getRandomFreePort()
httpsPort = getRandomFreePort()
httpsEnabled = true
}

defineIntegrationTest()
testAll.dependsOn defineIntegrationTestAllContainers(['tomcat85', 'tomcat9'])
testAll.dependsOn defineIntegrationTestAllContainers(['tomcat10'])
4 changes: 2 additions & 2 deletions integrationTests/testTomcatServerConfig/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ dependencies {
}

gretty {
servletContainer = 'tomcat9'
servletContainer = 'tomcat10'
// httpsEnabled = true
}

defineIntegrationTest()
testAll.dependsOn defineIntegrationTestAllContainers(['tomcat85', 'tomcat9'])
testAll.dependsOn defineIntegrationTestAllContainers(['tomcat10'])
2 changes: 1 addition & 1 deletion integrationTests/webfragment/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {
}

dependencies {
compile 'javax.servlet:javax.servlet-api:3.0.1'
compile "jakarta.servlet:jakarta.servlet-api:$tomcat10_servlet_api_version"
compile 'org.webjars:bootstrap:3.2.0'
compile 'org.webjars:jquery:2.1.1'
// We use Velocity for example of template processing within the webapp.
Expand Down
2 changes: 1 addition & 1 deletion integrationTests/webhost/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ dependencies {
}

defineIntegrationTest()
testAll.dependsOn defineIntegrationTestAllContainers(['jetty8', 'jetty9', 'tomcat85', 'tomcat9'])
testAll.dependsOn defineIntegrationTestAllContainers()
6 changes: 1 addition & 5 deletions integrationTests/websocket/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@ apply plugin: 'war'
apply plugin: 'org.gretty'
apply plugin: 'org.gretty.internal.integrationTests.IntegrationTestPlugin'

gretty {
servletContainer = 'jetty9'
}

dependencies {
compile 'org.webjars:jquery:2.1.1'
compile 'org.webjars:sockjs-client:0.3.4-1'
}

defineIntegrationTest()
testAll.dependsOn defineIntegrationTestAllContainers(['jetty9', 'tomcat85', 'tomcat9'])
testAll.dependsOn defineIntegrationTestAllContainers()

0 comments on commit 598a07e

Please sign in to comment.