fix ee8 jstl module and demo (#8484)

* add distribution test for demo jstl
* fix default pattern, not more need of taglib

Signed-off-by: Olivier Lamy <oliver.lamy@gmail.com>
This commit is contained in:
Olivier Lamy 2022-08-25 07:06:30 +10:00 committed by GitHub
parent eb5f765bee
commit d533040ea7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 57 additions and 31 deletions

View File

@ -16,7 +16,6 @@ package org.eclipse.jetty.ee10.servlet.security;
import java.util.List;
import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.util.resource.ResourceFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -200,7 +200,7 @@
<configuration>
<prependGroupId>true</prependGroupId>
<includeGroupIds>jakarta.servlet.jsp.jstl,org.glassfish.web</includeGroupIds>
<includeArtifactIds>jakarta.servlet.jsp.jstl-api,jakarta.servlet.jsp.jstl</includeArtifactIds>
<includeArtifactIds>jakarta.servlet.jsp.jstl-api,javax.servlet.jsp.jstl</includeArtifactIds>
<includeTypes>jar</includeTypes>
<classifier>sources</classifier>
<outputDirectory>${source-assembly-directory}/lib/ee8-glassfish-jstl</outputDirectory>
@ -215,7 +215,7 @@
<configuration>
<prependGroupId>true</prependGroupId>
<includeGroupIds>jakarta.servlet.jsp.jstl,org.glassfish.web</includeGroupIds>
<includeArtifactIds>jakarta.servlet.jsp.jstl-api,jakarta.servlet.jsp.jstl</includeArtifactIds>
<includeArtifactIds>jakarta.servlet.jsp.jstl-api,javax.servlet.jsp.jstl</includeArtifactIds>
<includeTypes>jar</includeTypes>
<outputDirectory>${assembly-directory}/lib/ee8-glassfish-jstl</outputDirectory>
</configuration>

View File

@ -41,7 +41,7 @@
<Get name="properties">
<Put name="jetty.deploy.containerScanJarPattern">
<Property name="jetty.deploy.containerScanJarPattern">
<Default>.*/jetty-servlet-api-[^/]*\.jar$|.*/javax.servlet.jsp.jstl-.*\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\.jar$</Default>
<Default>.*/jetty-servlet-api-[^/]*\.jar$|.*jakarta.servlet.jsp.jstl-[^/]*\.jar|.*jsp.jstl-[^/]*\.jar</Default>
</Property>
</Put>
<Put name="jetty.deploy.webInfScanJarPattern">

View File

@ -24,7 +24,7 @@
<sonar.skip>true</sonar.skip>
<ee9.module></ee9.module>
<ee9.module.path>${maven.multiModuleProjectDirectory}/jetty-ee9/${ee9.module}</ee9.module.path>
<modify-sources-plugin.version>1.0.1</modify-sources-plugin.version>
<modify-sources-plugin.version>1.0.2-SNAPSHOT</modify-sources-plugin.version>
</properties>
<modules>

26
pom.xml
View File

@ -90,8 +90,6 @@
<plexus-utils.version>3.4.2</plexus-utils.version>
<slf4j.version>2.0.0</slf4j.version>
<springboot.version>2.1.1.RELEASE</springboot.version>
<taglibs-standard-impl.version>1.2.5</taglibs-standard-impl.version>
<taglibs-standard-spec.version>1.2.5</taglibs-standard-spec.version>
<testcontainers.version>1.17.3</testcontainers.version>
<weld.version>4.0.3.Final</weld.version>
<wildfly.common.version>1.6.0.Final</wildfly.common.version>
@ -1132,30 +1130,6 @@
<artifactId>maven-plugin-tools-api</artifactId>
<version>${maven.plugin-tools.version}</version>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-impl</artifactId>
<version>${taglibs-standard-impl.version}</version>
<exclusions>
<!-- We are using the jakarta.* artifacts instead -->
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-spec</artifactId>
<version>${taglibs-standard-spec.version}</version>
<exclusions>
<!-- We are using the jakarta.* artifacts instead -->
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>

View File

@ -133,6 +133,59 @@ public class DemoModulesTests extends AbstractJettyHomeTest
assertEquals(HttpStatus.OK_200, response.getStatus(), new ResponseDetails(response));
assertThat(response.getContentAsString(), containsString("PathInfo"));
assertThat(response.getContentAsString(), not(containsString("<%")));
}
}
}
@ParameterizedTest
@MethodSource("provideEnvironmentsToTest")
public void testJstlDemo(String env) throws Exception
{
Path jettyBase = newTestJettyBaseDirectory();
String jettyVersion = System.getProperty("jettyVersion");
JettyHomeTester distribution = JettyHomeTester.Builder.newInstance()
.jettyVersion(jettyVersion)
.jettyBase(jettyBase)
.mavenLocalRepository(System.getProperty("mavenRepoPath"))
.build();
int httpPort = distribution.freePort();
int httpsPort = distribution.freePort();
assertThat("httpPort != httpsPort", httpPort, is(not(httpsPort)));
String[] argsConfig = {
"--add-modules=http," + toEnvironment("demos", env)
};
String baseURI = "http://localhost:%d/%s-demo-jsp".formatted(httpPort, env);
try (JettyHomeTester.Run runConfig = distribution.start(argsConfig))
{
assertTrue(runConfig.awaitFor(START_TIMEOUT, TimeUnit.SECONDS));
assertEquals(0, runConfig.getExitValue());
String[] argsStart = {
"jetty.http.port=" + httpPort,
"jetty.httpConfig.port=" + httpsPort,
"jetty.ssl.port=" + httpsPort
};
try (JettyHomeTester.Run runStart = distribution.start(argsStart))
{
assertTrue(runStart.awaitConsoleLogsFor("Started oejs.Server@", START_TIMEOUT, TimeUnit.SECONDS));
startHttpClient();
ContentResponse response = client.GET(baseURI + "/jstl.jsp");
assertEquals(HttpStatus.OK_200, response.getStatus(), new ResponseDetails(response));
assertThat(response.getContentAsString(), containsString("JSTL Example"));
assertThat(response.getContentAsString(), containsString("5"));
assertThat(response.getContentAsString(), containsString("10"));
assertThat(response.getContentAsString(), not(containsString("<c:forEach")));
}
}
}