From dc69fd24bf51f8e29dc6ed41a5a7c1df8a369d72 Mon Sep 17 00:00:00 2001 From: Sergii Kondrusiev Date: Fri, 21 Jun 2024 15:03:00 +0300 Subject: [PATCH] Added integration tests plugin to support java toolchains testing --- docker_integration_tests.sh | 32 +++++++ .../integrationTests/AnyJavaVersion.java | 45 +++++++++ .../integrationTests/BasePlugin.groovy | 7 +- .../IntegrationTestPlugin.groovy | 24 +++++ .../JavaToolchainIntegrationTestPlugin.groovy | 91 +++++++++++++++++++ ...aToolchainIntegrationTestPlugin.properties | 1 + .../extraResourceBases/build.gradle | 1 + integrationTests/farm/MyWebApp/build.gradle | 1 + .../farm/MyWebService/build.gradle | 1 + .../gradle-java-toolchain/README.md | 30 ++++++ .../gradle-java-toolchain/build.gradle | 29 ++++++ .../gretty/gradle/toolchain/PageSpec.groovy | 40 ++++++++ .../gradle/toolchain/ExampleServlet.java | 52 +++++++++++ .../hellogretty/templates/servletpage.html | 26 ++++++ .../src/main/webapp/WEB-INF/filter.groovy | 3 + .../src/main/webapp/WEB-INF/web.xml | 33 +++++++ .../src/main/webapp/css/default.css | 14 +++ .../src/main/webapp/index.html | 24 +++++ integrationTests/settings.gradle | 1 + 19 files changed, 454 insertions(+), 1 deletion(-) create mode 100644 integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/AnyJavaVersion.java create mode 100644 integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/JavaToolchainIntegrationTestPlugin.groovy create mode 100644 integrationTests/buildSrc/gretty-integrationTest/src/main/resources/META-INF/gradle-plugins/org.gretty.internal.integrationTests.JavaToolchainIntegrationTestPlugin.properties create mode 100644 integrationTests/gradle-java-toolchain/README.md create mode 100644 integrationTests/gradle-java-toolchain/build.gradle create mode 100644 integrationTests/gradle-java-toolchain/src/integrationTest/groovy/org/akhikhl/examples/gretty/gradle/toolchain/PageSpec.groovy create mode 100644 integrationTests/gradle-java-toolchain/src/main/java/org/akhikhl/examples/gretty/gradle/toolchain/ExampleServlet.java create mode 100644 integrationTests/gradle-java-toolchain/src/main/resources/org/akhikhl/examples/gretty/hellogretty/templates/servletpage.html create mode 100644 integrationTests/gradle-java-toolchain/src/main/webapp/WEB-INF/filter.groovy create mode 100644 integrationTests/gradle-java-toolchain/src/main/webapp/WEB-INF/web.xml create mode 100644 integrationTests/gradle-java-toolchain/src/main/webapp/css/default.css create mode 100644 integrationTests/gradle-java-toolchain/src/main/webapp/index.html diff --git a/docker_integration_tests.sh b/docker_integration_tests.sh index f49f3b238..df88617ab 100644 --- a/docker_integration_tests.sh +++ b/docker_integration_tests.sh @@ -37,3 +37,35 @@ export common_gradle_args="--console=plain --no-daemon -Porg.gradle.java.install --working-dir integrationTests \ $common_gradle_args \ testAll + +# a set of tests with java toolchain: + +#ci.yml matrix case #1 + toolchain java v17 +./docker_gradlew.sh \ + --java 17 --java 11 \ + --gradle 7 \ + --gradle-home .docker-gradle \ + --working-dir integrationTests \ + $common_gradle_args \ + -PtoolchainJavaVersion=17 \ + testAllJavaToolchain + +#ci.yml matrix case #2 + toolchain java v21 +./docker_gradlew.sh \ + --java 21 --java 17 \ + --gradle 7 \ + --gradle-home .docker-gradle \ + --working-dir integrationTests \ + $common_gradle_args \ + -PtoolchainJavaVersion=21 \ + testAllJavaToolchain + +#ci.yml matrix case #3 + toolchain java v21 +./docker_gradlew.sh \ + --java 21 --java 17 \ + --gradle 8 \ + --gradle-home .docker-gradle \ + --working-dir integrationTests \ + $common_gradle_args \ + -PtoolchainJavaVersion=21 \ + testAllJavaToolchain diff --git a/integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/AnyJavaVersion.java b/integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/AnyJavaVersion.java new file mode 100644 index 000000000..0d1202f74 --- /dev/null +++ b/integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/AnyJavaVersion.java @@ -0,0 +1,45 @@ +package org.akhikhl.gretty.internal.integrationTests; + +import java.util.Objects; + +public class AnyJavaVersion implements Comparable { + private int majorVersion; + + private AnyJavaVersion(int majorVersion) { + this.majorVersion = majorVersion; + } + + public int getMajorVersion() { + return majorVersion; + } + + public boolean isJava9Compatible() { + return majorVersion >= 9; + } + + public boolean isJava10Compatible() { + return majorVersion >= 10; + } + + @Override + public int compareTo(AnyJavaVersion o) { + return Integer.compare(this.majorVersion, o.majorVersion); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + AnyJavaVersion that = (AnyJavaVersion) o; + return majorVersion == that.majorVersion; + } + + @Override + public int hashCode() { + return Objects.hashCode(majorVersion); + } + + public static AnyJavaVersion of(Integer integer) { + return new AnyJavaVersion(Objects.requireNonNull(integer)); + } +} \ No newline at end of file diff --git a/integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/BasePlugin.groovy b/integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/BasePlugin.groovy index faa94f54d..20d3c4a4f 100644 --- a/integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/BasePlugin.groovy +++ b/integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/BasePlugin.groovy @@ -27,7 +27,9 @@ class BasePlugin implements Plugin { } protected void configureExtensions(Project project) { - // does nothing by default + if (!project.extensions.findByName('javaVersion')) { + project.extensions.add(AnyJavaVersion, 'javaVersion', JavaToolchainIntegrationTestPlugin.getToolchainJavaVersion(project)) + } } protected void configurePublications(Project project) { @@ -98,6 +100,9 @@ class BasePlugin implements Plugin { if(!project.rootProject.tasks.findByName('testAll')) project.rootProject.task 'testAll' + if(!project.rootProject.tasks.findByName('testAllJavaToolchain')) + project.rootProject.task 'testAllJavaToolchain' + project.tasks.withType(Test).configureEach { if (GradleVersion.current().baseVersion.version.startsWith("7.")) { useJUnitPlatform() diff --git a/integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/IntegrationTestPlugin.groovy b/integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/IntegrationTestPlugin.groovy index edef8cf31..f4d7a4943 100644 --- a/integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/IntegrationTestPlugin.groovy +++ b/integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/IntegrationTestPlugin.groovy @@ -47,6 +47,14 @@ class IntegrationTestPlugin extends BasePlugin { protected void configureExtensions(Project project) { super.configureExtensions(project) + /** + * Makes the project aware of java toolchain if it has -PtoolchainJavaVersion=17 parameter. + * Toolchain DSL is configured automatically for the provided version of java. + **/ + project.ext.defineAsJavaToolchainAwareIntegrationTest = { + JavaToolchainIntegrationTestPlugin.applyPluginConditionally(project) + } + project.ext.defineIntegrationTest = { def integrationTestTask_ = project.tasks.findByName('integrationTest') @@ -61,6 +69,10 @@ class IntegrationTestPlugin extends BasePlugin { else testClassesDirs = project.sourceSets.integrationTest.output.classesDirs classpath = project.sourceSets.integrationTest.runtimeClasspath + + JavaToolchainIntegrationTestPlugin.whenApplied(project) { plugin -> + plugin.forceTaskToUseGradleJvm(it) + } } integrationTestTask_ @@ -75,6 +87,10 @@ class IntegrationTestPlugin extends BasePlugin { integrationTestAllContainersTask = project.task('integrationTestAllContainers') + JavaToolchainIntegrationTestPlugin.whenApplied(project) { plugin -> + plugin.forceTaskToUseGradleJvm(integrationTestAllContainersTask) + } + if (!integrationTestContainers) integrationTestContainers = ServletContainerConfig.getConfigNames().collect() // returns immutable and we want to filter later @@ -92,6 +108,10 @@ class IntegrationTestPlugin extends BasePlugin { else testClassesDirs = project.sourceSets.integrationTest.output.classesDirs classpath = project.sourceSets.integrationTest.runtimeClasspath + + JavaToolchainIntegrationTestPlugin.whenApplied(project) { plugin -> + plugin.forceTaskToUseGradleJvm(thisTask) + } } integrationTestAllContainersTask.dependsOn project.tasks['integrationTest_' + container] @@ -169,6 +189,10 @@ class IntegrationTestPlugin extends BasePlugin { srcDir 'src/integrationTest/resources' } runtimeClasspath += project.rootProject.files('config/gebConfig') + + JavaToolchainIntegrationTestPlugin.whenApplied(project) { plugin -> + plugin.forceSourceSetToUseGradleJvm(project, it) + } } } } diff --git a/integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/JavaToolchainIntegrationTestPlugin.groovy b/integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/JavaToolchainIntegrationTestPlugin.groovy new file mode 100644 index 000000000..ae9c4661c --- /dev/null +++ b/integrationTests/buildSrc/gretty-integrationTest/src/main/groovy/org/akhikhl/gretty/internal/integrationTests/JavaToolchainIntegrationTestPlugin.groovy @@ -0,0 +1,91 @@ +package org.akhikhl.gretty.internal.integrationTests + +import org.gradle.api.Action +import org.gradle.api.JavaVersion +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.api.Task +import org.gradle.api.tasks.SourceSet +import org.gradle.api.tasks.compile.GroovyCompile +import org.gradle.api.tasks.compile.JavaCompile +import org.gradle.api.tasks.testing.Test +import org.gradle.jvm.toolchain.JavaLanguageVersion +import org.slf4j.Logger +import org.slf4j.LoggerFactory + +import java.util.function.Consumer + +class JavaToolchainIntegrationTestPlugin implements Plugin { + public static final String PLUGIN_ID = "org.gretty.internal.integrationTests.JavaToolchainIntegrationTestPlugin" + private static final Logger log = LoggerFactory.getLogger(IntegrationTestPlugin) + + public static void applyPluginConditionally(Project project) { + if (project.findProperty('toolchainJavaVersion')) { + project.apply plugin: PLUGIN_ID + } + } + + public static void whenApplied(Project project, Consumer config) { + project.plugins.withId(PLUGIN_ID, new Action() { + @Override + void execute(Plugin plugin) { + config.accept((JavaToolchainIntegrationTestPlugin) plugin) + } + }) + } + + @Override + public void apply(Project project) { + int javaVersion = Integer.parseInt("${project.toolchainJavaVersion}") + + project.java { + toolchain { + languageVersion = JavaLanguageVersion.of(javaVersion) + } + } + + project.rootProject.tasks.named('testAllJavaToolchain').configure { + dependsOn project.tasks.testAll + } + } + + public void forceSourceSetToUseGradleJvm(Project project, SourceSet sourceSet) { + project.tasks.named(sourceSet.getCompileTaskName('java')).configure({ forceTaskToUseGradleJvm(it) }) + project.tasks.named(sourceSet.getCompileTaskName('groovy')).configure({ forceTaskToUseGradleJvm(it) }) + } + + public void forceTaskToUseGradleJvm(Task task) { + task.project.with { proj -> + if (task instanceof JavaCompile) { + task.javaCompiler.value(proj.javaToolchains.compilerFor(gradleJvmSpec)) + } + + if (task instanceof GroovyCompile) { + task.javaLauncher.value(proj.javaToolchains.launcherFor(gradleJvmSpec)) + } + + if (task instanceof Test) { + task.javaLauncher.value(proj.javaToolchains.launcherFor(gradleJvmSpec)) + } + } + } + + public static AnyJavaVersion getToolchainJavaVersion(Project project) { + //java 8 compatible, Optional.or() available from java 9 + String majorVersion = project.findProperty('toolchainJavaVersion') ?: JavaVersion.current().majorVersion + + return Optional.ofNullable(majorVersion) + .map({ Integer.parseInt("$it") }) + .map({ AnyJavaVersion.of(it) }) + .get() + } + + public static JavaVersion getGradleJavaVersion() { + return JavaVersion.current() + } + + private static def getGradleJvmSpec() { + def gradleJvmVerson = Integer.valueOf(getGradleJavaVersion().getMajorVersion()) + return { languageVersion = JavaLanguageVersion.of(gradleJvmVerson) } + } +} diff --git a/integrationTests/buildSrc/gretty-integrationTest/src/main/resources/META-INF/gradle-plugins/org.gretty.internal.integrationTests.JavaToolchainIntegrationTestPlugin.properties b/integrationTests/buildSrc/gretty-integrationTest/src/main/resources/META-INF/gradle-plugins/org.gretty.internal.integrationTests.JavaToolchainIntegrationTestPlugin.properties new file mode 100644 index 000000000..738554447 --- /dev/null +++ b/integrationTests/buildSrc/gretty-integrationTest/src/main/resources/META-INF/gradle-plugins/org.gretty.internal.integrationTests.JavaToolchainIntegrationTestPlugin.properties @@ -0,0 +1 @@ +implementation-class=org.akhikhl.gretty.internal.integrationTests.JavaToolchainIntegrationTestPlugin diff --git a/integrationTests/extraResourceBases/build.gradle b/integrationTests/extraResourceBases/build.gradle index 96479db05..4ee3aa996 100644 --- a/integrationTests/extraResourceBases/build.gradle +++ b/integrationTests/extraResourceBases/build.gradle @@ -13,5 +13,6 @@ gretty { extraResourceBase 'extra1' } +defineAsJavaToolchainAwareIntegrationTest() defineIntegrationTest() testAll.dependsOn defineIntegrationTestAllContainers() diff --git a/integrationTests/farm/MyWebApp/build.gradle b/integrationTests/farm/MyWebApp/build.gradle index afd4aa6a1..3e0d85e8d 100644 --- a/integrationTests/farm/MyWebApp/build.gradle +++ b/integrationTests/farm/MyWebApp/build.gradle @@ -21,6 +21,7 @@ product { additionalFiles = ['./farm/README.md': './README.md'] } +defineAsJavaToolchainAwareIntegrationTest() defineIntegrationTest() testAll.dependsOn defineFarmIntegrationTestAllContainers({ diff --git a/integrationTests/farm/MyWebService/build.gradle b/integrationTests/farm/MyWebService/build.gradle index b8fd39886..c84076b2e 100644 --- a/integrationTests/farm/MyWebService/build.gradle +++ b/integrationTests/farm/MyWebService/build.gradle @@ -2,4 +2,5 @@ apply plugin: 'war' apply plugin: 'org.gretty' apply plugin: 'org.gretty.internal.integrationTests.IntegrationTestPlugin' +defineAsJavaToolchainAwareIntegrationTest() defineIntegrationTest() diff --git a/integrationTests/gradle-java-toolchain/README.md b/integrationTests/gradle-java-toolchain/README.md new file mode 100644 index 000000000..07c3a4a55 --- /dev/null +++ b/integrationTests/gradle-java-toolchain/README.md @@ -0,0 +1,30 @@ +# gradle-java-toolchain + +Simple gretty servlet application powered by gradle java toolchain. + +## How to run + +```bash +cd integrationTests/gradle-java-toolchain +gradle appRun +``` + + +## How to test + +```bash +cd integrationTests/gradle-java-toolchain +gradle integrationTest -PgeckoDriverPlatform=linux64 -PtoolchainJavaVersion=21 +``` +or +```bash +./docker_gradlew.sh --java 21 --java 11 --gradle 7 --working-dir integrationTests/gradle-java-toolchain -PtoolchainJavaVersion=21 -Pspock_version=2.3-groovy-3.0 -PgebVersion=5.1 integrationTest +``` +## How to build a product + + +```bash +cd integrationTests/gradle-java-toolchain +gradle buildProduct +``` + diff --git a/integrationTests/gradle-java-toolchain/build.gradle b/integrationTests/gradle-java-toolchain/build.gradle new file mode 100644 index 000000000..e2acd5f03 --- /dev/null +++ b/integrationTests/gradle-java-toolchain/build.gradle @@ -0,0 +1,29 @@ +apply plugin: 'org.gretty' +apply plugin: 'org.gretty.internal.integrationTests.IntegrationTestPlugin' + +dependencies { + implementation 'org.webjars:bootstrap:3.2.0' + implementation 'org.webjars:jquery:2.1.1' + // We use Velocity for example of template processing within the webapp. + implementation 'org.apache.velocity:velocity:1.7' +} + +gretty { + if (project.javaVersion.isJava9Compatible()) jvmArgs "--add-opens", "java.base/java.lang=ALL-UNNAMED" +} + +defineAsJavaToolchainAwareIntegrationTest() +defineIntegrationTest() +testAll.dependsOn defineIntegrationTestAllContainers() + +//typical toolchain DSL +java { + toolchain { + languageVersion = JavaLanguageVersion.of("${project.javaVersion.majorVersion}") + } +} + +//toolchain aware integration test +tasks.withType(Test).configureEach { + systemProperty 'toolchainJavaVersion', "${project.javaVersion.majorVersion}" +} diff --git a/integrationTests/gradle-java-toolchain/src/integrationTest/groovy/org/akhikhl/examples/gretty/gradle/toolchain/PageSpec.groovy b/integrationTests/gradle-java-toolchain/src/integrationTest/groovy/org/akhikhl/examples/gretty/gradle/toolchain/PageSpec.groovy new file mode 100644 index 000000000..696a6babd --- /dev/null +++ b/integrationTests/gradle-java-toolchain/src/integrationTest/groovy/org/akhikhl/examples/gretty/gradle/toolchain/PageSpec.groovy @@ -0,0 +1,40 @@ +/* + * Gretty + * + * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. + * + * See the file "LICENSE" for copying and usage permission. + * See the file "CONTRIBUTORS" for complete list of contributors. + */ +package org.akhikhl.examples.gretty.gradle.toolchain + +import geb.spock.GebReportingSpec + +class PageSpec extends GebReportingSpec { + + private static String baseURI + private static String toolchainJavaVersion + + void setupSpec() { + baseURI = System.getProperty('gretty.baseURI') + toolchainJavaVersion = Objects.requireNonNull(System.getProperty('toolchainJavaVersion')) + ?.with({ it == '8' ? '1.8' : it }) + } + + def 'should get expected static page'() { + when: + go "${baseURI}/index.html" + then: + $('h1').text() == 'Hello, world!' + $('p', 0).text() == /This is static HTML page./ + } + + def 'should get expected response from servlet'() { + when: + go "${baseURI}/dynamic" + then: + $('h1').text() == 'Hello, world!' + $('p', 0).text() == /This is dynamic HTML page generated by servlet./ + $('h2').text().startsWith('javaVersion=' + "$toolchainJavaVersion") + } +} diff --git a/integrationTests/gradle-java-toolchain/src/main/java/org/akhikhl/examples/gretty/gradle/toolchain/ExampleServlet.java b/integrationTests/gradle-java-toolchain/src/main/java/org/akhikhl/examples/gretty/gradle/toolchain/ExampleServlet.java new file mode 100644 index 000000000..3ba94dd7e --- /dev/null +++ b/integrationTests/gradle-java-toolchain/src/main/java/org/akhikhl/examples/gretty/gradle/toolchain/ExampleServlet.java @@ -0,0 +1,52 @@ +/* + * Gretty + * + * Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors. + * + * See the file "LICENSE" for copying and usage permission. + * See the file "CONTRIBUTORS" for complete list of contributors. + */ +package org.akhikhl.examples.gretty.gradle.toolchain; + +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.VelocityEngine; +import org.apache.velocity.runtime.RuntimeConstants; +import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader; + +public class ExampleServlet extends HttpServlet { + + private static final long serialVersionUID = -6506276378398106663L; + + private VelocityEngine ve = new VelocityEngine(); + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + Template template = ve.getTemplate("/org/akhikhl/examples/gretty/hellogretty/templates/servletpage.html", "UTF-8"); + VelocityContext context = new VelocityContext(); + context.put("contextPath", request.getContextPath()); + context.put("today", new java.util.Date()); + context.put("javaVersion", System.getProperty("java.specification.version")); + PrintWriter out = response.getWriter(); + try { + template.merge(context, out); + out.flush(); + } finally { + out.close(); + } + } + + @Override + public void init() throws ServletException { + super.init(); + ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath"); + ve.setProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName()); + ve.init(); + } +} diff --git a/integrationTests/gradle-java-toolchain/src/main/resources/org/akhikhl/examples/gretty/hellogretty/templates/servletpage.html b/integrationTests/gradle-java-toolchain/src/main/resources/org/akhikhl/examples/gretty/hellogretty/templates/servletpage.html new file mode 100644 index 000000000..fe3f7ed23 --- /dev/null +++ b/integrationTests/gradle-java-toolchain/src/main/resources/org/akhikhl/examples/gretty/hellogretty/templates/servletpage.html @@ -0,0 +1,26 @@ + + + + Hello-world page + + + + + + + + + +
+
+
+

