diff --git a/lib/java/gradle/generateTestThrift.gradle b/lib/java/gradle/generateTestThrift.gradle
new file mode 100644
index 0000000..9673e5b
--- /dev/null
+++ b/lib/java/gradle/generateTestThrift.gradle
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Following Gradle best practices to keep build logic organized
+
+// Generated code locations for Unit tests
+ext.genSrc = file("$buildDir/gen-java")
+ext.genBeanSrc = file("$buildDir/gen-javabean")
+ext.genReuseSrc = file("$buildDir/gen-javareuse")
+ext.genFullCamelSrc = file("$buildDir/gen-fullcamel")
+
+// Add the generated code directories to the test source set
+sourceSets {
+    test.java.srcDirs genSrc, genBeanSrc, genReuseSrc, genFullCamelSrc
+}
+
+// ----------------------------------------------------------------------------
+// Code generation for Unit Testing
+
+// A callable closure to make this easier
+ext.thriftCompile = { Task task, String thriftFileName, String generator = 'java', File outputDir = genSrc ->
+    def thriftFile = file("$thriftRoot/test/$thriftFileName")
+    assert thriftFile.exists()
+
+    task.inputs.file thriftFile
+    task.outputs.dir outputDir
+
+    task.doLast {
+        outputDir.mkdirs()
+        def result = exec {
+            executable file(thriftCompiler)
+            args '--gen', generator
+            args '-out', outputDir
+            args thriftFile
+            standardOutput = task.outputBuffer
+            errorOutput = task.outputBuffer
+            ignoreExitValue = true
+        }
+        if (result.exitValue != 0) {
+            // Only show the Thrift compiler output on failures, cuts down on noise!
+            println task.outputBuffer.toString()
+            result.rethrowFailure()
+        }
+    }
+}
+
+task generate(group: 'Build') {
+    description = 'Generate all unit test Thrift sources'
+    compileTestJava.dependsOn it
+}
+
+task generateJava(group: 'Build') {
+    description = 'Generate the thrift gen-java source'
+    generate.dependsOn it
+
+    ext.outputBuffer = new ByteArrayOutputStream()
+
+    thriftCompile(it, 'ThriftTest.thrift')
+    thriftCompile(it, 'JavaTypes.thrift')
+    thriftCompile(it, 'DebugProtoTest.thrift')
+    thriftCompile(it, 'OptionalRequiredTest.thrift')
+    thriftCompile(it, 'ManyOptionals.thrift')
+    thriftCompile(it, 'JavaDeepCopyTest.thrift')
+    thriftCompile(it, 'EnumContainersTest.thrift')
+}
+
+task generateBeanJava(group: 'Build') {
+    description = 'Generate the thrift gen-javabean source'
+    generate.dependsOn it
+
+    ext.outputBuffer = new ByteArrayOutputStream()
+
+    thriftCompile(it, 'JavaBeansTest.thrift', 'java:beans,nocamel', genBeanSrc)
+}
+
+task generateReuseJava(group: 'Build') {
+    description = 'Generate the thrift gen-javareuse source'
+    generate.dependsOn it
+
+    ext.outputBuffer = new ByteArrayOutputStream()
+
+    thriftCompile(it, 'FullCamelTest.thrift', 'java:fullcamel', genFullCamelSrc)
+}
+
+task generateFullCamelJava(group: 'Build') {
+    description = 'Generate the thrift gen-fullcamel source'
+    generate.dependsOn it
+
+    ext.outputBuffer = new ByteArrayOutputStream()
+
+    thriftCompile(it, 'ReuseObjects.thrift', 'java:reuse-objects', genReuseSrc)
+}
