/hg/icedtea-web: Added signed reproducer for nashorn and applets
jvanek at icedtea.classpath.org
jvanek at icedtea.classpath.org
Wed Jan 4 13:09:54 UTC 2017
changeset af5964f5d8cf in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=af5964f5d8cf
author: Jiri Vanek <jvanek at redhat.com>
date: Wed Jan 04 14:16:33 2017 +0100
Added signed reproducer for nashorn and applets
* tests/reproducers/signed/jsengineSigned/resources/jsengineAppletSigned.html:
* tests/reproducers/signed/jsengineSigned/resources/jsengineAppletSigned.jnlp:
* tests/reproducers/signed/jsengineSigned/srcs/jsengineAppletSigned.java:
* tests/reproducers/signed/jsengineSigned/testcases/jsengineSignedTest.java:
* tests/reproducers/simple/jsengine/srcs/jsengineApplet.java:
diffstat:
ChangeLog | 10 +-
tests/reproducers/signed/jsengineSigned/resources/jsengineAppletSigned.html | 42 ++++++
tests/reproducers/signed/jsengineSigned/resources/jsengineAppletSigned.jnlp | 61 ++++++++++
tests/reproducers/signed/jsengineSigned/srcs/jsengineAppletSigned.java | 58 +++++++++
tests/reproducers/signed/jsengineSigned/testcases/jsengineSignedTest.java | 36 +++++-
tests/reproducers/simple/jsengine/srcs/jsengineApplet.java | 2 +-
6 files changed, 204 insertions(+), 5 deletions(-)
diffs (266 lines):
diff -r 56b18e91dc40 -r af5964f5d8cf ChangeLog
--- a/ChangeLog Wed Jan 04 13:16:12 2017 +0100
+++ b/ChangeLog Wed Jan 04 14:16:33 2017 +0100
@@ -1,3 +1,12 @@
+2017-01-04 Jiri Vanek <jvanek at redhat.com>
+
+ Added signed reproducer for nashorn and applets
+ * tests/reproducers/signed/jsengineSigned/resources/jsengineAppletSigned.html:
+ * tests/reproducers/signed/jsengineSigned/resources/jsengineAppletSigned.jnlp:
+ * tests/reproducers/signed/jsengineSigned/srcs/jsengineAppletSigned.java:
+ * tests/reproducers/signed/jsengineSigned/testcases/jsengineSignedTest.java:
+ * tests/reproducers/simple/jsengine/srcs/jsengineApplet.java:
+
2017-01-04 Jiri Vanek <jvanek at redhat.com>
applets got javafx and nashorn support too
@@ -10,7 +19,6 @@
* tests/reproducers/simple/jsengine/resources/jsengineApplet.html: testcase html
* tests/reproducers/simple/jsengine/testcases/jsengineTest.java: added test for apelt in html
-
2017-01-04 Jiri Vanek <jvanek at redhat.com>
Added test for javaws-applet and nashorn
diff -r 56b18e91dc40 -r af5964f5d8cf tests/reproducers/signed/jsengineSigned/resources/jsengineAppletSigned.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/signed/jsengineSigned/resources/jsengineAppletSigned.html Wed Jan 04 14:16:33 2017 +0100
@@ -0,0 +1,42 @@
+<!--
+
+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.
+
+ -->
+<html><head></head><body bgcolor="red">
+<p><applet code="jsengineAppletSigned.class" archive="jsengineSigned.jar" codebase="." width=800 height=600>
+</applet></p>
+</body>
+</html>
diff -r 56b18e91dc40 -r af5964f5d8cf tests/reproducers/signed/jsengineSigned/resources/jsengineAppletSigned.jnlp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/signed/jsengineSigned/resources/jsengineAppletSigned.jnlp Wed Jan 04 14:16:33 2017 +0100
@@ -0,0 +1,61 @@
+<!--
+
+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="jsengineAppletSigned.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>
+ <security>
+ <all-permissions/>
+ </security>
+ <resources>
+ <j2se version="1.4+"/>
+ <jar href="jsengineSigned.jar"/>
+ </resources>
+ <applet-desc
+ documentBase="."
+ name="jsengineAppletSigned"
+ main-class="jsengineAppletSigned"
+ width="250"
+ height="200">
+ </applet-desc>
+</jnlp>
diff -r 56b18e91dc40 -r af5964f5d8cf tests/reproducers/signed/jsengineSigned/srcs/jsengineAppletSigned.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/signed/jsengineSigned/srcs/jsengineAppletSigned.java Wed Jan 04 14:16:33 2017 +0100
@@ -0,0 +1,58 @@
+/* jsengineApplet.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 java.applet.Applet;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
+
+public class jsengineAppletSigned extends Applet{
+
+ private static final ScriptEngine engine1 = new ScriptEngineManager().getEngineByName("JavaScript");
+ private static final ScriptEngine engine2 = new ScriptEngineManager(jsengineAppletSigned.class.getClassLoader()).getEngineByName("JavaScript");
+ private static final ScriptEngine engine3 = new ScriptEngineManager(null).getEngineByName("JavaScript");
+
+ @Override
+ public void start(){
+ 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 56b18e91dc40 -r af5964f5d8cf tests/reproducers/signed/jsengineSigned/testcases/jsengineSignedTest.java
--- a/tests/reproducers/signed/jsengineSigned/testcases/jsengineSignedTest.java Wed Jan 04 13:16:12 2017 +0100
+++ b/tests/reproducers/signed/jsengineSigned/testcases/jsengineSignedTest.java Wed Jan 04 14:16:33 2017 +0100
@@ -36,14 +36,17 @@
*/
import net.sourceforge.jnlp.ProcessResult;
-import net.sourceforge.jnlp.ServerAccess;
+import net.sourceforge.jnlp.annotations.TestInBrowsers;
+import net.sourceforge.jnlp.browsertesting.BrowserTest;
+import static net.sourceforge.jnlp.browsertesting.BrowserTest.server;
+import net.sourceforge.jnlp.browsertesting.Browsers;
+import net.sourceforge.jnlp.closinglisteners.StringBasedClosingListener;
import org.junit.Assert;
import org.junit.Test;
-public class jsengineSignedTest {
+public class jsengineSignedTest extends BrowserTest{
- private static final ServerAccess server = new ServerAccess();
@Test
public void jsengineSignedTestcase1() throws Exception {
@@ -57,5 +60,32 @@
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.*"));
}
+
+ @Test
+ public void jsengineAppletSignedTestcase1() throws Exception {
+ String originalResourceName = "jsengineAppletSigned.jnlp";
+ ProcessResult pr = server.executeJavawsHeadless(null, "/" + originalResourceName, new StringBasedClosingListener("finished"), null, null);
+ //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.*"));
+ }
+
+ @Test
+ @TestInBrowsers(testIn = {Browsers.all})
+ public void jsengineAppletSignedTestcase2() throws Exception {
+ String originalResourceName = "jsengineAppletSigned.html";
+ ProcessResult pr = server.executeBrowser("/" + originalResourceName, new StringBasedClosingListener("finished"), null);
+ //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 56b18e91dc40 -r af5964f5d8cf tests/reproducers/simple/jsengine/srcs/jsengineApplet.java
--- a/tests/reproducers/simple/jsengine/srcs/jsengineApplet.java Wed Jan 04 13:16:12 2017 +0100
+++ b/tests/reproducers/simple/jsengine/srcs/jsengineApplet.java Wed Jan 04 14:16:33 2017 +0100
@@ -43,7 +43,7 @@
public class jsengineApplet extends Applet{
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 engine2 = new ScriptEngineManager(jsengineApplet.class.getClassLoader()).getEngineByName("JavaScript");
private static final ScriptEngine engine3 = new ScriptEngineManager(null).getEngineByName("JavaScript");
@Override
More information about the distro-pkg-dev
mailing list