Hello, world!

+

This is dynamic HTML page generated by servlet.

+

Today is $today.

+

Click here to see static page.

+

javaVersion=$javaVersion

+
+
+
+ + diff --git a/integrationTests/gradle-java-toolchain/src/main/webapp/WEB-INF/filter.groovy b/integrationTests/gradle-java-toolchain/src/main/webapp/WEB-INF/filter.groovy new file mode 100644 index 000000000..812d3d5d4 --- /dev/null +++ b/integrationTests/gradle-java-toolchain/src/main/webapp/WEB-INF/filter.groovy @@ -0,0 +1,3 @@ +filter relPath: '/', { + redirect 'index.html' +} diff --git a/integrationTests/gradle-java-toolchain/src/main/webapp/WEB-INF/web.xml b/integrationTests/gradle-java-toolchain/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..3399f8948 --- /dev/null +++ b/integrationTests/gradle-java-toolchain/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,33 @@ + + + + RedirectFilter + org.akhikhl.gretty.RedirectFilter + + + RedirectFilter + /* + REQUEST + FORWARD + + + + jsp + *.html + + + + ExampleServlet + ExampleServlet + org.akhikhl.examples.gretty.gradle.toolchain.ExampleServlet + 1 + + + + ExampleServlet + /dynamic + + diff --git a/integrationTests/gradle-java-toolchain/src/main/webapp/css/default.css b/integrationTests/gradle-java-toolchain/src/main/webapp/css/default.css new file mode 100644 index 000000000..09e4763bb --- /dev/null +++ b/integrationTests/gradle-java-toolchain/src/main/webapp/css/default.css @@ -0,0 +1,14 @@ +body { + padding-top: 20px; + font-family: 'Open Sans', sans-serif; + font-size: 18px; +} + +h1 { + font-weight: 400; + font-size: 40px; +} + +.margin-base-vertical { + margin: 40px 0; +} diff --git a/integrationTests/gradle-java-toolchain/src/main/webapp/index.html b/integrationTests/gradle-java-toolchain/src/main/webapp/index.html new file mode 100644 index 000000000..87e2f4029 --- /dev/null +++ b/integrationTests/gradle-java-toolchain/src/main/webapp/index.html @@ -0,0 +1,24 @@ + + + + Hello-world page + + + + + + + + + +
+
+
+

Hello, world!

+

This is static HTML page.

+

Click here to see dynamic page generated by servlet.

+
+
+
+ + diff --git a/integrationTests/settings.gradle b/integrationTests/settings.gradle index a3a97dd80..39c063e21 100644 --- a/integrationTests/settings.gradle +++ b/integrationTests/settings.gradle @@ -8,6 +8,7 @@ include 'helloGrettyOverlay' include 'helloJersey' include 'extraResourceBases' include 'filterWebapp' +include 'gradle-java-toolchain' include 'testAnnotations' include 'testAnnotationsOverlay' include 'testDependency'