From ffc750defd54ecc8534bfbd71d819c971ce896ab Mon Sep 17 00:00:00 2001 From: Jason Feng Date: Tue, 3 Oct 2023 18:56:17 -0400 Subject: [PATCH] Add AIX sun.font.FontManagerNativeLibrary.load() test Signed-off-by: Jason Feng --- .../cmdLineTests/loadLibraryTest/build.xml | 14 +++++- .../loadLibraryTest/loadLibraryTestAIX.xml | 38 +++++++++++++++ .../cmdLineTests/loadLibraryTest/playlist.xml | 48 +++++++++++++++++++ .../test/loadLibrary/TestLoadLibraryAIX.java | 35 ++++++++++++++ 4 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 test/functional/cmdLineTests/loadLibraryTest/loadLibraryTestAIX.xml create mode 100644 test/functional/cmdLineTests/loadLibraryTest/src/org/openj9/test/loadLibrary/TestLoadLibraryAIX.java diff --git a/test/functional/cmdLineTests/loadLibraryTest/build.xml b/test/functional/cmdLineTests/loadLibraryTest/build.xml index 80dbf3fba2d..da4a3549daf 100644 --- a/test/functional/cmdLineTests/loadLibraryTest/build.xml +++ b/test/functional/cmdLineTests/loadLibraryTest/build.xml @@ -47,7 +47,19 @@ ===executable: ${compiler.javac} ===debug: on ===destdir: ${DEST} - + + + + + + + + + + + + + diff --git a/test/functional/cmdLineTests/loadLibraryTest/loadLibraryTestAIX.xml b/test/functional/cmdLineTests/loadLibraryTest/loadLibraryTestAIX.xml new file mode 100644 index 00000000000..7f09109c964 --- /dev/null +++ b/test/functional/cmdLineTests/loadLibraryTest/loadLibraryTestAIX.xml @@ -0,0 +1,38 @@ + + + + + + + + + $JAVA_COMMAND$ $ADDEXPORTS$ -cp $TESTSJARPATH$ org.openj9.test.loadLibrary.TestLoadLibraryAIX + TestLoadLibraryAIX passed + java.lang.UnsatisfiedLinkError + Unhandled Exception + corrupt + Processing dump event + JVM requested Java dump + JVM requested Snap dump + + diff --git a/test/functional/cmdLineTests/loadLibraryTest/playlist.xml b/test/functional/cmdLineTests/loadLibraryTest/playlist.xml index 895b4a95d4d..807d01ab699 100644 --- a/test/functional/cmdLineTests/loadLibraryTest/playlist.xml +++ b/test/functional/cmdLineTests/loadLibraryTest/playlist.xml @@ -43,4 +43,52 @@ ibm + + cmdLineTester_loadLibraryTestsAIX_JDK8 + $(JAVA_COMMAND) $(CMDLINETESTER_JVM_OPTIONS) -DJAVA_COMMAND=$(JAVA_COMMAND) \ + -DTESTSJARPATH=$(Q)$(TEST_RESROOT)$(D)loadLibraryTest.jar$(Q) \ + -DADDEXPORTS= \ + -DRESJAR=$(CMDLINETESTER_RESJAR) -jar $(CMDLINETESTER_JAR) \ + -config $(Q)$(TEST_RESROOT)$(D)loadLibraryTestAIX.xml$(Q) \ + -nonZeroExitWhenError; \ + $(TEST_STATUS) + os.aix + + sanity + + + functional + + + 8 + + + openj9 + ibm + + + + cmdLineTester_loadLibraryTestsAIX + $(JAVA_COMMAND) $(CMDLINETESTER_JVM_OPTIONS) -DJAVA_COMMAND=$(JAVA_COMMAND) \ + -DTESTSJARPATH=$(Q)$(TEST_RESROOT)$(D)loadLibraryTest.jar$(Q) \ + -DADDEXPORTS=$(Q)--add-exports java.desktop/sun.font=ALL-UNNAMED$(Q) \ + -DRESJAR=$(CMDLINETESTER_RESJAR) -jar $(CMDLINETESTER_JAR) \ + -config $(Q)$(TEST_RESROOT)$(D)loadLibraryTestAIX.xml$(Q) \ + -nonZeroExitWhenError; \ + $(TEST_STATUS) + os.aix + + sanity + + + functional + + + 11+ + + + openj9 + ibm + + diff --git a/test/functional/cmdLineTests/loadLibraryTest/src/org/openj9/test/loadLibrary/TestLoadLibraryAIX.java b/test/functional/cmdLineTests/loadLibraryTest/src/org/openj9/test/loadLibrary/TestLoadLibraryAIX.java new file mode 100644 index 00000000000..d58ef48c1c0 --- /dev/null +++ b/test/functional/cmdLineTests/loadLibraryTest/src/org/openj9/test/loadLibrary/TestLoadLibraryAIX.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright IBM Corp. and others 2023 + * + * This program and the accompanying materials are made available under + * the terms of the Eclipse Public License 2.0 which accompanies this + * distribution and is available at https://www.eclipse.org/legal/epl-2.0/ + * or the Apache License, Version 2.0 which accompanies this distribution and + * is available at https://www.apache.org/licenses/LICENSE-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 [1] and GNU General Public License, version 2 with the + * OpenJDK Assembly Exception [2]. + * + * [1] https://www.gnu.org/software/classpath/license.html + * [2] https://openjdk.org/legal/assembly-exception.html + * + * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 + *******************************************************************************/ +package org.openj9.test.loadLibrary; + +public class TestLoadLibraryAIX +{ + static { + // AIX UnsatisfiedLinkError: Failed to load library libfontmanager.so + // https://github.com/eclipse-openj9/openj9/issues/17759 + sun.font.FontManagerNativeLibrary.load(); + } + + public static void main(String[] args) { + System.out.println("TestLoadLibraryAIX passed"); + } +}