THRIFT-4949: Improve HTTP/1 server test case

Client: java

This closes #1886.
diff --git a/lib/java/gradle/functionalTests.gradle b/lib/java/gradle/functionalTests.gradle
index c420d12..6a388a6 100644
--- a/lib/java/gradle/functionalTests.gradle
+++ b/lib/java/gradle/functionalTests.gradle
@@ -34,6 +34,7 @@
             include '**/test/TestClient.java'
             include '**/test/TestServer.java'
             include '**/test/TestNonblockingServer.java'
+            include '**/test/TestTServletServer.java'
         }
     }
 }
@@ -55,7 +56,7 @@
 shadowJar {
     description = 'Assemble a test JAR file for cross-check execution'
     // make sure the runners are created when this runs
-    dependsOn 'generateRunnerScriptForClient', 'generateRunnerScriptForServer', 'generateRunnerScriptForNonblockingServer'
+    dependsOn 'generateRunnerScriptForClient', 'generateRunnerScriptForServer', 'generateRunnerScriptForNonblockingServer', 'generateRunnerScriptForTServletServer'
 
     baseName = 'functionalTest'
     destinationDir = file("$buildDir/functionalTestJar")
@@ -153,3 +154,24 @@
         serverFile.setExecutable(true, false)
     }
 }
+
+task generateRunnerScriptForTServletServer(group: 'Build') {
+    description = 'Generate a runner script for cross-check tests with TestTServletServer'
+
+    def serverFile = file("$buildDir/runservletserver${scriptExt}")
+
+    def runServerText = """\
+${scriptHead}
+
+"${javaExe}" -cp "$jarPath" "-Djavax.net.ssl.keyStore=$keyStore" -Djavax.net.ssl.keyStorePassword=thrift org.apache.thrift.test.TestTServletServer $args
+"""
+
+    inputs.property 'runServerText', runServerText
+    outputs.file serverFile
+
+    doLast {
+        serverFile.parentFile.mkdirs()
+        serverFile.text = runServerText
+        serverFile.setExecutable(true, false)
+    }
+}