changeset 509:e591c793683a

Added PR822 reproducer
author Jiri Vanek <jvanek@redhat.com>
date Mon, 27 Aug 2012 17:38:52 +0200
parents 5c8f7941fb07
children f8cbc3cd9f33
files ChangeLog Makefile.am tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest.html tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1.jnlp tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1_requesting.jnlp tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest2.jnlp tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/MultipleSignaturesTest.java tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage.jnlp tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage_requesting.jnlp tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest2_SamePackage.jnlp tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest_SamePackage.html tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/MultipleSignaturesTestSamePackage.java tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/MultipleSignaturesTestTestsSamePackage.java tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java
diffstat 15 files changed, 841 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Aug 27 12:50:29 2012 +0200
+++ b/ChangeLog	Mon Aug 27 17:38:52 2012 +0200
@@ -1,3 +1,25 @@
+2012-08-27  Jiri Vanek  <jvanek@redhat.com>
+
+	Added tests for PR822 - multiple signatures on classpath
+	* Makefile.am: listed signed2 directory
+	* tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest.html:
+	* tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1.jnlp:
+	* tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1_requesting.jnlp:
+	* tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest2.jnlp:
+	* tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage.jnlp:
+	* tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage_requesting.jnlp:
+	* tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest2_SamePackage.jnlp:
+	* tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest_SamePackage.html:
+	various variations of multiple signtarues jnlp/html, in/out package, same/different/ signature
+	* tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/MultipleSignaturesTestSamePackage.java:	
+	simple class just with call to second jar
+	* tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/MultipleSignaturesTest.java:
+	simple class just with call to second jar, but in package
+	* tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java:
+	* tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/MultipleSignaturesTestTestsSamePackage.java
+	various testcases tro above resources
+	* tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java: "-verbose " fixed to "-verbose"
+
 2012-08-27  Jiri Vanek  <jvanek@redhat.com>
 
 	Fixed long term failing unit-test, fixed NPE from ClassLoader
--- a/Makefile.am	Mon Aug 27 12:50:29 2012 +0200
+++ b/Makefile.am	Mon Aug 27 17:38:52 2012 +0200
@@ -42,7 +42,7 @@
 export EMMA_BACKUP_SUFFIX=_noEmma
 export EMMA_SUFFIX=_withEmma
 export META_MANIFEST = META-INF/MANIFEST.MF
-export SIGNED_REPRODUCERS=signed
+export SIGNED_REPRODUCERS=signed signed2
 export SIMPLE_REPRODUCERS=simple
 export CUSTOM_REPRODUCERS=custom
 export ALL_NONCUSTOM_REPRODUCERS=$(SIMPLE_REPRODUCERS) $(SIGNED_REPRODUCERS)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest.html	Mon Aug 27 17:38:52 2012 +0200
