aboutsummaryrefslogtreecommitdiffstats
path: root/tests/jnlp_tests/simple
diff options
context:
space:
mode:
Diffstat (limited to 'tests/jnlp_tests/simple')
-rw-r--r--tests/jnlp_tests/simple/AccessClassInPackage/resources/AccessClassInPackage.jnlp12
-rw-r--r--tests/jnlp_tests/simple/AccessClassInPackage/srcs/AccessClassInPackage.java43
-rw-r--r--tests/jnlp_tests/simple/AccessClassInPackage/testcases/AccessClassInPackageTest.java59
-rw-r--r--tests/jnlp_tests/simple/AddShutdownHook/resources/AddShutdownHook.jnlp12
-rw-r--r--tests/jnlp_tests/simple/AddShutdownHook/srcs/AddShutdownHook.java48
-rw-r--r--tests/jnlp_tests/simple/AddShutdownHook/testcases/AddShutdownHookTest.java59
-rw-r--r--tests/jnlp_tests/simple/AllStackTraces/resources/AllStackTraces.jnlp12
-rw-r--r--tests/jnlp_tests/simple/AllStackTraces/srcs/AllStackTraces.java42
-rw-r--r--tests/jnlp_tests/simple/AllStackTraces/testcases/AllStackTracesTest.java62
-rw-r--r--tests/jnlp_tests/simple/CreateClassLoader/resources/CreateClassLoader.jnlp12
-rw-r--r--tests/jnlp_tests/simple/CreateClassLoader/srcs/CreateClassLoader.java46
-rw-r--r--tests/jnlp_tests/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java59
-rw-r--r--tests/jnlp_tests/simple/ReadEnvironment/resources/ReadEnvironment.jnlp12
-rw-r--r--tests/jnlp_tests/simple/ReadEnvironment/srcs/ReadEnvironment.java44
-rw-r--r--tests/jnlp_tests/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java59
-rw-r--r--tests/jnlp_tests/simple/ReadProperties/resources/ReadProperties1.jnlp16
-rw-r--r--tests/jnlp_tests/simple/ReadProperties/resources/ReadProperties2.jnlp14
-rw-r--r--tests/jnlp_tests/simple/ReadProperties/srcs/ReadProperties.java45
-rw-r--r--tests/jnlp_tests/simple/ReadProperties/testcases/ReadPropertiesTest.java74
-rw-r--r--tests/jnlp_tests/simple/RedirectStreams/resources/RedirectStreams.jnlp12
-rw-r--r--tests/jnlp_tests/simple/RedirectStreams/srcs/RedirectStreams.java44
-rw-r--r--tests/jnlp_tests/simple/RedirectStreams/testcases/RedirectStreamsTest.java58
-rw-r--r--tests/jnlp_tests/simple/ReplaceSecurityManager/resources/ReplaceSecurityManager.jnlp12
-rw-r--r--tests/jnlp_tests/simple/ReplaceSecurityManager/srcs/ReplaceSecurityManager.java43
-rw-r--r--tests/jnlp_tests/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java58
-rw-r--r--tests/jnlp_tests/simple/SetContextClassLoader/resources/SetContextClassLoader.jnlp12
-rw-r--r--tests/jnlp_tests/simple/SetContextClassLoader/srcs/SetContextClassLoader.java44
-rw-r--r--tests/jnlp_tests/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java58
28 files changed, 1071 insertions, 0 deletions
diff --git a/tests/jnlp_tests/simple/AccessClassInPackage/resources/AccessClassInPackage.jnlp b/tests/jnlp_tests/simple/AccessClassInPackage/resources/AccessClassInPackage.jnlp
new file mode 100644
index 0000000..e73e807
--- /dev/null
+++ b/tests/jnlp_tests/simple/AccessClassInPackage/resources/AccessClassInPackage.jnlp
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp spec="1.0"
+ codebase="."
+ href="AccessClassInPackage.jnlp">
+ <information>
+ <title>Test accessClassInPackage</title>
+ </information>
+ <resources>
+ <jar href="AccessClassInPackage.jar" main="true"/>
+ </resources>
+ <application-desc main-class="AccessClassInPackage"/>
+</jnlp>
diff --git a/tests/jnlp_tests/simple/AccessClassInPackage/srcs/AccessClassInPackage.java b/tests/jnlp_tests/simple/AccessClassInPackage/srcs/AccessClassInPackage.java
new file mode 100644
index 0000000..272f245
--- /dev/null
+++ b/tests/jnlp_tests/simple/AccessClassInPackage/srcs/AccessClassInPackage.java
@@ -0,0 +1,43 @@
+/* AccessClassInPackage.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.
+ */
+
+public class AccessClassInPackage {
+
+ public static void main(String[] args) throws Exception{
+ Class.forName("sun.security.internal.spec.TlsKeyMaterialSpec");
+ }
+}
diff --git a/tests/jnlp_tests/simple/AccessClassInPackage/testcases/AccessClassInPackageTest.java b/tests/jnlp_tests/simple/AccessClassInPackage/testcases/AccessClassInPackageTest.java
new file mode 100644
index 0000000..1c46a91
--- /dev/null
+++ b/tests/jnlp_tests/simple/AccessClassInPackage/testcases/AccessClassInPackageTest.java
@@ -0,0 +1,59 @@
+/* AccessClassInPackageTest.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;
+import org.junit.Assert;
+
+import org.junit.Test;
+
+public class AccessClassInPackageTest {
+
+ private static ServerAccess server = new ServerAccess();
+
+ @Test
+ public void AccessClassInPackageTestLunch1() throws Exception {
+ System.out.println("connecting AccessClassInPackageTest request");
+ ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/AccessClassInPackage.jnlp");
+ System.out.println(pr.stdout);
+ System.err.println(pr.stderr);
+ Assert.assertTrue(pr.stderr.contains("java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.security.internal.spec)"));
+ Assert.assertFalse(pr.stderr.contains("ClassNotFoundException"));
+ Assert.assertFalse(pr.stdout.length() > 2);
+ Assert.assertFalse(pr.wasTerminated);
+ Assert.assertEquals((Integer) 0, pr.returnValue);
+ }
+}
diff --git a/tests/jnlp_tests/simple/AddShutdownHook/resources/AddShutdownHook.jnlp b/tests/jnlp_tests/simple/AddShutdownHook/resources/AddShutdownHook.jnlp
new file mode 100644
index 0000000..0af2b49
--- /dev/null
+++ b/tests/jnlp_tests/simple/AddShutdownHook/resources/AddShutdownHook.jnlp
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp spec="1.0"
+ codebase="./"
+ href="AddShutdownHook.jnlp">
+ <information>
+ <title>test adding shutdown hooks</title>
+ </information>
+ <resources>
+ <jar href="AddShutdownHook.jar" main="true" download="eager"/>
+ </resources>
+ <application-desc main-class="AddShutdownHook"/>
+</jnlp>
diff --git a/tests/jnlp_tests/simple/AddShutdownHook/srcs/AddShutdownHook.java b/tests/jnlp_tests/simple/AddShutdownHook/srcs/AddShutdownHook.java
new file mode 100644
index 0000000..2b731eb
--- /dev/null
+++ b/tests/jnlp_tests/simple/AddShutdownHook/srcs/AddShutdownHook.java
@@ -0,0 +1,48 @@
+/* AddShutdownHook.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.
+ */
+
+public class AddShutdownHook {
+ public static void main(String[] args) {
+
+ Runtime.getRuntime().addShutdownHook(new Thread() {
+ public void run() {
+ // no op
+ }
+ });
+
+ }
+}
diff --git a/tests/jnlp_tests/simple/AddShutdownHook/testcases/AddShutdownHookTest.java b/tests/jnlp_tests/simple/AddShutdownHook/testcases/AddShutdownHookTest.java
new file mode 100644
index 0000000..244a9d3
--- /dev/null
+++ b/tests/jnlp_tests/simple/AddShutdownHook/testcases/AddShutdownHookTest.java
@@ -0,0 +1,59 @@
+/* AddShutdownHookTest.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;
+import org.junit.Assert;
+
+import org.junit.Test;
+
+public class AddShutdownHookTest {
+
+ private static ServerAccess server = new ServerAccess();
+
+ @Test
+ public void AddShutdownHookTestLunch1() throws Exception {
+ System.out.println("connecting AddShutdownHook request");
+ ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/AddShutdownHook.jnlp");
+ System.out.println(pr.stdout);
+ System.err.println(pr.stderr);
+ Assert.assertTrue(pr.stderr.contains("java.security.AccessControlException: access denied (java.lang.RuntimePermission shutdownHooks)"));
+ Assert.assertFalse(pr.stderr.contains("ClassNotFoundException"));
+ Assert.assertFalse(pr.stdout.length() > 2);
+ Assert.assertFalse(pr.wasTerminated);
+ Assert.assertEquals((Integer) 0, pr.returnValue);
+ }
+}
diff --git a/tests/jnlp_tests/simple/AllStackTraces/resources/AllStackTraces.jnlp b/tests/jnlp_tests/simple/AllStackTraces/resources/AllStackTraces.jnlp
new file mode 100644
index 0000000..5d3caab
--- /dev/null
+++ b/tests/jnlp_tests/simple/AllStackTraces/resources/AllStackTraces.jnlp
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp spec="1.0"
+ codebase="./"
+ href="AllStackTraces.jnlp">
+ <information>
+ <title>Test Thread.getAllStackTraces</title>
+ </information>
+ <resources>
+ <jar href="AllStackTraces.jar" main="true" download="eager"/>
+ </resources>
+ <application-desc main-class="AllStackTraces"/>
+</jnlp>
diff --git a/tests/jnlp_tests/simple/AllStackTraces/srcs/AllStackTraces.java b/tests/jnlp_tests/simple/AllStackTraces/srcs/AllStackTraces.java
new file mode 100644
index 0000000..f871b9c
--- /dev/null
+++ b/tests/jnlp_tests/simple/AllStackTraces/srcs/AllStackTraces.java
@@ -0,0 +1,42 @@
+/* AllStackTraces.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.
+ */
+
+public class AllStackTraces {
+ public static void main(String[] args) {
+ Thread.getAllStackTraces();
+ }
+}
diff --git a/tests/jnlp_tests/simple/AllStackTraces/testcases/AllStackTracesTest.java b/tests/jnlp_tests/simple/AllStackTraces/testcases/AllStackTracesTest.java
new file mode 100644
index 0000000..2ebac58
--- /dev/null
+++ b/tests/jnlp_tests/simple/AllStackTraces/testcases/AllStackTracesTest.java
@@ -0,0 +1,62 @@
+/* AllStackTracesTest.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;
+import org.junit.Assert;
+
+import org.junit.Test;
+
+public class AllStackTracesTest {
+
+ private static ServerAccess server = new ServerAccess();
+
+
+
+ @Test
+ public void AddShutdownHookTestLunch1() throws Exception {
+ System.out.println("connecting AllStackTraces request");
+ ServerAccess.ProcessResult pr=server.executeJavawsHeadless(null,"/AllStackTraces.jnlp");
+ System.out.println(pr.stdout);
+ System.err.println(pr.stderr);
+ Assert.assertTrue(pr.stderr.contains("java.security.AccessControlException: access denied (java.lang.RuntimePermission getStackTrace)"));
+ Assert.assertFalse(pr.stderr.contains("ClassNotFoundException"));
+ Assert.assertFalse(pr.stdout.length()>2);
+ Assert.assertFalse(pr.wasTerminated);
+ Assert.assertEquals((Integer)0, pr.returnValue);
+ }
+
+ }
diff --git a/tests/jnlp_tests/simple/CreateClassLoader/resources/CreateClassLoader.jnlp b/tests/jnlp_tests/simple/CreateClassLoader/resources/CreateClassLoader.jnlp
new file mode 100644
index 0000000..c8274fb
--- /dev/null
+++ b/tests/jnlp_tests/simple/CreateClassLoader/resources/CreateClassLoader.jnlp
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp spec="1.0"
+ codebase="./"
+ href="CreateClassLoader.jnlp">
+ <information>
+ <title>set context classloader</title>
+ </information>
+ <resources>
+ <jar href="CreateClassLoader.jar" main="true" download="eager"/>
+ </resources>
+ <application-desc main-class="CreateClassLoader"/>
+</jnlp>
diff --git a/tests/jnlp_tests/simple/CreateClassLoader/srcs/CreateClassLoader.java b/tests/jnlp_tests/simple/CreateClassLoader/srcs/CreateClassLoader.java
new file mode 100644
index 0000000..e33299e
--- /dev/null
+++ b/tests/jnlp_tests/simple/CreateClassLoader/srcs/CreateClassLoader.java
@@ -0,0 +1,46 @@
+/* CreateClassLoader.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.net.URL;
+import java.net.URLClassLoader;
+
+public class CreateClassLoader {
+ public static void main(String[] args) throws Exception {
+ URLClassLoader ucl = new URLClassLoader(new URL[0]);
+
+ }
+}
diff --git a/tests/jnlp_tests/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java b/tests/jnlp_tests/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java
new file mode 100644
index 0000000..872a75a
--- /dev/null
+++ b/tests/jnlp_tests/simple/CreateClassLoader/testcases/CreateClassLoaderTest.java
@@ -0,0 +1,59 @@
+/* CreateClassLoaderTest.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;
+import org.junit.Assert;
+
+import org.junit.Test;
+
+public class CreateClassLoaderTest {
+
+ private static ServerAccess server = new ServerAccess();
+
+ @Test
+ public void CreateClassLoaderLunch1() throws Exception {
+ System.out.println("connecting CreateClassLoader request");
+ ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/CreateClassLoader.jnlp");
+ System.out.println(pr.stdout);
+ System.err.println(pr.stderr);
+ Assert.assertTrue(pr.stderr.contains("java.security.AccessControlException: access denied (java.lang.RuntimePermission createClassLoader)"));
+ Assert.assertFalse(pr.stderr.contains("ClassNotFoundException"));
+ Assert.assertFalse(pr.stdout.length() > 2);
+ Assert.assertFalse(pr.wasTerminated);
+ Assert.assertEquals((Integer) 0, pr.returnValue);
+ }
+}
diff --git a/tests/jnlp_tests/simple/ReadEnvironment/resources/ReadEnvironment.jnlp b/tests/jnlp_tests/simple/ReadEnvironment/resources/ReadEnvironment.jnlp
new file mode 100644
index 0000000..8220275
--- /dev/null
+++ b/tests/jnlp_tests/simple/ReadEnvironment/resources/ReadEnvironment.jnlp
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp spec="1.0"
+ codebase="./"
+ href="ReadEnvironment.jnlp">
+ <information>
+ <title>ReadEnvironment using System.getenv()</title>
+ </information>
+ <resources>
+ <jar href="ReadEnvironment.jar" main="true" />
+ </resources>
+ <application-desc main-class="ReadEnvironment"/>
+</jnlp>
diff --git a/tests/jnlp_tests/simple/ReadEnvironment/srcs/ReadEnvironment.java b/tests/jnlp_tests/simple/ReadEnvironment/srcs/ReadEnvironment.java
new file mode 100644
index 0000000..a426803
--- /dev/null
+++ b/tests/jnlp_tests/simple/ReadEnvironment/srcs/ReadEnvironment.java
@@ -0,0 +1,44 @@
+/* ReadEnvironment.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.
+ */
+
+public class ReadEnvironment {
+ public static void main(String[] args) {
+
+ System.getenv("USER");
+
+ }
+}
diff --git a/tests/jnlp_tests/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java b/tests/jnlp_tests/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java
new file mode 100644
index 0000000..3e0510e
--- /dev/null
+++ b/tests/jnlp_tests/simple/ReadEnvironment/testcases/ReadEnvironmentTest.java
@@ -0,0 +1,59 @@
+/* ReadEnvironmentTest.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;
+import org.junit.Assert;
+
+import org.junit.Test;
+
+public class ReadEnvironmentTest {
+
+ private static ServerAccess server = new ServerAccess();
+
+ @Test
+ public void ReadEnvironmentLunch1() throws Exception {
+ System.out.println("connecting ReadEnvironment request");
+ ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/ReadEnvironment.jnlp");
+ System.out.println(pr.stdout);
+ System.err.println(pr.stderr);
+ Assert.assertTrue(pr.stderr.contains("java.security.AccessControlException: access denied (java.lang.RuntimePermission getenv.USER)"));
+ Assert.assertFalse(pr.stderr.contains("ClassNotFoundException"));
+ Assert.assertFalse(pr.stdout.length() > 2);
+ Assert.assertFalse(pr.wasTerminated);
+ Assert.assertEquals((Integer) 0, pr.returnValue);
+ }
+}
diff --git a/tests/jnlp_tests/simple/ReadProperties/resources/ReadProperties1.jnlp b/tests/jnlp_tests/simple/ReadProperties/resources/ReadProperties1.jnlp
new file mode 100644
index 0000000..4aff8e9
--- /dev/null
+++ b/tests/jnlp_tests/simple/ReadProperties/resources/ReadProperties1.jnlp
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp spec="1.0"
+ codebase="./"
+ href="ReadProperties1.jnlp">
+ <information>
+ <title>read properties using System.getenv()</title>
+ </information>
+ <resources>
+ <jar href="ReadProperties.jar" main="true"/>
+ </resources>
+ <application-desc main-class="ReadProperties">
+ <argument>user.name</argument>
+ </application-desc>
+
+
+</jnlp>
diff --git a/tests/jnlp_tests/simple/ReadProperties/resources/ReadProperties2.jnlp b/tests/jnlp_tests/simple/ReadProperties/resources/ReadProperties2.jnlp
new file mode 100644
index 0000000..3c103be
--- /dev/null
+++ b/tests/jnlp_tests/simple/ReadProperties/resources/ReadProperties2.jnlp
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp spec="1.0"
+ codebase="./"
+ href="ReadProperties2.jnlp">
+ <information>
+ <title>read properties using System.getenv()</title>
+ </information>
+ <resources>
+ <jar href="ReadProperties.jar" main="true"/>
+ </resources>
+ <application-desc main-class="ReadProperties">
+ <argument>user.home</argument>
+ </application-desc>
+</jnlp>
diff --git a/tests/jnlp_tests/simple/ReadProperties/srcs/ReadProperties.java b/tests/jnlp_tests/simple/ReadProperties/srcs/ReadProperties.java
new file mode 100644
index 0000000..fb5d078
--- /dev/null
+++ b/tests/jnlp_tests/simple/ReadProperties/srcs/ReadProperties.java
@@ -0,0 +1,45 @@
+/* ReadProperties.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.
+ */
+public class ReadProperties {
+
+/**
+*some system property is expected as arg[0], eg user.name or user.home
+*/
+ public static void main(String[] args) {
+ System.getProperty(args[0]);
+ }
+}
diff --git a/tests/jnlp_tests/simple/ReadProperties/testcases/ReadPropertiesTest.java b/tests/jnlp_tests/simple/ReadProperties/testcases/ReadPropertiesTest.java
new file mode 100644
index 0000000..f316643
--- /dev/null
+++ b/tests/jnlp_tests/simple/ReadProperties/testcases/ReadPropertiesTest.java
@@ -0,0 +1,74 @@
+/* ReadPropertiesTest.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;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ReadPropertiesTest {
+
+ private static ServerAccess server = new ServerAccess();
+
+
+
+ @Test
+ public void ReadPropertiesLunch1() throws Exception {
+ System.out.println("connecting ReadProperties request");
+ ServerAccess.ProcessResult pr=server.executeJavawsHeadless(null,"/ReadProperties1.jnlp");
+ System.out.println(pr.stdout);
+ System.err.println(pr.stderr);
+ Assert.assertTrue(pr.stderr.contains("java.security.AccessControlException: access denied (java.util.PropertyPermission user.name read)"));
+ Assert.assertFalse(pr.stderr.contains("ClassNotFoundException"));
+ Assert.assertFalse(pr.stdout.length()>2);
+ Assert.assertFalse(pr.wasTerminated);
+ Assert.assertEquals((Integer)0, pr.returnValue);
+ }
+
+ @Test
+ public void ReadPropertiesLunch2() throws Exception {
+ System.out.println("connecting ReadProperties request");
+ ServerAccess.ProcessResult pr=server.executeJavawsHeadless(null,"/ReadProperties2.jnlp");
+ System.out.println(pr.stdout);
+ System.err.println(pr.stderr);
+ Assert.assertTrue(pr.stderr.contains("java.security.AccessControlException: access denied (java.util.PropertyPermission user.home read)"));
+ Assert.assertFalse(pr.stderr.contains("ClassNotFoundException"));
+ Assert.assertFalse(pr.stdout.length()>2);
+ Assert.assertFalse(pr.wasTerminated);
+ Assert.assertEquals((Integer)0, pr.returnValue);
+ }
+ }
diff --git a/tests/jnlp_tests/simple/RedirectStreams/resources/RedirectStreams.jnlp b/tests/jnlp_tests/simple/RedirectStreams/resources/RedirectStreams.jnlp
new file mode 100644
index 0000000..3b3d3d0
--- /dev/null
+++ b/tests/jnlp_tests/simple/RedirectStreams/resources/RedirectStreams.jnlp
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp spec="1.0"
+ codebase="./"
+ href="RedirectStreams.jnlp">
+ <information>
+ <title>redirect stdin/stdout streams</title>
+ </information>
+ <resources>
+ <jar href="RedirectStreams.jar" main="true"/>
+ </resources>
+ <application-desc main-class="RedirectStreams"/>
+</jnlp>
diff --git a/tests/jnlp_tests/simple/RedirectStreams/srcs/RedirectStreams.java b/tests/jnlp_tests/simple/RedirectStreams/srcs/RedirectStreams.java
new file mode 100644
index 0000000..2130168
--- /dev/null
+++ b/tests/jnlp_tests/simple/RedirectStreams/srcs/RedirectStreams.java
@@ -0,0 +1,44 @@
+/* RedirectStreams.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.io.StringBufferInputStream;
+
+public class RedirectStreams {
+ public static void main(String[] args) {
+ System.setIn(new StringBufferInputStream("TEST"));
+ }
+}
diff --git a/tests/jnlp_tests/simple/RedirectStreams/testcases/RedirectStreamsTest.java b/tests/jnlp_tests/simple/RedirectStreams/testcases/RedirectStreamsTest.java
new file mode 100644
index 0000000..8042fc6
--- /dev/null
+++ b/tests/jnlp_tests/simple/RedirectStreams/testcases/RedirectStreamsTest.java
@@ -0,0 +1,58 @@
+/* RedirectStreamsTest.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;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class RedirectStreamsTest {
+
+ private static ServerAccess server = new ServerAccess();
+
+ @Test
+ public void ReadPropertiesLunch1() throws Exception {
+ System.out.println("connecting RedirectStreams request");
+ ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/RedirectStreams.jnlp");
+ System.out.println(pr.stdout);
+ System.err.println(pr.stderr);
+ Assert.assertTrue(pr.stderr.contains("java.security.AccessControlException: access denied (java.lang.RuntimePermission setIO)"));
+ Assert.assertFalse(pr.stderr.contains("ClassNotFoundException"));
+ Assert.assertFalse(pr.stdout.length() > 2);
+ Assert.assertFalse(pr.wasTerminated);
+ Assert.assertEquals((Integer) 0, pr.returnValue);
+ }
+}
diff --git a/tests/jnlp_tests/simple/ReplaceSecurityManager/resources/ReplaceSecurityManager.jnlp b/tests/jnlp_tests/simple/ReplaceSecurityManager/resources/ReplaceSecurityManager.jnlp
new file mode 100644
index 0000000..670db4b
--- /dev/null
+++ b/tests/jnlp_tests/simple/ReplaceSecurityManager/resources/ReplaceSecurityManager.jnlp
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp spec="1.0"
+ codebase="./"
+ href="ReplaceSecurityManager.jnlp">
+ <information>
+ <title>Test replacing security manager</title>
+ </information>
+ <resources>
+ <jar href="ReplaceSecurityManager.jar" main="true"/>
+ </resources>
+ <application-desc main-class="ReplaceSecurityManager"/>
+</jnlp>
diff --git a/tests/jnlp_tests/simple/ReplaceSecurityManager/srcs/ReplaceSecurityManager.java b/tests/jnlp_tests/simple/ReplaceSecurityManager/srcs/ReplaceSecurityManager.java
new file mode 100644
index 0000000..e00cd5a
--- /dev/null
+++ b/tests/jnlp_tests/simple/ReplaceSecurityManager/srcs/ReplaceSecurityManager.java
@@ -0,0 +1,43 @@
+/* ReplaceSecurityManager.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.
+ */
+public class ReplaceSecurityManager {
+ public static void main(String[] args) throws Exception{
+
+ System.setSecurityManager(null);
+
+ }
+}
diff --git a/tests/jnlp_tests/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java b/tests/jnlp_tests/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java
new file mode 100644
index 0000000..bbd8faa
--- /dev/null
+++ b/tests/jnlp_tests/simple/ReplaceSecurityManager/testcases/ReplaceSecurityManagerTest.java
@@ -0,0 +1,58 @@
+/* ReplaceSecurityManagerTest.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;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ReplaceSecurityManagerTest {
+
+ private static ServerAccess server = new ServerAccess();
+
+ @Test
+ public void ReplaceSecurityManagerLunch1() throws Exception {
+ System.out.println("connecting RedirectStreams request");
+ ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/ReplaceSecurityManager.jnlp");
+ System.out.println(pr.stdout);
+ System.err.println(pr.stderr);
+ Assert.assertTrue(pr.stderr.contains("java.security.AccessControlException: access denied (java.lang.RuntimePermission setSecurityManager)"));
+ Assert.assertFalse(pr.stderr.contains("ClassNotFoundException"));
+ Assert.assertFalse(pr.stdout.length() > 2);
+ Assert.assertFalse(pr.wasTerminated);
+ Assert.assertEquals((Integer) 0, pr.returnValue);
+ }
+}
diff --git a/tests/jnlp_tests/simple/SetContextClassLoader/resources/SetContextClassLoader.jnlp b/tests/jnlp_tests/simple/SetContextClassLoader/resources/SetContextClassLoader.jnlp
new file mode 100644
index 0000000..ef02a81
--- /dev/null
+++ b/tests/jnlp_tests/simple/SetContextClassLoader/resources/SetContextClassLoader.jnlp
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp spec="1.0"
+ codebase="./"
+ href="SetContextClassLoader.jnlp">
+ <information>
+ <title>set context classloader</title>
+ </information>
+ <resources>
+ <jar href="SetContextClassLoader.jar" main="true" download="eager"/>
+ </resources>
+ <application-desc main-class="SetContextClassLoader"/>
+</jnlp>
diff --git a/tests/jnlp_tests/simple/SetContextClassLoader/srcs/SetContextClassLoader.java b/tests/jnlp_tests/simple/SetContextClassLoader/srcs/SetContextClassLoader.java
new file mode 100644
index 0000000..5c5b215
--- /dev/null
+++ b/tests/jnlp_tests/simple/SetContextClassLoader/srcs/SetContextClassLoader.java
@@ -0,0 +1,44 @@
+/* SetContextClassLoader.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.
+ */
+
+public class SetContextClassLoader {
+ public static void main(String[] args) throws Exception{
+
+ Thread.currentThread().setContextClassLoader(null);
+
+ }
+}
diff --git a/tests/jnlp_tests/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java b/tests/jnlp_tests/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java
new file mode 100644
index 0000000..cceabe4
--- /dev/null
+++ b/tests/jnlp_tests/simple/SetContextClassLoader/testcases/SetContextClassLoaderTest.java
@@ -0,0 +1,58 @@
+/* SetContextClassLoaderTest.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;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class SetContextClassLoaderTest {
+
+ private static ServerAccess server = new ServerAccess();
+
+ @Test
+ public void SetContextClassLoader1() throws Exception {
+ System.out.println("connecting RedirectStreams request");
+ ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/SetContextClassLoader.jnlp");
+ System.out.println(pr.stdout);
+ System.err.println(pr.stderr);
+ Assert.assertTrue(pr.stderr.contains("java.security.AccessControlException: access denied (java.lang.RuntimePermission setContextClassLoader)"));
+ Assert.assertFalse(pr.stderr.contains("ClassNotFoundException"));
+ Assert.assertFalse(pr.stdout.length() > 2);
+ Assert.assertFalse(pr.wasTerminated);
+ Assert.assertEquals((Integer) 0, pr.returnValue);
+ }
+}