diff --git a/test/functional/cmdLineTests/jython/build.xml b/test/functional/cmdLineTests/jython/build.xml new file mode 100644 index 00000000000..57c5440b5d0 --- /dev/null +++ b/test/functional/cmdLineTests/jython/build.xml @@ -0,0 +1,76 @@ + + + + + + + + Build jython hello + + + + + + + + + + + + + + + + Ant version is ${ant.version} + ============COMPILER SETTINGS============ + ===fork: yes + ===executable: ${compiler.javac} + ===debug: on + ===destdir: ${DEST} + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/functional/cmdLineTests/jython/jython.xml b/test/functional/cmdLineTests/jython/jython.xml new file mode 100644 index 00000000000..41c777325aa --- /dev/null +++ b/test/functional/cmdLineTests/jython/jython.xml @@ -0,0 +1,34 @@ + + + + + + + + + + $EXE$ -XshowSettings:vm -Dpython.options.showJavaExceptions=true -Dpython.options.includeJavaStackInExceptions=true -Dpython.options.showPythonProxyExceptions=true -cp $Q$$JARPATH$$Q$ JythonHello + Hello Python World! + + + diff --git a/test/functional/cmdLineTests/jython/playlist.xml b/test/functional/cmdLineTests/jython/playlist.xml new file mode 100644 index 00000000000..97c22de0ad4 --- /dev/null +++ b/test/functional/cmdLineTests/jython/playlist.xml @@ -0,0 +1,51 @@ + + + + + cmdLineTester_jython + + NoOptions + Mode108 + Mode109 + Mode116 + Mode608 + Mode609 + + $(JAVA_COMMAND) $(JVM_OPTIONS)\ + -DJARPATH=$(Q)$(LIB_DIR)$(D)jython-standalone.jar$(P)$(TEST_RESROOT)$(D)cmdLineTester_jython.jar$(Q) \ + -DEXE=$(SQ)$(JAVA_COMMAND) $(JVM_OPTIONS)$(SQ) \ + -jar $(CMDLINETESTER_JAR) -config $(Q)$(TEST_RESROOT)$(D)jython.xml$(Q) \ + -explainExcludes -xids all,$(PLATFORM),$(VARIATION) -nonZeroExitWhenError; \ + $(TEST_STATUS) + + sanity + + + functional + + + openj9 + ibm + + + diff --git a/test/functional/cmdLineTests/jython/src/JythonHello.java b/test/functional/cmdLineTests/jython/src/JythonHello.java new file mode 100644 index 00000000000..aee4213c08b --- /dev/null +++ b/test/functional/cmdLineTests/jython/src/JythonHello.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2021, 2021 IBM Corp. and others + * + * 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] http://openjdk.java.net/legal/assembly-exception.html + * + * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception + *******************************************************************************/ +import org.python.core.PyList; +import org.python.core.PyObject; +import org.python.core.PyString; +import org.python.util.InteractiveInterpreter; + +public class JythonHello { + public static void main(String[] arg) throws Throwable { + InteractiveInterpreter interp = new InteractiveInterpreter(); + interp.exec("print('Hello Python World!')"); + } +} \ No newline at end of file