This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new df7f664  Wire up the testsuite for the OpenSSL module
df7f664 is described below

commit df7f664caafe53c118b35fe02a3bc3b4595edf33
Author: remm <r...@apache.org>
AuthorDate: Thu Jan 13 22:04:21 2022 +0100

    Wire up the testsuite for the OpenSSL module
    
    Use a placeholder dependency for the unreleased module.
    This makes it easier to run the testsuite with it (place the JAR in the
    right location and run "ant test" with Java 17).
---
 build.properties.default         | 12 ++++++++++++
 build.xml                        | 36 +++++++++++++++++++++++++++++++++-
 modules/openssl-java17/README.md | 42 ----------------------------------------
 3 files changed, 47 insertions(+), 43 deletions(-)

diff --git a/build.properties.default b/build.properties.default
index f264553..35aeb76 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -325,6 +325,18 @@ 
migration-lib.home=${base.path}/migration-${migration-lib.version}
 
migration-lib.jar=${migration-lib.home}/jakartaee-migration-${migration-lib.version}-shaded.jar
 
migration-lib.loc=${base-maven.loc}/org/apache/tomcat/jakartaee-migration/${migration-lib.version}/jakartaee-migration-${migration-lib.version}-shaded.jar
 
+# ----- Tomcat OpenSSL -----
+openssl-lib.version=0.1
+
+# checksums for tomcat-coyote-openssl-java17-0.1.jar
+openssl-lib.checksum.enabled=true
+openssl-lib.checksum.algorithm=MD5|SHA-1
+openssl-lib.checksum.value=xxx|xxx
+
+openssl-lib.home=${base.path}/tomcat-coyote-openssl-java17-${openssl-lib.version}
+openssl-lib.jar=${openssl-lib.home}/tomcat-coyote-openssl-java17-${openssl-lib.version}.jar
+openssl-lib.loc=${base-maven.loc}/org/apache/tomcat/tomcat-coyote-openssl-java17/${openssl-lib.version}/tomcat-coyote-openssl-java17-${openssl-lib.version}.jar
+
 # ----- JSign, version 4.0 or later -----
 jsign.version=4.0
 
diff --git a/build.xml b/build.xml
index f689c6f..6e5a952 100644
--- a/build.xml
+++ b/build.xml
@@ -239,6 +239,7 @@
     <pathelement location="${derby.jar}"/>
     <pathelement location="${derby-shared.jar}"/>
     <pathelement location="${derby-tools.jar}"/>
+    <pathelement location="${openssl-lib.jar}"/>
     <path refid="compile.classpath" />
     <path refid="tomcat.classpath" />
   </path>
@@ -1473,6 +1474,19 @@
     </delete>
     <copy file="${migration-lib.jar}" todir="${tomcat.build}/lib"/>
 
+    <!-- Delete all other versions of OpenSSL support for Tomcat and copy the 
current one -->
+    <!-- After module release
+    <local name="openssl-lib.jar.filename" />
+    <basename property="openssl-lib.jar.filename" file="${openssl-lib.jar}"/>
+    <delete verbose="true">
+      <fileset dir="${tomcat.build}/lib">
+        <include name="tomcat-coyote-openssl-*.jar"/>
+        <exclude name="${openssl-lib.jar.filename}"/>
+      </fileset>
+    </delete>
+    <copy file="${openssl-lib.jar}" todir="${tomcat.build}/lib"/>
+    -->
+
     <!-- Add sources for examples -->
     <antcall target="examples-sources" />
   </target>
@@ -1911,6 +1925,23 @@
     </condition>
   </target>
 
+  <!-- Set Java 17 specific properties -->
+  <condition property="java17.nativeaccess" 
value="--enable-native-access=ALL-UNNAMED"><javaversion 
exactly="17"/></condition>
+  <property name="java17.nativeaccess" value="-Dtest.1=1"/>
+  <condition property="java17.addmodules" value="--add-modules"><javaversion 
exactly="17"/></condition>
+  <property name="java17.addmodules" value="-Dtest.2=2"/>
+  <condition property="java17.incubatorforeign" 
value="jdk.incubator.foreign"><javaversion exactly="17"/></condition>
+  <property name="java17.incubatorforeign" value="-Dtest.3=3"/>
+  <condition property="runtests.librarypath" value="-Dtest.4=4">
+    <and>
+      <javaversion exactly="17"/>
+      <resourceexists>
+        <file file="${openssl-lib.jar}"/>
+      </resourceexists>
+    </and>
+  </condition>
+  <property name="runtests.librarypath" 
value="-Djava.library.path=${test.apr.loc}"/>
+
   <macrodef name="runtests"
             description="Runs the unit tests using the specified connector.
               Does not stop on errors, but sets 'test.result.error' and 
