Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # HG changeset patch
- # User Jiri Vanek <[email protected]>
- # Date 1481889053 -3600
- # Node ID 2461eeea269fc5ac25ad0fe4e1290af663ba9a3d
- # Parent d5801f6cc5b35ce3f9ab0a550b77feecb271eb59
- Nashorn made accessible to javaws applications
- * NEWS: mentioned PR3263
- * launcher/launchers.in: added nashorn to BOOT_CLASSPATH
- * tests/reproducers/signed/jsengineSigned/: reproducer of behavior
- * tests/reproducers/simple/jsengine/: for completeness, added signed reproducer of behavior
- diff -r d5801f6cc5b3 -r 2461eeea269f launcher/launchers.in
- --- a/launcher/launchers.in Mon Nov 21 14:23:11 2016 +0100
- +++ b/launcher/launchers.in Fri Dec 16 12:50:53 2016 +0100
- @@ -1,5 +1,6 @@
- #!/bin/bash
- +NASHORN=lib/ext/nashorn.jar
- JAVA=@JAVA@
- LAUNCHER_BOOTCLASSPATH=@LAUNCHER_BOOTCLASSPATH@
- LAUNCHER_FLAGS=-Xms8m
- @@ -28,9 +29,12 @@
- if [ -e "$CUSTOM_JRE" -a -e "$CUSTOM_JRE/bin/java" ] ; then
- JAVA=$CUSTOM_JRE/bin/java
- CP=$CUSTOM_JRE/lib/rt.jar:$CUSTOM_JRE/lib/jfxrt.jar
- + LAUNCHER_BOOTCLASSPATH=$LAUNCHER_BOOTCLASSPATH:$CUSTOM_JRE/$NASHORN
- else
- echo "Your custom JRE $CUSTOM_JRE read from deployment.properties under key $PROPERTY_NAME as $CUSTOM_JRE is not valid. Using default ($JAVA, $CP) in attempt to start. Please fix this."
- fi
- +else
- + LAUNCHER_BOOTCLASSPATH="$LAUNCHER_BOOTCLASSPATH:@JRE@/$NASHORN"
- fi;
- JDK9="NO"
- diff -r d5801f6cc5b3 -r 2461eeea269f tests/reproducers/signed/jsengineSigned/resources/jsengineSigned.jnlp
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/tests/reproducers/signed/jsengineSigned/resources/jsengineSigned.jnlp Fri Dec 16 12:50:53 2016 +0100
- @@ -0,0 +1,56 @@
- +<!--
- +
- +This file is part of IcedTea.
- +
- +IcedTea is free software; you can redistribute it and/or modify
- +it under the terms of the GNU General Public License as published by
- +the Free Software Foundation; either version 2, or (at your option)
- +any later version.
- +
- +IcedTea is distributed in the hope that it will be useful, but
- +WITHOUT ANY WARRANTY; without even the implied warranty of
- +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- +General Public License for more details.
- +
- +You should have received a copy of the GNU General Public License
- +along with IcedTea; see the file COPYING. If not, write to the
- +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- +02110-1301 USA.
- +
- +Linking this library statically or dynamically with other modules is
- +making a combined work based on this library. Thus, the terms and
- +conditions of the GNU General Public License cover the whole
- +combination.
- +
- +As a special exception, the copyright holders of this library give you
- +permission to link this library with independent modules to produce an
- +executable, regardless of the license terms of these independent
- +modules, and to copy and distribute the resulting executable under
- +terms of your choice, provided that you also meet, for each linked
- +independent module, the terms and conditions of the license of that
- +module. An independent module is a module which is not derived from
- +or based on this library. If you modify this library, you may extend
- +this exception to your version of the library, but you are not
- +obligated to do so. If you do not wish to do so, delete this
- +exception statement from your version.
- +
- + -->
- +<?xml version="1.0" encoding="utf-8"?>
- +<jnlp spec="1.0" href="jsengineSigned.jnlp" codebase=".">
- + <information>
- + <title>jsengineSigned</title>
- + <vendor>IcedTea</vendor>
- + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/>
- + <description>jsengineSigned</description>
- + <offline/>
- + </information>
- + <security>
- + <all-permissions/>
- + </security>
- + <resources>
- + <j2se version="1.4+"/>
- + <jar href="jsengineSigned.jar"/>
- + </resources>
- + <application-desc main-class="jsengineSigned">
- + </application-desc>
- +</jnlp>
- diff -r d5801f6cc5b3 -r 2461eeea269f tests/reproducers/signed/jsengineSigned/srcs/jsengineSigned.java
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/tests/reproducers/signed/jsengineSigned/srcs/jsengineSigned.java Fri Dec 16 12:50:53 2016 +0100
- @@ -0,0 +1,56 @@
- +/* jsengineSigned.java
- +Copyright (C) 2011 Red Hat, Inc.
- +
- +This file is part of IcedTea.
- +
- +IcedTea is free software; you can redistribute it and/or
- +modify it under the terms of the GNU General Public License as published by
- +the Free Software Foundation, version 2.
- +
- +IcedTea is distributed in the hope that it will be useful,
- +but WITHOUT ANY WARRANTY; without even the implied warranty of
- +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- +General Public License for more details.
- +
- +You should have received a copy of the GNU General Public License
- +along with IcedTea; see the file COPYING. If not, write to
- +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- +02110-1301 USA.
- +
- +Linking this library statically or dynamically with other modules is
- +making a combined work based on this library. Thus, the terms and
- +conditions of the GNU General Public License cover the whole
- +combination.
- +
- +As a special exception, the copyright holders of this library give you
- +permission to link this library with independent modules to produce an
- +executable, regardless of the license terms of these independent
- +modules, and to copy and distribute the resulting executable under
- +terms of your choice, provided that you also meet, for each linked
- +independent module, the terms and conditions of the license of that
- +module. An independent module is a module which is not derived from
- +or based on this library. If you modify this library, you may extend
- +this exception to your version of the library, but you are not
- +obligated to do so. If you do not wish to do so, delete this
- +exception statement from your version.
- + */
- +
- +
- +import javax.script.ScriptEngine;
- +import javax.script.ScriptEngineManager;
- +
- +public class jsengineSigned{
- +
- + private static final ScriptEngine engine1 = new ScriptEngineManager().getEngineByName("JavaScript");
- + private static final ScriptEngine engine2 = new ScriptEngineManager(jsengineSigned.class.getClassLoader()).getEngineByName("JavaScript");
- + private static final ScriptEngine engine3 = new ScriptEngineManager(null).getEngineByName("JavaScript");
- +
- + public static void main(String[] args){
- + System.out.println("starting");
- + System.out.println("A-"+engine1+"-Z");
- + System.out.println("B-"+engine2+"-Y");
- + System.out.println("C-"+engine3+"-X");
- + System.out.println("finished");
- +
- + }
- +}
- diff -r d5801f6cc5b3 -r 2461eeea269f tests/reproducers/signed/jsengineSigned/testcases/jsengineSignedTest.java
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/tests/reproducers/signed/jsengineSigned/testcases/jsengineSignedTest.java Fri Dec 16 12:50:53 2016 +0100
- @@ -0,0 +1,61 @@
- +/* jsengineSignedTest.java
- + Copyright (C) 2011 Red Hat, Inc.
- +
- + This file is part of IcedTea.
- +
- + IcedTea is free software; you can redistribute it and/or
- + modify it under the terms of the GNU General Public License as published by
- + the Free Software Foundation, version 2.
- +
- + IcedTea is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + General Public License for more details.
- +
- + You should have received a copy of the GNU General Public License
- + along with IcedTea; see the file COPYING. If not, write to
- + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- + 02110-1301 USA.
- +
- + Linking this library statically or dynamically with other modules is
- + making a combined work based on this library. Thus, the terms and
- + conditions of the GNU General Public License cover the whole
- + combination.
- +
- + As a special exception, the copyright holders of this library give you
- + permission to link this library with independent modules to produce an
- + executable, regardless of the license terms of these independent
- + modules, and to copy and distribute the resulting executable under
- + terms of your choice, provided that you also meet, for each linked
- + independent module, the terms and conditions of the license of that
- + module. An independent module is a module which is not derived from
- + or based on this library. If you modify this library, you may extend
- + this exception to your version of the library, but you are not
- + obligated to do so. If you do not wish to do so, delete this
- + exception statement from your version.
- + */
- +
- +import net.sourceforge.jnlp.ProcessResult;
- +import net.sourceforge.jnlp.ServerAccess;
- +import org.junit.Assert;
- +
- +import org.junit.Test;
- +
- +public class jsengineSignedTest {
- +
- + private static final ServerAccess server = new ServerAccess();
- +
- + @Test
- + public void jsengineSignedTestcase1() throws Exception {
- + String originalResourceName = "jsengineSigned.jnlp";
- + ProcessResult pr = server.executeJavawsHeadless(null, "/" + originalResourceName);
- + //ServerAccess.logOutputReprint(pr.stderr);
- + //ServerAccess.logOutputReprint(pr.stdout);
- + Assert.assertTrue(pr.stdout.matches("(?s).*starting.*"));
- + Assert.assertTrue(pr.stdout.matches("(?s)(?i).*A-.*nashorn.*-Z.*") || pr.stdout.matches("(?s)(?i).*A-.*rhino.*-Z.*"));
- + Assert.assertTrue(pr.stdout.matches("(?s)(?i).*B-.*nashorn.*-Y.*") || pr.stdout.matches("(?s)(?i).*B-.*rhino.*-Y.*"));
- + Assert.assertTrue(pr.stdout.matches("(?s)(?i).*C-.*nashorn.*-X.*") || pr.stdout.matches("(?s)(?i).*C-.*rhino.*-X.*"));
- + Assert.assertTrue(pr.stdout.matches("(?s).*finished.*"));
- + }
- +}
- +
- diff -r d5801f6cc5b3 -r 2461eeea269f tests/reproducers/simple/jsengine/resources/jsengine.jnlp
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/tests/reproducers/simple/jsengine/resources/jsengine.jnlp Fri Dec 16 12:50:53 2016 +0100
- @@ -0,0 +1,53 @@
- +<!--
- +
- +This file is part of IcedTea.
- +
- +IcedTea is free software; you can redistribute it and/or modify
- +it under the terms of the GNU General Public License as published by
- +the Free Software Foundation; either version 2, or (at your option)
- +any later version.
- +
- +IcedTea is distributed in the hope that it will be useful, but
- +WITHOUT ANY WARRANTY; without even the implied warranty of
- +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- +General Public License for more details.
- +
- +You should have received a copy of the GNU General Public License
- +along with IcedTea; see the file COPYING. If not, write to the
- +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- +02110-1301 USA.
- +
- +Linking this library statically or dynamically with other modules is
- +making a combined work based on this library. Thus, the terms and
- +conditions of the GNU General Public License cover the whole
- +combination.
- +
- +As a special exception, the copyright holders of this library give you
- +permission to link this library with independent modules to produce an
- +executable, regardless of the license terms of these independent
- +modules, and to copy and distribute the resulting executable under
- +terms of your choice, provided that you also meet, for each linked
- +independent module, the terms and conditions of the license of that
- +module. An independent module is a module which is not derived from
- +or based on this library. If you modify this library, you may extend
- +this exception to your version of the library, but you are not
- +obligated to do so. If you do not wish to do so, delete this
- +exception statement from your version.
- +
- + -->
- +<?xml version="1.0" encoding="utf-8"?>
- +<jnlp spec="1.0" href="jsengine.jnlp" codebase=".">
- + <information>
- + <title>jsengine</title>
- + <vendor>IcedTea</vendor>
- + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/>
- + <description>jsengine</description>
- + <offline/>
- + </information>
- + <resources>
- + <j2se version="1.4+"/>
- + <jar href="jsengine.jar"/>
- + </resources>
- + <application-desc main-class="jsengine">
- + </application-desc>
- +</jnlp>
- diff -r d5801f6cc5b3 -r 2461eeea269f tests/reproducers/simple/jsengine/srcs/jsengine.java
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/tests/reproducers/simple/jsengine/srcs/jsengine.java Fri Dec 16 12:50:53 2016 +0100
- @@ -0,0 +1,56 @@
- +/* jsengine.java
- +Copyright (C) 2011 Red Hat, Inc.
- +
- +This file is part of IcedTea.
- +
- +IcedTea is free software; you can redistribute it and/or
- +modify it under the terms of the GNU General Public License as published by
- +the Free Software Foundation, version 2.
- +
- +IcedTea is distributed in the hope that it will be useful,
- +but WITHOUT ANY WARRANTY; without even the implied warranty of
- +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- +General Public License for more details.
- +
- +You should have received a copy of the GNU General Public License
- +along with IcedTea; see the file COPYING. If not, write to
- +the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- +02110-1301 USA.
- +
- +Linking this library statically or dynamically with other modules is
- +making a combined work based on this library. Thus, the terms and
- +conditions of the GNU General Public License cover the whole
- +combination.
- +
- +As a special exception, the copyright holders of this library give you
- +permission to link this library with independent modules to produce an
- +executable, regardless of the license terms of these independent
- +modules, and to copy and distribute the resulting executable under
- +terms of your choice, provided that you also meet, for each linked
- +independent module, the terms and conditions of the license of that
- +module. An independent module is a module which is not derived from
- +or based on this library. If you modify this library, you may extend
- +this exception to your version of the library, but you are not
- +obligated to do so. If you do not wish to do so, delete this
- +exception statement from your version.
- + */
- +
- +
- +import javax.script.ScriptEngine;
- +import javax.script.ScriptEngineManager;
- +
- +public class jsengine{
- +
- + private static final ScriptEngine engine1 = new ScriptEngineManager().getEngineByName("JavaScript");
- + private static final ScriptEngine engine2 = new ScriptEngineManager(jsengine.class.getClassLoader()).getEngineByName("JavaScript");
- + private static final ScriptEngine engine3 = new ScriptEngineManager(null).getEngineByName("JavaScript");
- +
- + public static void main(String[] args){
- + System.out.println("starting");
- + System.out.println("A-"+engine1+"-Z");
- + System.out.println("B-"+engine2+"-Y");
- + System.out.println("C-"+engine3+"-X");
- + System.out.println("finished");
- +
- + }
- +}
- diff -r d5801f6cc5b3 -r 2461eeea269f tests/reproducers/simple/jsengine/testcases/jsengineTest.java
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/tests/reproducers/simple/jsengine/testcases/jsengineTest.java Fri Dec 16 12:50:53 2016 +0100
- @@ -0,0 +1,63 @@
- +/* jsengineTest.java
- + Copyright (C) 2011 Red Hat, Inc.
- +
- + This file is part of IcedTea.
- +
- + IcedTea is free software; you can redistribute it and/or
- + modify it under the terms of the GNU General Public License as published by
- + the Free Software Foundation, version 2.
- +
- + IcedTea is distributed in the hope that it will be useful,
- + but WITHOUT ANY WARRANTY; without even the implied warranty of
- + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + General Public License for more details.
- +
- + You should have received a copy of the GNU General Public License
- + along with IcedTea; see the file COPYING. If not, write to
- + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- + 02110-1301 USA.
- +
- + Linking this library statically or dynamically with other modules is
- + making a combined work based on this library. Thus, the terms and
- + conditions of the GNU General Public License cover the whole
- + combination.
- +
- + As a special exception, the copyright holders of this library give you
- + permission to link this library with independent modules to produce an
- + executable, regardless of the license terms of these independent
- + modules, and to copy and distribute the resulting executable under
- + terms of your choice, provided that you also meet, for each linked
- + independent module, the terms and conditions of the license of that
- + module. An independent module is a module which is not derived from
- + or based on this library. If you modify this library, you may extend
- + this exception to your version of the library, but you are not
- + obligated to do so. If you do not wish to do so, delete this
- + exception statement from your version.
- + */
- +
- +import net.sourceforge.jnlp.ProcessResult;
- +import net.sourceforge.jnlp.ServerAccess;
- +import net.sourceforge.jnlp.annotations.Bug;
- +import org.junit.Assert;
- +
- +import org.junit.Test;
- +
- +public class jsengineTest {
- +
- + private static final ServerAccess server = new ServerAccess();
- +
- + @Test
- + @Bug(id="PR3263")
- + public void jsengineTestcase1() throws Exception {
- + String originalResourceName = "jsengine.jnlp";
- + ProcessResult pr = server.executeJavawsHeadless(null, "/" + originalResourceName);
- + //ServerAccess.logOutputReprint(pr.stderr);
- + //ServerAccess.logOutputReprint(pr.stdout);
- + Assert.assertTrue(pr.stdout.matches("(?s).*starting.*"));
- + Assert.assertTrue(pr.stdout.matches("(?s)(?i).*A-.*nashorn.*-Z.*") || pr.stdout.matches("(?s)(?i).*A-.*rhino.*-Z.*"));
- + Assert.assertTrue(pr.stdout.matches("(?s)(?i).*B-.*nashorn.*-Y.*") || pr.stdout.matches("(?s)(?i).*B-.*rhino.*-Y.*"));
- + Assert.assertTrue(pr.stdout.matches("(?s)(?i).*C-.*nashorn.*-X.*") || pr.stdout.matches("(?s)(?i).*C-.*rhino.*-X.*"));
- + Assert.assertTrue(pr.stdout.matches("(?s).*finished.*"));
- + }
- +}
- +
Advertisement
Add Comment
Please, Sign In to add comment