aboutsummaryrefslogtreecommitdiffstats
path: root/tests/reproducers/simple/AppletTest
diff options
context:
space:
mode:
authorJiri Vanek <[email protected]>2012-07-11 16:18:58 +0200
committerJiri Vanek <[email protected]>2012-07-11 16:18:58 +0200
commitc3957858a80df0fedcce83e79cfdaec37efe9d7c (patch)
tree3bc683041be2fa46f9b613848217631936f0d78e /tests/reproducers/simple/AppletTest
parent3fc79cfd01d2f2e3ab4d2b91f35cd208f80dd3b0 (diff)
try to close browser before kill it
Diffstat (limited to 'tests/reproducers/simple/AppletTest')
-rw-r--r--tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java38
1 files changed, 21 insertions, 17 deletions
diff --git a/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java b/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java
index 9fd662d..4bfe347 100644
--- a/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java
+++ b/tests/reproducers/simple/AppletTest/testcases/AppletTestTests.java
@@ -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.ProcessResult;
import net.sourceforge.jnlp.ServerAccess;
-import net.sourceforge.jnlp.ServerAccess.ProcessResult;
import net.sourceforge.jnlp.browsertesting.BrowserTest;
import net.sourceforge.jnlp.browsertesting.Browsers;
import net.sourceforge.jnlp.annotations.Bug;
@@ -52,11 +52,11 @@ public class AppletTestTests extends BrowserTest {
@TestInBrowsers(testIn = {Browsers.googleChrome})
@NeedsDisplay
public void doubleChrome() throws Exception {
- server.PROCESS_TIMEOUT = 30 * 1000;
+ ServerAccess.PROCESS_TIMEOUT = 30 * 1000;
try {
//System.out.println("connecting AppletInFirefoxTest request in " + getBrowser().toString());
//just verify loging is recording browser
- ServerAccess.ProcessResult pr1 = server.executeBrowser("/appletAutoTests.html");
+ ProcessResult pr1 = server.executeBrowser("/appletAutoTests.html");
if (pr1.process == null) {
Assert.assertTrue("If proces was null here, then google-chrome had to not exist, and so "
+ ServerAccess.UNSET_BROWSER
@@ -65,28 +65,28 @@ public class AppletTestTests extends BrowserTest {
pr1.deadlyException.getMessage().contains(ServerAccess.UNSET_BROWSER));
return;
}
- evaluateApplet(pr1);
+ evaluateApplet(pr1,false);
Assert.assertTrue(pr1.wasTerminated);
//System.out.println("connecting AppletInFirefoxTest request in " + getBrowser().toString());
// just verify loging is recording browser
ServerAccess.ProcessResult pr = server.executeBrowser("/appletAutoTests.html");
- evaluateApplet(pr);
+ evaluateApplet(pr,false);
Assert.assertTrue(pr.wasTerminated);
} finally {
- server.PROCESS_TIMEOUT = 20 * 1000; //back to normal
+ ServerAccess.PROCESS_TIMEOUT = 20 * 1000; //back to normal
}
}
@Test
@NeedsDisplay
public void AppletTest() throws Exception {
- ServerAccess.ProcessResult pr = server.executeJavawsHeadless(null, "/AppletTest.jnlp");
- evaluateApplet(pr);
+ ProcessResult pr = server.executeJavawsHeadless(null, "/AppletTest.jnlp");
+ evaluateApplet(pr,true);
Assert.assertFalse(pr.wasTerminated);
Assert.assertEquals((Integer) 0, pr.returnValue);
}
- private void evaluateApplet(ProcessResult pr) {
+ private void evaluateApplet(ProcessResult pr, boolean javawsApplet) {
String s3 = "applet was initialised";
Assert.assertTrue("AppletTest stdout should contains " + s3 + " bud didn't", pr.stdout.contains(s3));
String s0 = "applet was started";
@@ -95,14 +95,18 @@ public class AppletTestTests extends BrowserTest {
Assert.assertTrue("AppletTest stdout should contains " + s1 + " bud didn't", pr.stdout.contains(s1));
String s2 = "value2";
Assert.assertTrue("AppletTest stdout should contains " + s2 + " bud didn't", pr.stdout.contains(s2));
- String s4 = "applet was stopped";
- Assert.assertFalse("AppletTest stdout shouldn't contains " + s4 + " bud did", pr.stdout.contains(s4));
- String s5 = "applet will be destroyed";
- Assert.assertFalse("AppletTest stdout shouldn't contains " + s5 + " bud did", pr.stdout.contains(s5));
String ss = "xception";
Assert.assertFalse("AppletTest stderr should not contains " + ss + " but did", pr.stderr.contains(ss));
String s7 = "Aplet killing himself after 2000 ms of life";
Assert.assertTrue("AppletTest stdout should contains " + s7 + " bud didn't", pr.stdout.contains(s7));
+ if (!javawsApplet) {
+ /*this is working correctly in most browser, but not in all. temporarily disabling
+ String s4 = "applet was stopped";
+ Assert.assertTrue("AppletTest stdout should contains " + s4 + " bud did't", pr.stdout.contains(s4));
+ String s5 = "applet will be destroyed";
+ Assert.assertTrue("AppletTest stdout should contains " + s5 + " bud did't", pr.stdout.contains(s5));
+ */
+ }
}
@Test
@@ -113,8 +117,8 @@ public class AppletTestTests extends BrowserTest {
//just verify loging is recordingb rowser
ServerAccess.PROCESS_TIMEOUT = 30 * 1000;
try {
- ServerAccess.ProcessResult pr = server.executeBrowser("/appletAutoTests2.html");
- evaluateApplet(pr);
+ ProcessResult pr = server.executeBrowser("/appletAutoTests2.html");
+ evaluateApplet(pr,false);
Assert.assertTrue(pr.wasTerminated);
//Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null
} finally {
@@ -129,9 +133,9 @@ public class AppletTestTests extends BrowserTest {
//just verify loging is recording browser
ServerAccess.PROCESS_TIMEOUT = 30 * 1000;
try {
- ServerAccess.ProcessResult pr = server.executeBrowser("/appletAutoTests.html");
+ ProcessResult pr = server.executeBrowser("/appletAutoTests.html");
pr.process.destroy();
- evaluateApplet(pr);
+ evaluateApplet(pr,false);
Assert.assertTrue(pr.wasTerminated);
//Assert.assertEquals((Integer) 0, pr.returnValue); due to destroy is null
} finally {