'test.result.failure' properties.">
@@ -1933,7 +1964,7 @@
 
           <jvmarg value="${test.jvmarg.egd}"/>
           <jvmarg value="-Dfile.encoding=UTF-8"/>
-          <jvmarg value="-Djava.library.path=${test.apr.loc}"/>
+          <jvmarg value="${runtests.librarypath}"/>
           <jvmarg value="${test.formatter}"/>
           <jvmarg 
value="-Djava.net.preferIPv4Stack=${java.net.preferIPv4Stack}"/>
           <jvmarg value="--add-opens=java.base/java.lang=ALL-UNNAMED"/>
@@ -1941,6 +1972,9 @@
           <jvmarg value="--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED"/>
           <jvmarg value="--add-opens=java.base/java.util=ALL-UNNAMED"/>
           <jvmarg 
value="--add-opens=java.base/java.util.concurrent=ALL-UNNAMED"/>
+          <jvmarg value="${java17.nativeaccess}"/>
+          <jvmarg value="${java17.addmodules}"/>
+          <jvmarg value="${java17.incubatorforeign}"/>
 
           <classpath refid="tomcat.test.classpath" />
 
diff --git a/modules/openssl-java17/README.md b/modules/openssl-java17/README.md
index 8e6e44a..71fb5c2 100644
--- a/modules/openssl-java17/README.md
+++ b/modules/openssl-java17/README.md
@@ -49,48 +49,6 @@ native code:
 export JAVA_OPTS="--enable-native-access=ALL-UNNAMED --add-modules 
jdk.incubator.foreign"
 ```
 
-## Running the testsuite
-
-Use the following patch for `build.xml` before running the testuite:
-```
-diff --git a/build.xml b/build.xml
-index dc1260b..dd9fba9 100644
---- a/build.xml
-+++ b/build.xml
-@@ -213,6 +213,8 @@
-   <defaultexcludes remove="**/.gitignore" />
-   <!--<defaultexcludes echo="true" />-->
-
-   <!-- Classpaths -->
-   <path id="compile.classpath">
-     <pathelement location="${bnd.jar}"/>
-@@ -240,6 +242,7 @@
-     <pathelement location="${derby.jar}"/>
-     <pathelement location="${derby-shared.jar}"/>
-     <pathelement location="${derby-tools.jar}"/>
-+    <pathelement 
location="output/build/lib/tomcat-coyote-openssl-java17-0.1.jar"/>
-     <path refid="compile.classpath" />
-     <path refid="tomcat.classpath" />
-   </path>
-@@ -1944,7 +1947,6 @@
-
-           <jvmarg value="${test.jvmarg.egd}"/>
-           <jvmarg value="-Dfile.encoding=UTF-8"/>
--          <jvmarg value="-Djava.library.path=${test.apr.loc}"/>
-           <jvmarg value="${test.formatter}"/>
-           <jvmarg 
value="-Djava.net.preferIPv4Stack=${java.net.preferIPv4Stack}"/>
-           <jvmarg value="--add-opens=java.base/java.lang=ALL-UNNAMED"/>
-@@ -1952,6 +1954,9 @@
-           <jvmarg value="--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED"/>
-           <jvmarg value="--add-opens=java.base/java.util=ALL-UNNAMED"/>
-           <jvmarg 
value="--add-opens=java.base/java.util.concurrent=ALL-UNNAMED"/>
-+          <jvmarg value="--enable-native-access=ALL-UNNAMED"/>
-+          <jvmarg value="--add-modules"/>
-+          <jvmarg value="jdk.incubator.foreign"/>
-
-           <classpath refid="tomcat.test.classpath" />
-```
-
 ## Generating the OpenSSL API code using jextract (optional)
 
 This step is only useful to be able to use additional native APIs from OpenSSL

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to