Mercurial > hg > release > icedtea-web-1.7
changeset 1204:a5e268a5b6dd
Add reproducers for jnlp_href attribute
2015-04-13 Jie Kang <jkang@redhat.com>
Add reproducers for jnlp_href attribute
* tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.html:
* tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.jnlp:
* tests/reproducers/simple/JnlpHrefAttribute/srcs/JnlpHrefAttribute.java:
* tests/reproducers/simple/JnlpHrefAttribute/testcases/JnlpHrefAttributeTest.java:
Added test for firefox/opera that succeeds with attribute and test for
midori/epiphany that fails with attribute
author | Jie Kang <jkang@redhat.com> |
---|---|
date | Mon, 13 Apr 2015 10:32:57 -0400 |
parents | ebcd2aaa59c7 |
children | 0488d15d3f0e |
files | ChangeLog tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.html tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.jnlp tests/reproducers/simple/JnlpHrefAttribute/srcs/JnlpHrefAttribute.java tests/reproducers/simple/JnlpHrefAttribute/testcases/JnlpHrefAttributeTest.java |
diffstat | 5 files changed, 193 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Mon Apr 13 14:59:38 2015 +0200 +++ b/ChangeLog Mon Apr 13 10:32:57 2015 -0400 @@ -1,3 +1,12 @@ +2015-04-13 Jie Kang <jkang@redhat.com> + Add reproducers for jnlp_href attribute + * tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.html: + * tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.jnlp: + * tests/reproducers/simple/JnlpHrefAttribute/srcs/JnlpHrefAttribute.java: + * tests/reproducers/simple/JnlpHrefAttribute/testcases/JnlpHrefAttributeTest.java: + Added test for firefox/opera that succeeds with attribute and test for + midori/epiphany that fails with attribute + 2015-04-13 Jiri Vanek <jvanek@redhat.com> set single place for keystore operations
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.html Mon Apr 13 10:32:57 2015 -0400 @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html> +<head lang="en"> + <meta charset="UTF-8"> + <title></title> +</head> +<body> +<applet id='applet' code='JnlpHrefAttribute' + jnlp_href="JnlpHrefAttribute.jnlp" + width=640 height=480 MAYSCRIPT + scriptable=true> +</applet> + +</body> +</html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/simple/JnlpHrefAttribute/resources/JnlpHrefAttribute.jnlp Mon Apr 13 10:32:57 2015 -0400 @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8"?> +<jnlp spec="1.0" href="JnlpHrefAttribute.jnlp"> + <information> + <title>simple application</title> + <vendor>IcedTea</vendor> + <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/> + </information> + <resources> + <j2se version="1.6+"/> + <jar href="JnlpHrefAttribute.jar"/> + </resources> + <applet-desc main-class="JnlpHrefAttribute"> + </applet-desc> +</jnlp> + +<!-- +Copyright (C) 2014 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. +-->
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/simple/JnlpHrefAttribute/srcs/JnlpHrefAttribute.java Mon Apr 13 10:32:57 2015 -0400 @@ -0,0 +1,49 @@ +/* +Copyright (C) 2014 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.lang.System; +import java.applet.Applet; + +public class JnlpHrefAttribute extends Applet { + + private static final String initStr = "*** APPLET FINISHED ***"; + + @Override + public void init() { + System.out.println(initStr); + } + +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/reproducers/simple/JnlpHrefAttribute/testcases/JnlpHrefAttributeTest.java Mon Apr 13 10:32:57 2015 -0400 @@ -0,0 +1,69 @@ +/* +Copyright (C) 2014 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 org.junit.Assert; +import org.junit.Test; + +import net.sourceforge.jnlp.ProcessResult; +import net.sourceforge.jnlp.annotations.NeedsDisplay; +import net.sourceforge.jnlp.annotations.TestInBrowsers; +import net.sourceforge.jnlp.browsertesting.BrowserTest; +import net.sourceforge.jnlp.browsertesting.Browsers; +import net.sourceforge.jnlp.closinglisteners.AutoErrorClosingListener; +import net.sourceforge.jnlp.closinglisteners.AutoOkClosingListener; + +public class JnlpHrefAttributeTest extends BrowserTest { + @Test + @TestInBrowsers(testIn = { Browsers.firefox, Browsers.opera}) + @NeedsDisplay + public void testJnlpHrefAttributeWorks() throws Exception { + String url = "./JnlpHrefAttribute.html"; + ProcessResult pr = server.executeBrowser(url, new AutoOkClosingListener(), new AutoOkClosingListener()); + Assert.assertTrue("The stdout should contain " + AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING + ", but it didnt.", pr.stdout.contains(AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING)); + } + + @Test + @TestInBrowsers(testIn = { Browsers.midori, Browsers.epiphany}) + @NeedsDisplay + public void testJnlpHrefAttributeDoesNotWork() throws Exception { + String url = "./JnlpHrefAttribute.html"; + ProcessResult pr = server.executeBrowser(url, new AutoErrorClosingListener(), new AutoErrorClosingListener()); + Assert.assertFalse("The stdout should not contain " + AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING + ", but it did.", pr.stdout.contains(AutoOkClosingListener.MAGICAL_OK_CLOSING_STRING)); + } + + +}