Mercurial > hg > release > icedtea-web-1.8
changeset 583:5402d0a45fdf
Reproducer for PR1189
author | Saad Mohammad <smohammad@redhat.com> |
---|---|
date | Mon, 10 Dec 2012 17:42:41 -0500 |
parents | c6c31f239613 |
children | 0187d8df56b4 |
files | ChangeLog tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletJnlpWithMainClass.jnlp tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java |
diffstat | 5 files changed, 217 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Mon Dec 10 17:35:50 2012 -0500 +++ b/ChangeLog Mon Dec 10 17:42:41 2012 -0500 @@ -1,3 +1,15 @@ +2012-12-10 Saad Mohammad <smohammad@redhat.com> + + Add reproducer for PR1189. + * tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html: + Simple webpage which contains an applet tag with no code attribute. + * tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.jnlp: + Jnlp file that is used by the webpages using jnlp_href. + * tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java: + Testcase that tests applets without code attribute in html pages. + * tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java: + Simple applet class that outputs a string. + 2012-12-10 Saad Mohammad <smohammad@redhat.com> Fix PR1189: Icedtea-plugin requires code attribute when using jnlp_href.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletJnlpWithMainClass.jnlp Mon Dec 10 17:42:41 2012 -0500 @@ -0,0 +1,57 @@ +<!-- +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="AppletJnlpWithMainClass.jnlp"> + <information> + <title>AppletJnlpWithMainClass</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web "/> + <description>AppletJnlpWithMainClass</description> + <offline/> + </information> + <resources> + <j2se version="1.4+"/> + <jar href="SimpleApplet.jar"/> + </resources> + <applet-desc + documentBase="." + name="SimpleApplet" + main-class="SimpleApplet" + width="100" + height="100"> + </applet-desc> +</jnlp>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/resources/AppletTagWithMissingCodeAttribute.html Mon Dec 10 17:42:41 2012 -0500 @@ -0,0 +1,44 @@ +<!-- +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="black"> +<p> + <applet width="800" height="600"> + <param name="jnlp_href" value="AppletJnlpWithMainClass.jnlp"> + </applet> +</p> +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/simple/AppletTagWithMissingCodeAttribute/testcases/AppletTagWithMissingCodeAttribute.java Mon Dec 10 17:42:41 2012 -0500 @@ -0,0 +1,57 @@ +/* AppletTagWithMissingCodeAttribute.java + Copyright (C) 2012 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 junit.framework.Assert; +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.ServerAccess.AutoClose; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import org.junit.Test; + +public class AppletTagWithMissingCodeAttribute extends BrowserTest { + + final static String closingString = AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING; + + @Test + @TestInBrowsers(testIn = { Browsers.firefox }) + public void EmbeddedAppletWithMissingCodeAttribute() throws Exception { + ProcessResult pr = server.executeBrowser("/AppletTagWithMissingCodeAttribute.html", AutoClose.CLOSE_ON_CORRECT_END); + Assert.assertTrue("Stdout should contain " + closingString + " but did not", pr.stdout.contains(closingString)); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/simple/SimpleApplet/srcs/SimpleApplet.java Mon Dec 10 17:42:41 2012 -0500 @@ -0,0 +1,47 @@ +/* SimpleApplet.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; + +@SuppressWarnings("serial") +public class SimpleApplet extends Applet { + + @Override + public void start() { + System.out.println("*** APPLET FINISHED ***"); + } +}