From 161ad8065bd4d9a1d9403afc378dc6ea74c58671 Mon Sep 17 00:00:00 2001 From: Adam Domurad Date: Thu, 28 Jun 2012 10:51:30 -0400 Subject: 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. --- .../resources/AppletFolderInArchiveTag.html | 42 +++++++++++++++ .../srcs/AppletFolderInArchiveTag.java | 58 ++++++++++++++++++++ .../custom/AppletFolderInArchiveTag/srcs/Makefile | 18 +++++++ .../testcases/AppletFolderInArchiveTagTests.java | 61 ++++++++++++++++++++++ 4 files changed, 179 insertions(+) create mode 100644 tests/jnlp_tests/custom/AppletFolderInArchiveTag/resources/AppletFolderInArchiveTag.html create mode 100644 tests/jnlp_tests/custom/AppletFolderInArchiveTag/srcs/AppletFolderInArchiveTag.java create mode 100644 tests/jnlp_tests/custom/AppletFolderInArchiveTag/srcs/Makefile create mode 100644 tests/jnlp_tests/custom/AppletFolderInArchiveTag/testcases/AppletFolderInArchiveTagTests.java (limited to 'tests/jnlp_tests') 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 @@ + + +

+

+ + 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="

Required to recognize folder structure

" + +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 -- cgit v1.2.3