aboutsummaryrefslogtreecommitdiffstats
path: root/tests/reproducers
diff options
context:
space:
mode:
Diffstat (limited to 'tests/reproducers')
-rw-r--r--tests/reproducers/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java23
-rw-r--r--tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java37
2 files changed, 23 insertions, 37 deletions
diff --git a/tests/reproducers/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java b/tests/reproducers/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java
index 9d2b44d..6650bed 100644
--- a/tests/reproducers/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java
+++ b/tests/reproducers/simple/AppletTakesLastParam/srcs/AppletTakesLastParam.java
@@ -38,26 +38,11 @@ obligated to do so. If you do not wish to do so, delete this
exception statement from your version.
*/
public class AppletTakesLastParam extends Applet {
-
- private class Killer extends Thread {
-
- public int n = 2000;
-
- @Override
- public void run() {
- try {
- Thread.sleep(n);
- System.out.println("Applet killing itself after " + n + " ms");
- System.exit(0);
- } catch (Exception ex) {
- }
- }
- }
- private Killer killer = new Killer();
-
- @Override
public void init() {
System.out.println(getParameter("param"));
- killer.start();
+ System.out.println("*** APPLET FINISHED ***");
+
+ // Exits JNLP-launched applets, throws exception on normal applet:
+ System.exit(0);
}
}
diff --git a/tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java b/tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java
index 206f6de..53bf563 100644
--- a/tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java
+++ b/tests/reproducers/simple/AppletTakesLastParam/testcases/AppletTakesLastParamTests.java
@@ -1,4 +1,4 @@
-/* AppletTestTests.java
+/* AppletTakesLastParamTests.java
Copyright (C) 2011 Red Hat, Inc.
This file is part of IcedTea.
@@ -35,8 +35,8 @@ 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 net.sourceforge.jnlp.ServerAccess.ProcessResult;
+import net.sourceforge.jnlp.ProcessResult;
+import net.sourceforge.jnlp.ServerAccess.AutoClose;
import net.sourceforge.jnlp.browsertesting.BrowserTest;
import net.sourceforge.jnlp.browsertesting.Browsers;
import net.sourceforge.jnlp.annotations.TestInBrowsers;
@@ -45,24 +45,25 @@ import org.junit.Assert;
import org.junit.Test;
public class AppletTakesLastParamTests extends BrowserTest {
+ private void evaluate(ProcessResult pr) {
+ String firstParam = "value1";
+ String secondParam = "value2";
- @Test
- public void AppletTest() throws Exception {
- ServerAccess.ProcessResult pr = server.executeJavaws(null, "/appletTakesLastParam.jnlp");
- evaluateApplet(pr);
- }
-
- private void evaluateApplet(ProcessResult pr) {
- String s0 = "value1";
- Assert.assertTrue("AppletTakesLastParam stdout should not contain " + s0 + " but did.", !pr.stdout.contains(s0));
- String s1 = "value2";
- Assert.assertTrue("AppletTakesLastParam stdout should contain " + s1 + " but did not.", pr.stdout.contains(s1));
+ Assert.assertFalse("AppletTakesLastParam stdout should not contain " + firstParam + " but did.",
+ pr.stdout.contains(firstParam));
+ Assert.assertTrue("AppletTakesLastParam stdout should contain " + secondParam + " but did not.",
+ pr.stdout.contains(secondParam));
}
@Test
@TestInBrowsers(testIn = {Browsers.one})
- public void AppletInFirefoxTest() throws Exception {
- ServerAccess.ProcessResult pr = server.executeBrowser("/appletTakesLastParam.html");
- evaluateApplet(pr);
+ public void appletTakesLastParam() throws Exception {
+ ProcessResult pr = server.executeBrowser("/appletTakesLastParam.html", AutoClose.CLOSE_ON_BOTH);
+ evaluate(pr);
+ }
+ @Test
+ public void jnlpTakesLastParam() throws Exception {
+ ProcessResult pr = server.executeJavaws("/appletTakesLastParam.jnlp");
+ evaluate(pr);
}
-}
+} \ No newline at end of file