diff options
author | Adam Domurad <[email protected]> | 2012-06-28 10:51:30 -0400 |
---|---|---|
committer | Adam Domurad <[email protected]> | 2012-06-28 10:51:30 -0400 |
commit | 161ad8065bd4d9a1d9403afc378dc6ea74c58671 (patch) | |
tree | 5de2e569694f9375f2653e30032beabc761918ab /tests/jnlp_tests | |
parent | ef462beab7603d903195f89a3af6ec71f2b069d4 (diff) |
Fixes PR1011 w/ reproducer, folders now allowed in archive tag.
Previously folders in the archive tag were treated as jars.
They are now correctly treated as resource folders.
Diffstat (limited to 'tests/jnlp_tests')
4 files changed, 179 insertions, 0 deletions
diff --git a/tests/jnlp_tests/custom/AppletFolderInArchiveTag/resources/AppletFolderInArchiveTag.html b/tests/jnlp_tests/custom/AppletFolderInArchiveTag/resources/AppletFolderInArchiveTag.html new file mode 100644 index 0000000..88b8d99 --- /dev/null +++ b/tests/jnlp_tests/custom/AppletFolderInArchiveTag/resources/AppletFolderInArchiveTag.html @@ -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="blue"> +<p><applet code="AppletFolderInArchiveTag.class" archive="archive_tag_folder_test/"> +</applet></p> +</body> +</html> diff --git a/tests/jnlp_tests/custom/AppletFolderInArchiveTag/srcs/AppletFolderInArchiveTag.java b/tests/jnlp_tests/custom/AppletFolderInArchiveTag/srcs/AppletFolderInArchiveTag.java new file mode 100644 index 0000000..0440500 --- /dev/null +++ b/tests/jnlp_tests/custom/AppletFolderInArchiveTag/srcs/AppletFolderInArchiveTag.java @@ -0,0 +1,58 @@ +import java.applet.Applet; + +/* +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. + */ +public class AppletFolderInArchiveTag extends Applet { + + private static class Killer extends Thread { + @Override + public void run() { + try { + int n = 2000; + Thread.sleep(n); + System.exit(0); + } catch (Exception ex) { + } + } + } + + @Override + public void init() { + new Killer().start(); + System.out.println("This was ran from a folder specified in the archive tag."); + } +} diff --git a/tests/jnlp_tests/custom/AppletFolderInArchiveTag/srcs/Makefile b/tests/jnlp_tests/custom/AppletFolderInArchiveTag/srcs/Makefile new file mode 100644 index 0000000..aa7f7fe --- /dev/null +++ b/tests/jnlp_tests/custom/AppletFolderInArchiveTag/srcs/Makefile @@ -0,0 +1,18 @@ +TESTNAME=AppletFolderInArchiveTag +ARCHIVE_TEST_FOLDER=archive_tag_folder_test +JAVAC_CLASSPATH=$(JNLP_TESTS_ENGINE_DIR):$(NETX_DIR)/lib/classes.jar +DEPLOY_SUBDIR=$(JNLP_TESTS_SERVER_DEPLOYDIR)/$(ARCHIVE_TEST_FOLDER) +INDEX_HTML_BODY="<html><body><h1>Required to recognize folder structure</h1></body></html>" + +prepare-reproducer: + echo PREPARING REPRODUCER $(TESTNAME) + mkdir -p $(DEPLOY_SUBDIR) + echo INDEX_HTML_BODY > $(DEPLOY_SUBDIR)/index.html + $(EXPORTED_JAVAC) -classpath $(JAVAC_CLASSPATH) -d $(DEPLOY_SUBDIR) $(TESTNAME).java + echo PREPARED REPRODUCER $(TESTNAME) + +clean-reproducer: + echo CLEANING REPRODUCER $(TESTNAME) + rm -rf $(DEPLOY_SUBDIR) + echo CLEANED REPRODUCER $(TESTNAME) + diff --git a/tests/jnlp_tests/custom/AppletFolderInArchiveTag/testcases/AppletFolderInArchiveTagTests.java b/tests/jnlp_tests/custom/AppletFolderInArchiveTag/testcases/AppletFolderInArchiveTagTests.java new file mode 100644 index 0000000..63e8d7c --- /dev/null +++ b/tests/jnlp_tests/custom/AppletFolderInArchiveTag/testcases/AppletFolderInArchiveTagTests.java @@ -0,0 +1,61 @@ +/* AppletFolderInArchiveTagTests.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.ServerAccess.ProcessResult; +import net.sourceforge.jnlp.annotations.Bug; +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 org.junit.Assert; +import org.junit.Test; + +public class AppletFolderInArchiveTagTests extends BrowserTest{ + + + @NeedsDisplay + @Test + @TestInBrowsers(testIn={Browsers.all}) + @Bug(id="PR1011") + public void testClassInAppletFolder() throws Exception { + ProcessResult pr = server.executeBrowser("/AppletFolderInArchiveTag.html"); + + String s0 = "This was ran from a folder specified in the archive tag."; + Assert.assertTrue("Expected '"+s0+"', stdout was: " + pr.stdout, pr.stdout.contains(s0)); + } +}
\ No newline at end of file |