@@ -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="somecrazytestpackage.MultipleSignaturesTest" archive="MultipleSignaturesTest.jar,SimpletestSigned1.jar" codebase="." width="800" height="600">
+</applet></p>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1.jnlp	Mon Aug 27 17:38:52 2012 +0200
@@ -0,0 +1,54 @@
+<!--
+
+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="MultipleSignaturesTest1.jnlp" codebase=".">
+  <information>
+    <title>MultipleSignaturesTest1</title>
+    <vendor>IcedTea</vendor>
+    <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/>
+    <description>MultipleSignaturesTest1</description>
+    <offline/>
+  </information>
+  <resources>
+    <j2se version="1.4+"/>
+    <jar href="MultipleSignaturesTest.jar"/>
+    <jar href="SimpletestSigned1.jar"/>
+  </resources>
+  <application-desc main-class="somecrazytestpackage.MultipleSignaturesTest">
+  </application-desc>
+</jnlp>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest1_requesting.jnlp	Mon Aug 27 17:38:52 2012 +0200
@@ -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="MultipleSignaturesTest1_requesting.jnlp" codebase=".">
+  <information>
+    <title>MultipleSignaturesTest1</title>
+    <vendor>IcedTea</vendor>
+    <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/>
+    <description>MultipleSignaturesTest1</description>
+    <offline/>
+  </information>
+  <resources>
+    <j2se version="1.4+"/>
+    <jar href="MultipleSignaturesTest.jar"/>
+    <jar href="SimpletestSigned1.jar"/>
+  </resources>
+  <application-desc main-class="somecrazytestpackage.MultipleSignaturesTest">
+  </application-desc>
+  <security>
+    <all-permissions/>
+  </security>
+</jnlp>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/signed2/MultipleSignaturesTest/resources/MultipleSignaturesTest2.jnlp	Mon Aug 27 17:38:52 2012 +0200
@@ -0,0 +1,59 @@
+<!--
+
+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="MultipleSignaturesTest2.jnlp" codebase=".">
+    <information>
+        <title>MultipleSignaturesTest2</title>
+        <vendor>IcedTea</vendor>
+        <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web "/>
+        <description>MultipleSignaturesTest2</description>
+        <offline/>
+    </information>
+    <resources>
+        <j2se version="1.4+"/>
+        <jar href="MultipleSignaturesTest.jar"/>
+        <jar href="SimpletestSigned1.jar"/>
+    </resources>
+    <applet-desc
+      documentBase="."
+      name="MultipleSignaturesTest"
+      main-class="somecrazytestpackage.MultipleSignaturesTest"
+      width="100"
+      height="100">
+    </applet-desc>
+</jnlp>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/signed2/MultipleSignaturesTest/srcs/somecrazytestpackage/MultipleSignaturesTest.java	Mon Aug 27 17:38:52 2012 +0200
@@ -0,0 +1,90 @@
+package somecrazytestpackage;
+
+import java.applet.Applet;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+/* MultipleSignaturesTest.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.
+ */
+public class MultipleSignaturesTest extends Applet {
+
+    public static void main(String[] args) {
+        executeForeignMethodCaught();
+    }
+
+    public static void executeForeignMethodCaught() {
+        try {
+            executeForeignMethod();
+        } catch (Exception ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
+    public static void executeForeignMethod() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException {
+        Class clazz = Class.forName("SimpletestSigned1");
+        Method mainMethod = clazz.getDeclaredMethod("main", String[].class);
+        mainMethod.invoke(clazz.newInstance(), (Object) null);
+    }
+
+    private class Killer extends Thread {
+
+        public int n = 2000;
+
+        @Override
+        public void run() {
+            try {
+                Thread.sleep(n);
+                System.out.println("Applet killing himself after " + n + " ms of life");
+                System.exit(0);
+            } catch (Exception ex) {
+            }
+        }
+    }
+    private Killer killer;
+
+    @Override
+    public void init() {
+        killer = new Killer();
+    }
+
+    @Override
+    public void start() {
+        killer.start();
+        System.out.println("killer was started");
+        main(null);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/signed2/MultipleSignaturesTest/testcases/MultipleSignaturesTestTests.java	Mon Aug 27 17:38:52 2012 +0200
@@ -0,0 +1,98 @@
+/* MultipleSignaturesTestTests.java
+Copyright (C) 20121 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.ProcessResult;
+import net.sourceforge.jnlp.annotations.Bug;
+import net.sourceforge.jnlp.annotations.KnownToFail;
+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;
+
+@Bug(id = {"PR822"})
+public class MultipleSignaturesTestTests  extends BrowserTest{
+
+    public static final String GSJE = "Good simple javaws exapmle";
+
+    @Test
+    @NeedsDisplay
+    public void multipleSignaturesTestJnlpApplet() throws Exception {
+        ProcessResult pr = server.executeJavaws("/MultipleSignaturesTest2.jnlp");
+        String s = GSJE;
+        Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s));
+        String cc = "xception";
+        Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));
+    }
+
+    @Test
+    @NeedsDisplay
+    @TestInBrowsers(testIn=Browsers.one)
+    public void multipleSignaturesTestHtmlApplet() throws Exception {
+        ProcessResult pr = server.executeBrowser("/MultipleSignaturesTest.html");
+        String s = GSJE;
+        Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s));
+        String cc = "xception";
+        Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));
+    }
+
+    @Test
+    public void multipleSignaturesTestJnlpApplication() throws Exception {
+        ProcessResult pr = server.executeJavawsHeadless(null, "/MultipleSignaturesTest1.jnlp");
+        //well this is questionable - application is signed but is not requesting
+        // permissions, but still usage of foreign code is allowed.
+        String s = GSJE;
+        Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s));
+        String cc = "xception";
+        Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));
+        Assert.assertEquals((Integer) 0, pr.returnValue);
+    }
+
+    @Test
+    @Bug(id={"PR822"})
+    @KnownToFail
+    public void multipleSignaturesTestJnlpApplicationRequesting() throws Exception {
+        ProcessResult pr = server.executeJavawsHeadless(null, "/MultipleSignaturesTest1_requesting.jnlp");
+        //This is buggy - application is signed, but requesting for permissions fails
+        String s = GSJE;
+        Assert.assertTrue("stdout should contains `" + s + "`, but did not", pr.stdout.contains(s));
+        String cc = "xception";
+        Assert.assertFalse("stderr should NOT contains `" + cc + "`, but did", pr.stderr.contains(cc));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage.jnlp	Mon Aug 27 17:38:52 2012 +0200
@@ -0,0 +1,54 @@
+<!--
+
+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="MultipleSignaturesTest1_SamePackage.jnlp" codebase=".">
+  <information>
+    <title>MultipleSignaturesTest1_SamePackage</title>
+    <vendor>IcedTea</vendor>
+    <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/>
+    <description>MultipleSignaturesTest1_SamePackage</description>
+    <offline/>
+  </information>
+  <resources>
+    <j2se version="1.4+"/>
+    <jar href="MultipleSignaturesTestSamePackage.jar"/>
+    <jar href="SimpletestSigned1.jar"/>
+  </resources>
+  <application-desc main-class="MultipleSignaturesTestSamePackage">
+  </application-desc>
+</jnlp>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest1_SamePackage_requesting.jnlp	Mon Aug 27 17:38:52 2012 +0200
@@ -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="MultipleSignaturesTest1_SamePackage_requesting.jnlp" codebase=".">
+  <information>
+    <title>MultipleSignaturesTest1_SamePackage</title>
+    <vendor>IcedTea</vendor>
+    <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web"/>
+    <description>MultipleSignaturesTest1_SamePackage</description>
+    <offline/>
+  </information>
+  <resources>
+    <j2se version="1.4+"/>
+    <jar href="MultipleSignaturesTestSamePackage.jar"/>
+    <jar href="SimpletestSigned1.jar"/>
+  </resources>
+  <application-desc main-class="MultipleSignaturesTestSamePackage">
+  </application-desc>
+  <security>
+    <all-permissions/>
+  </security>
+</jnlp>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest2_SamePackage.jnlp	Mon Aug 27 17:38:52 2012 +0200
@@ -0,0 +1,59 @@
+<!--
+
+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="MultipleSignaturesTest2_SamePackage.jnlp" codebase=".">
+    <information>
+        <title>MultipleSignaturesTest2_SamePackage</title>
+        <vendor>IcedTea</vendor>
+        <homepage href="http://icedtea.classpath.org/wiki/IcedTea-Web#Testing_IcedTea-Web "/>
+        <description>MultipleSignaturesTest2_SamePackage</description>
+        <offline/>
+    </information>
+    <resources>
+        <j2se version="1.4+"/>
+        <jar href="MultipleSignaturesTestSamePackage.jar"/>
+        <jar href="SimpletestSigned1.jar"/>
+    </resources>
+    <applet-desc
+      documentBase="."
+      name="MultipleSignaturesTestSamePackage"
+      main-class="MultipleSignaturesTestSamePackage"
+      width="100"
+      height="100">
+    </applet-desc>
+</jnlp>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/resources/MultipleSignaturesTest_SamePackage.html	Mon Aug 27 17:38:52 2012 +0200
@@ -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="MultipleSignaturesTestSamePackage" archive="MultipleSignaturesTestSamePackage.jar,SimpletestSigned1.jar" codebase="." width="800" height="600">
+</applet></p>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/srcs/MultipleSignaturesTestSamePackage.java	Mon Aug 27 17:38:52 2012 +0200
@@ -0,0 +1,88 @@
+import java.applet.Applet;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+/* MultipleSignaturesTest.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.
+ */
+public class MultipleSignaturesTestSamePackage extends Applet {
+
+    public static void main(String[] args) {
+            executeForeignMethodCaught();
+    }
+
+    public static void executeForeignMethodCaught() {
+        try {
+            executeForeignMethod();
+        } catch (Exception ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
+    public static void executeForeignMethod() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException {
+        Class clazz = Class.forName("SimpletestSigned1");
+        Method mainMethod = clazz.getDeclaredMethod("main", String[].class);
+        mainMethod.invoke(clazz.newInstance(), (Object) null);
+    }
+
+    private static class Killer extends Thread {
+
+        public static final int n = 2000;
+
+        @Override
+        public void run() {
+            try {
+                Thread.sleep(n);
+                System.out.println("Applet killing himself after " + n + " ms of life");
+                System.exit(0);
+            } catch (Exception ex) {
+            }
+        }
+    }
+    private Killer killer;
+
+    @Override
+    public void init() {
+        killer = new Killer();
+    }
+
+    @Override
+    public void start() {
+        killer.start();
+        System.out.println("killer was started");
+        main(null);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/signed2/MultipleSignaturesTestSamePackage/testcases/MultipleSignaturesTestTestsSamePackage.java	Mon Aug 27 17:38:52 2012 +0200
@@ -0,0 +1,117 @@
+/* MultipleSignaturesTestTests.java
+Copyright (C) 20121 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.util.Arrays;
+import java.util.List;
+import net.sourceforge.jnlp.ProcessResult;
+import net.sourceforge.jnlp.ServerAccess;
+import net.sourceforge.jnlp.annotations.Bug;
+import net.sourceforge.jnlp.annotations.KnownToFail;
+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;
+
+@Bug(id={"PR822"})
+public class MultipleSignaturesTestTestsSamePackage  extends BrowserTest{
+
+    public static final String secExcRegex =  "(?s).*java.lang.SecurityException: .* signer information does not match signer information of other classes in the same package.*";
+    public static final List<String> v = Arrays.asList(new String[] {ServerAccess.VERBOSE_OPTION});
+    private static final String GSJE= "Good simple javaws exapmle";
+
+    @Test
+    @NeedsDisplay
+    public void multipleSignaturesTestSamePackageJnlpApplet() throws Exception {
+        ProcessResult pr = server.executeJavaws(v,"/MultipleSignaturesTest2_SamePackage.jnlp");
+        String s = GSJE;
+        Assert.assertFalse("stdout should NOT contains `"+s+"`, but did",pr.stdout.contains(s));
+        String ss = "killer was started";
+        Assert.assertTrue("stdout should contains `"+ss+"`, but did not",pr.stdout.contains(ss));
+        String sss="Applet killing himself after 2000 ms of life";
+        Assert.assertTrue("stdout should contains `"+sss+"`, but did not",pr.stdout.contains(sss));
+//Applet in jnlp have exception consumed even in verbose mode. Howevwer at least foreign method is not invoken
+//        String cc = "xception";
+//        Assert.assertTrue("stderr should contains `" + cc + "`, but did not", pr.stderr.contains(cc));
+//        Assert.assertTrue("stderr should match " + secExcRegex + "`, but did not", pr.stderr.matches(secExcRegex));
+    }
+
+    @Test
+    @NeedsDisplay
+    @TestInBrowsers(testIn=Browsers.one)
+    public void multipleSignaturesTestSamePackageHtmlApplet() throws Exception {
+        ProcessResult pr = server.executeBrowser("/MultipleSignaturesTest_SamePackage.html");
+        String s = GSJE;
+        Assert.assertFalse("stdout should NOT contains `"+s+"`, but did",pr.stdout.contains(s));
+        String cc = "xception";
+        Assert.assertTrue("stderr should contains `" + cc + "`, but did not", pr.stderr.contains(cc));
+        Assert.assertTrue("stderr should match " + secExcRegex + "`, but did not", pr.stderr.matches(secExcRegex));
+        String ss = "killer was started";
+        Assert.assertTrue("stdout should contains `"+ss+"`, but did not",pr.stdout.contains(ss));
+        String sss="Applet killing himself after 2000 ms of life";
+        Assert.assertTrue("stdout should contains `"+sss+"`, but did not",pr.stdout.contains(sss));
+    }
+
+
+    @Test
+    public void multipleSignaturesTestSamePackageJnlpApplication() throws Exception {
+        ProcessResult pr = server.executeJavawsHeadless(null, "/MultipleSignaturesTest1_SamePackage.jnlp");
+        String s = GSJE;
+        Assert.assertFalse("stdout should NOT contains `"+s+"`, but did",pr.stdout.contains(s));
+        String cc = "xception";
+        Assert.assertTrue("stderr should contains `" + cc + "`, but did not", pr.stderr.contains(cc));
+        Assert.assertTrue("stderr should match " + secExcRegex + "`, but did not", pr.stderr.matches(secExcRegex));
+    }
+
+    @Test
+    @Bug(id={"PR822"})
+    @KnownToFail
+    public void multipleSignaturesTestSamePackageJnlpApplicationRequesting() throws Exception {
+        ProcessResult pr = server.executeJavawsHeadless(null, "/MultipleSignaturesTest1_SamePackage_requesting.jnlp");
+        String s = GSJE;
+        Assert.assertFalse("stdout should NOT contains `"+s+"`, but did",pr.stdout.contains(s));
+        String cc = "xception";
+        Assert.assertTrue("stderr should contains `" + cc + "`, but did not", pr.stderr.contains(cc));
+        //this is really wrong. Aplication shoud die with secExcRegex exception
+        //but not with Application Error: Cannot grant permissions to unsigned jars. Application requested security permissions, but jars are not signed.
+        //as it is now
+        Assert.assertTrue("stderr should match " + secExcRegex + "`, but did not", pr.stderr.matches(secExcRegex));
+    }
+   
+}
--- a/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java	Mon Aug 27 12:50:29 2012 +0200
+++ b/tests/test-extensions/net/sourceforge/jnlp/ServerAccess.java	Mon Aug 27 17:38:52 2012 +0200
@@ -156,7 +156,7 @@
         return port;
     }
     public static final  String HEADLES_OPTION="-headless";
-    public static final  String VERBOSE_OPTION="-verbose ";
+    public static final  String VERBOSE_OPTION="-verbose";
 
     /**
      * we would like to have an singleton instance ASAP