Merge pull request #23905 from arjantijms/expressly500M2
Integrate Expressly 5.0.0-M2 + TCK tests for it.
diff --git a/appserver/featuresets/debug/pom.xml b/appserver/featuresets/debug/pom.xml
index fd8c813..a09addf 100644
--- a/appserver/featuresets/debug/pom.xml
+++ b/appserver/featuresets/debug/pom.xml
@@ -45,6 +45,11 @@
<name>Debug</name>
<dependencies>
+ <dependency>
+ <groupId>jakarta.el</groupId>
+ <artifactId>jakarta.el-api</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
diff --git a/appserver/pom.xml b/appserver/pom.xml
index 4cee55b..74b245e 100644
--- a/appserver/pom.xml
+++ b/appserver/pom.xml
@@ -110,7 +110,7 @@
<!-- Jakarta Persistence -->
<jakarta.persistence-api.version>3.1.0</jakarta.persistence-api.version>
<eclipselink.version>4.0.0-M3</eclipselink.version>
- <eclipselink.asm.version>9.2.0</eclipselink.asm.version>
+ <eclipselink.asm.version>9.3.0</eclipselink.asm.version>
<!-- Jakarta Transactions -->
<jakarta.transaction-api.version>2.0.1</jakarta.transaction-api.version>
diff --git a/appserver/tests/tck/expression_language/pom.xml b/appserver/tests/tck/expression_language/pom.xml
new file mode 100644
index 0000000..71ff4fb
--- /dev/null
+++ b/appserver/tests/tck/expression_language/pom.xml
@@ -0,0 +1,301 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation. All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v. 2.0, which is available at
+ http://www.eclipse.org/legal/epl-2.0.
+
+ This Source Code may also be made available under the following Secondary
+ Licenses when the conditions for such availability set forth in the
+ Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ version 2 with the GNU Classpath Exception, which is available at
+ https://www.gnu.org/software/classpath/license.html.
+
+ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+
+-->
+
+<!--
+
+Usage:
+
+Run full TCK:
+
+mvn clean clean
+
+
+Run all tests in test class
+
+mvn clean install -Drun.test="com/sun/ts/tests/el/api/jakarta_el/methodexpression/ELClient.java"
+
+
+Run single test:
+
+mvn clean install -Drun.test="com/sun/ts/tests/el/api/jakarta_el/methodexpression/ELClient.java#methodExpressionMatchingAmbiguousTest"
+
+
+Run single test via standalone runner: (note, remove _from_standalone marker if pressent)
+
+mvn clean install -Drun.test="com/sun/ts/tests/el/api/jakarta_el/methodexpression/ELClient.java#methodExpressionMatchingAmbiguousTest" -Dtck.standalone
+
+
+Run single test via standalone runner and suspend on port 9009:
+
+mvn clean install -Drun.test="com/sun/ts/tests/el/api/jakarta_el/methodexpression/ELClient.java#methodExpressionMatchingAmbiguousTest" -Dtck.standalone -Dmaven.tck.debug
+
+
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.glassfish.main.tests.tck</groupId>
+ <artifactId>tck</artifactId>
+ <version>7.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>glassfish-external-tck-expression-language</artifactId>
+ <packaging>jar</packaging>
+
+ <name>TCK: Expression Language</name>
+
+ <properties>
+ <ant.home>${project.build.directory}/apache-ant-${ant.version}</ant.home>
+ <ant.zip.url>https://archive.apache.org/dist/ant/binaries/apache-ant-${ant.version}-bin.zip</ant.zip.url>
+
+ <tck.home>${project.build.directory}/expression-language-tck</tck.home>
+ <tck.tests.home>${tck.home}/src/com/sun/ts/tests</tck.tests.home>
+
+ <glassfish.home>${project.build.directory}/glassfish7</glassfish.home>
+ <glassfish.modules>${glassfish.home}/glassfish/modules</glassfish.modules>
+
+ <glassfish.version>${project.version}</glassfish.version>
+ <glassfish.asadmin>${glassfish.home}/glassfish/bin/asadmin</glassfish.asadmin>
+
+ <jacoco.includes>org/glassfish/**\:com/sun/enterprise/**</jacoco.includes>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.glassfish.main.distributions</groupId>
+ <artifactId>glassfish</artifactId>
+ <version>${glassfish.version}</version>
+ <type>zip</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.main.tests.tck</groupId>
+ <artifactId>jakarta-expression-language-tck</artifactId>
+ <version>${project.version}</version>
+ <type>zip</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.main.tests.tck</groupId>
+ <artifactId>javatest</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.main.tests.tck</groupId>
+ <artifactId>tsharness</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.12.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-engine</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>download-ant</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <skip>${skipITs}</skip>
+ <url>${ant.zip.url}</url>
+ <unpack>true</unpack>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <configuration>
+ <skip>${skipITs}</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>unpack-glassfish</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>unpack-dependencies</goal>
+ </goals>
+ <configuration>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ <overWriteIfNewer>true</overWriteIfNewer>
+ <includeArtifactIds>glassfish</includeArtifactIds>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>unpack-tck</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>unpack-dependencies</goal>
+ </goals>
+ <configuration>
+ <includeArtifactIds>jakarta-expression-language-tck</includeArtifactIds>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>${ant.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>ant-contrib</groupId>
+ <artifactId>ant-contrib</artifactId>
+ <version>1.0b3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <skip>${skipITs}</skip>
+ </configuration>
+ <executions>
+
+ <execution>
+ <id>prepare-tck-and-glassfish</id>
+ <phase>pre-integration-test</phase>
+ <configuration>
+ <target xmlns:if="ant:if" xmlns:unless="ant:unless">
+ <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="maven.plugin.classpath" />
+
+ <macrodef name="tck-setting">
+ <attribute name="key" /> <attribute name="value" />
+ <sequential>
+ <replaceregexp file="${tck.home}/bin/ts.jte" byline="true"
+ match="@{key}=.*" replace="@{key}=@{value}" />
+ </sequential>
+ </macrodef>
+
+
+ <!-- Change configuration -->
+
+ <tck-setting key="el.classes" value="${tck.home}/lib/javatest.jar:${glassfish.modules}/jakarta.el.jar:${glassfish.modules}/jakarta.el-api.jar:${glassfish.modules}/expressly.jar"/>
+
+ <tck-setting key="report.dir" value="${tck.home}/expression-languagereport/expression-language"/>
+ <tck-setting key="work.dir" value="${tck.home}/expression-languagework/expression-language"/>
+
+ <mkdir dir="${tck.home}/expression-languagereport"/>
+ <mkdir dir="${tck.home}/expression-languagetckreport/expression-language"/>
+
+ <replace file="${tck.home}/bin/xml/ts.top.import.xml">
+ <replacetoken><![CDATA[<jvmarg value="-Xmx512m"/>]]></replacetoken>
+ <replacevalue><![CDATA[<jvmarg value="-Xmx512m"/>
+ <jvmarg value="-Djavatest.security.noSecurityManager=true"/>]]></replacevalue>
+ </replace>
+
+ <replace file="${tck.home}/bin/xml/ts.top.import.xml" if:set="suspend-tck" >
+ <replacetoken><![CDATA[<jvmarg value="-Xmx512m"/>]]></replacetoken>
+ <replacevalue><![CDATA[<jvmarg value="-Xmx512m"/>
+ <jvmarg value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9008"/>]]></replacevalue>
+ </replace>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+
+ <execution>
+ <id>run-tck-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target xmlns:if="ant:if" xmlns:unless="ant:unless">
+ <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="maven.plugin.classpath" />
+
+ <sequential unless:set="tck.standalone">
+ <echo level="info" message="Start running all tests" />
+ <exec executable="${ant.home}/bin/ant" dir="${tck.home}/bin" resultproperty="testResult">
+ <arg value="-Dmultiple.tests=${run.test}" if:set="run.test" />
+ <arg value="run.all" unless:set="run.test"/>
+ <arg value="runclient" if:set="run.test" />
+ <arg value="-Dkeywords=all" />
+ <env key="LC_ALL" value="C" />
+ </exec>
+
+ <if>
+ <not>
+ <equals arg1="${testResult}" arg2="0" />
+ </not>
+ <then>
+ <echo message="Running tests failed." />
+ </then>
+ </if>
+ </sequential>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <skip>${skipITs}</skip>
+ <systemPropertyVariables>
+ <tck.home>${tck.home}</tck.home>
+ <glassfish.home>${glassfish.home}</glassfish.home>
+ <glassfish.version>${project.version}</glassfish.version>
+ <maven.tck.debug>${tck.debug}</maven.tck.debug>
+ <standalone>${tck.standalone}</standalone>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/appserver/tests/tck/expression_language/src/test/java/com/sun/ts/run/StandaloneRunnerITest.java b/appserver/tests/tck/expression_language/src/test/java/com/sun/ts/run/StandaloneRunnerITest.java
new file mode 100644
index 0000000..80e6c2f
--- /dev/null
+++ b/appserver/tests/tck/expression_language/src/test/java/com/sun/ts/run/StandaloneRunnerITest.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2022, 2022 Contributors to the Eclipse Foundation. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+package com.sun.ts.run;
+
+import static java.lang.String.join;
+import static java.lang.System.getProperty;
+import static java.nio.file.Files.writeString;
+import static java.nio.file.Paths.get;
+import static org.junit.jupiter.api.Assertions.fail;
+
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.jupiter.api.Test;
+
+import com.sun.javatest.Status;
+import com.sun.ts.lib.harness.ExecTSTestCmd;
+
+public class StandaloneRunnerITest {
+
+ @Test
+ public void test() throws IOException {
+ if (getProperty("tck.standalone") == null) {
+ return;
+ }
+
+ ExecTSTestCmd cmd = new ExecTSTestCmd();
+
+ System.getProperties().entrySet().stream().forEach(entry -> System.out.println(entry.getKey() + "=" + entry.getValue()));
+
+ writeString(
+ get(getProperty("tck.home") + "/tmp/tstest.jte"),
+ getTSContent());
+
+ List<String> arguments = new ArrayList<>();
+ arguments.addAll(getEnvOptions());
+ arguments.addAll(getJavaOptions());
+ arguments.addAll(getTestOptions());
+
+ PrintWriter log = new PrintWriter(new OutputStreamWriter(System.err));
+ PrintWriter ref = new PrintWriter(new OutputStreamWriter(System.out));
+
+ try {
+ Status status = cmd.run(arguments.toArray(String[]::new), log, ref);
+ if (!status.isPassed()) {
+ fail(status.getReason());
+ }
+
+ } finally {
+ log.flush();
+ ref.flush();
+ }
+ }
+
+ List<String> getEnvOptions() {
+ return List.of(
+ "-v",
+ "CLASSPATH=" + getClassPath(),
+ "HOME=" + getProperty("user.home"),
+ "windir=",
+ "SYSTEMROOT=");
+ }
+
+ List<String> getJavaOptions() {
+ List<String> javaOptions = List.of(
+
+ getProperty("java.home") + "/bin/java",
+
+ "-Dcts.tmp=" + getProperty("java.io.tmpdir"),
+
+ "--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED",
+ "--add-opens=java.base/sun.net.www.protocol.jrt=ALL-UNNAMED",
+ "--add-opens=java.base/java.lang=ALL-UNNAMED",
+ "--add-opens=java.base/java.util=ALL-UNNAMED",
+ "--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED",
+ "--add-opens=java.naming/javax.naming.spi=ALL-UNNAMED")
+ ;
+
+ if (getProperty("maven.tck.debug") != null && !getProperty("maven.tck.debug").isEmpty()) {
+ javaOptions = new ArrayList<>(javaOptions);
+ javaOptions.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9009");
+ }
+
+ return javaOptions;
+ }
+
+ List<String> getTestOptions() {
+ return List.of(
+ "com.sun.ts.tests.common.vehicle.VehicleClient",
+
+ "-p", getProperty("tck.home") + "/tmp/tstest.jte",
+ "-t", getTest(),
+ "-vehicle", "standalone"
+ );
+ }
+
+ String getClassPath() {
+ return join(":", List.of(
+ getProperty("tck.home") + "/lib/javatest.jar",
+ getProperty("tck.home") + "/lib/tsharness.jar",
+ getProperty("tck.home") + "/lib/eltck.jar",
+ getProperty("tck.home") + "/lib/sigtest.jar",
+ getProperty("tck.home") + "/classes",
+ getProperty("glassfish.home") + "/glassfish/modules/jakarta.el-api.jar",
+ getProperty("glassfish.home") + "/glassfish/modules/expressly.jar"
+
+ ));
+ }
+
+ String getTSContent() {
+ return join("\n", List.of(
+ "test_classname=" + getTestClass(),
+ "variable.mapper=org.glassfish.expressly.lang.VariableMapperImpl",
+ "porting.ts.url.class.1=com.sun.ts.lib.implementation.sun.common.SunRIURL",
+
+ "bin.dir=" + getProperty("tck.home") + "/bin",
+ "harness.temp.directory=" + getProperty("tck.home") + "/tmp",
+ "jimage.dir=" + getProperty("tck.home") + "/tmp/jdk-bundles",
+
+ "harness.socket.retry.count=10",
+ "harness.log.port=2000",
+ "harness.log.delayseconds=1",
+ "harness.log.traceflag=false",
+ "all.props=false",
+ "finder=cts",
+ "current.keywords=all"
+ ));
+ }
+
+ String getTestClass() {
+ // e.g.
+ // -Drun.test="com/sun/ts/tests/el/api/jakarta_el/methodexpression/ELClient.java#methodExpressionMatchingAmbiguousTest"
+ String test = getProperty("run.test");
+ int dashPos = test.indexOf('#');
+ if (dashPos > 0) {
+ test = test.substring(0, dashPos);
+ }
+ int javaPos = test.indexOf(".java");
+ if (javaPos > 0) {
+ test = test.substring(0, javaPos);
+ }
+
+ return test.replace('/', '.');
+ }
+
+ String getTest() {
+ String test = "";
+ String runTest = getProperty("run.test");
+ int dashPos = runTest.indexOf('#');
+ if (dashPos > 0) {
+ test = runTest.substring(dashPos + 1);
+ }
+
+ return test;
+ }
+
+}
diff --git a/appserver/tests/tck/pom.xml b/appserver/tests/tck/pom.xml
index 11de7ec..eee6605 100644
--- a/appserver/tests/tck/pom.xml
+++ b/appserver/tests/tck/pom.xml
@@ -35,6 +35,7 @@
<modules>
<module>embedded_ejb_smoke</module>
<module>tck-download</module>
+ <module>expression_language</module>
<module>rest</module>
<module>faces</module>
<module>authentication</module>
diff --git a/appserver/tests/tck/tck-download/jakarta-expression-language-tck/pom.xml b/appserver/tests/tck/tck-download/jakarta-expression-language-tck/pom.xml
new file mode 100644
index 0000000..7db7538
--- /dev/null
+++ b/appserver/tests/tck/tck-download/jakarta-expression-language-tck/pom.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation. All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v. 2.0, which is available at
+ http://www.eclipse.org/legal/epl-2.0.
+
+ This Source Code may also be made available under the following Secondary
+ Licenses when the conditions for such availability set forth in the
+ Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ version 2 with the GNU Classpath Exception, which is available at
+ https://www.gnu.org/software/classpath/license.html.
+
+ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.glassfish.main.tests.tck</groupId>
+ <artifactId>tck-download</artifactId>
+ <version>7.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>jakarta-expression-language-tck</artifactId>
+ <packaging>pom</packaging>
+ <name>TCK: Install Jakarta expression-language TCK</name>
+
+ <properties>
+ <tck.test.expression-language.file>jakarta-expression-language-tck-5.0.0.zip</tck.test.expression-language.file>
+ <tck.test.expression-language.url>https://download.eclipse.org/ee4j/jakartaee-tck/jakartaee10/staged/eftl/${tck.test.expression-language.file}</tck.test.expression-language.url>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.googlecode.maven-download-plugin</groupId>
+ <artifactId>download-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>download-expression-language-tck</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>wget</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <url>${tck.test.expression-language.url}</url>
+ <unpack>false</unpack>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-install-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>install-expression-language-tck</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>install-file</goal>
+ </goals>
+ <configuration>
+ <file>${project.build.directory}/${tck.test.expression-language.file}</file>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${project.artifactId}</artifactId>
+ <version>${project.version}</version>
+ <packaging>zip</packaging>
+ <generatePom>true</generatePom>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/appserver/tests/tck/tck-download/pom.xml b/appserver/tests/tck/tck-download/pom.xml
index b5bb013..3236ec0 100644
--- a/appserver/tests/tck/tck-download/pom.xml
+++ b/appserver/tests/tck/tck-download/pom.xml
@@ -36,6 +36,7 @@
<module>jakarta-faces-tck</module>
<module>jakarta-authentication-tck</module>
<module>jakarta-authorization-tck</module>
+ <module>jakarta-expression-language-tck</module>
<module>tsharness</module>
<module>javatest</module>
</modules>
diff --git a/nucleus/parent/pom.xml b/nucleus/parent/pom.xml
index 5ab209a..819fbd5 100644
--- a/nucleus/parent/pom.xml
+++ b/nucleus/parent/pom.xml
@@ -74,7 +74,7 @@
<!-- Jakarta Expression Language -->
<jakarta.el-api.version>5.0.0</jakarta.el-api.version>
- <expressly.version>5.0.0-M1</expressly.version>
+ <expressly.version>5.0.0-M2</expressly.version>
<!-- Jakarta Servlet -->
<jakarta.servlet-api.version>6.0.0</jakarta.servlet-api.version>